mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-10 18:10:56 +09:00
LibWeb: Implement the <use>
SVG element
The SVG <use> element is used to be able to reuse other SVG graphics without having to re-write the svg element. We now support this feature! :^)
This commit is contained in:
parent
b322abd8d0
commit
c7c3043aa2
Notes:
sideshowbarker
2024-07-17 09:47:09 +09:00
Author: https://github.com/PrestonLTaylor
Commit: c7c3043aa2
Pull-request: https://github.com/SerenityOS/serenity/pull/19177
Reviewed-by: https://github.com/awesomekling
10 changed files with 323 additions and 1 deletions
|
@ -98,6 +98,7 @@
|
|||
#include <LibWeb/SVG/SVGSVGElement.h>
|
||||
#include <LibWeb/SVG/SVGStopElement.h>
|
||||
#include <LibWeb/SVG/SVGTextContentElement.h>
|
||||
#include <LibWeb/SVG/SVGUseElement.h>
|
||||
#include <LibWeb/SVG/TagNames.h>
|
||||
#include <LibWeb/WebIDL/AbstractOperations.h>
|
||||
|
||||
|
@ -455,6 +456,8 @@ static WebIDL::ExceptionOr<JS::GCPtr<SVG::SVGElement>> create_svg_element(JS::Re
|
|||
return MUST_OR_THROW_OOM(realm.heap().allocate<SVG::SVGStopElement>(realm, document, move(qualified_name)));
|
||||
if (local_name == SVG::TagNames::text)
|
||||
return MUST_OR_THROW_OOM(realm.heap().allocate<SVG::SVGTextContentElement>(realm, document, move(qualified_name)));
|
||||
if (local_name == SVG::TagNames::use)
|
||||
return MUST_OR_THROW_OOM(realm.heap().allocate<SVG::SVGUseElement>(realm, document, move(qualified_name)));
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue