From 77847cbb0ec0e2af46756600cb33c3cd62d4aa5c Mon Sep 17 00:00:00 2001 From: Jamie Mansfield Date: Fri, 16 Aug 2024 16:30:06 +0100 Subject: [PATCH] LibWeb/SVG: Add missing SVGGElement IDL file (cherry picked from commit ea61e189eb31b185bfd7ccf381258d5ab5023072) --- Meta/gn/secondary/Userland/Libraries/LibWeb/idl_files.gni | 1 + Tests/LibWeb/Text/expected/all-window-properties.txt | 1 + Userland/Libraries/LibWeb/SVG/SVGGElement.cpp | 8 ++++++++ Userland/Libraries/LibWeb/SVG/SVGGElement.h | 2 ++ Userland/Libraries/LibWeb/SVG/SVGGElement.idl | 6 ++++++ Userland/Libraries/LibWeb/idl_files.cmake | 1 + 6 files changed, 19 insertions(+) create mode 100644 Userland/Libraries/LibWeb/SVG/SVGGElement.idl diff --git a/Meta/gn/secondary/Userland/Libraries/LibWeb/idl_files.gni b/Meta/gn/secondary/Userland/Libraries/LibWeb/idl_files.gni index 48a0a127d5f..e1da303586c 100644 --- a/Meta/gn/secondary/Userland/Libraries/LibWeb/idl_files.gni +++ b/Meta/gn/secondary/Userland/Libraries/LibWeb/idl_files.gni @@ -296,6 +296,7 @@ standard_idl_files = [ "//Userland/Libraries/LibWeb/SVG/SVGElement.idl", "//Userland/Libraries/LibWeb/SVG/SVGEllipseElement.idl", "//Userland/Libraries/LibWeb/SVG/SVGForeignObjectElement.idl", + "//Userland/Libraries/LibWeb/SVG/SVGGElement.idl", "//Userland/Libraries/LibWeb/SVG/SVGGeometryElement.idl", "//Userland/Libraries/LibWeb/SVG/SVGGradientElement.idl", "//Userland/Libraries/LibWeb/SVG/SVGGraphicsElement.idl", diff --git a/Tests/LibWeb/Text/expected/all-window-properties.txt b/Tests/LibWeb/Text/expected/all-window-properties.txt index 114e58585f0..59f318ba324 100644 --- a/Tests/LibWeb/Text/expected/all-window-properties.txt +++ b/Tests/LibWeb/Text/expected/all-window-properties.txt @@ -284,6 +284,7 @@ SVGDescElement SVGElement SVGEllipseElement SVGForeignObjectElement +SVGGElement SVGGeometryElement SVGGradientElement SVGGraphicsElement diff --git a/Userland/Libraries/LibWeb/SVG/SVGGElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGGElement.cpp index 87755e7de58..b004a34bc1a 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGGElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGGElement.cpp @@ -5,6 +5,8 @@ */ #include +#include +#include #include #include #include @@ -18,6 +20,12 @@ SVGGElement::SVGGElement(DOM::Document& document, DOM::QualifiedName qualified_n { } +void SVGGElement::initialize(JS::Realm& realm) +{ + Base::initialize(realm); + WEB_SET_PROTOTYPE_FOR_INTERFACE(SVGGElement); +} + JS::GCPtr SVGGElement::create_layout_node(NonnullRefPtr style) { return heap().allocate_without_realm(document(), *this, move(style)); diff --git a/Userland/Libraries/LibWeb/SVG/SVGGElement.h b/Userland/Libraries/LibWeb/SVG/SVGGElement.h index 3431a9ebe7e..233303df138 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGGElement.h +++ b/Userland/Libraries/LibWeb/SVG/SVGGElement.h @@ -21,6 +21,8 @@ public: private: SVGGElement(DOM::Document&, DOM::QualifiedName); + + virtual void initialize(JS::Realm&) override; }; } diff --git a/Userland/Libraries/LibWeb/SVG/SVGGElement.idl b/Userland/Libraries/LibWeb/SVG/SVGGElement.idl new file mode 100644 index 00000000000..91158d62f7a --- /dev/null +++ b/Userland/Libraries/LibWeb/SVG/SVGGElement.idl @@ -0,0 +1,6 @@ +#import + +// https://svgwg.org/svg2-draft/struct.html#InterfaceSVGGElement +[Exposed=Window] +interface SVGGElement : SVGGraphicsElement { +}; diff --git a/Userland/Libraries/LibWeb/idl_files.cmake b/Userland/Libraries/LibWeb/idl_files.cmake index 4e49c4fe8b2..fcc0ffb6fef 100644 --- a/Userland/Libraries/LibWeb/idl_files.cmake +++ b/Userland/Libraries/LibWeb/idl_files.cmake @@ -275,6 +275,7 @@ libweb_js_bindings(SVG/SVGClipPathElement) libweb_js_bindings(SVG/SVGDefsElement) libweb_js_bindings(SVG/SVGDescElement) libweb_js_bindings(SVG/SVGElement) +libweb_js_bindings(SVG/SVGGElement) libweb_js_bindings(SVG/SVGGeometryElement) libweb_js_bindings(SVG/SVGGradientElement) libweb_js_bindings(SVG/SVGGraphicsElement)