1
0
Fork 0
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:
PrestonLTaylor 2023-05-30 21:23:52 +01:00 committed by Andreas Kling
parent b322abd8d0
commit c7c3043aa2
Notes: sideshowbarker 2024-07-17 09:47:09 +09:00
10 changed files with 323 additions and 1 deletions

View file

@ -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;
}