From 59f74b909ba161a143fb4cd5cbaf6dcf6734d240 Mon Sep 17 00:00:00 2001 From: Jamie Mansfield Date: Tue, 9 Jul 2024 20:20:05 +0100 Subject: [PATCH] LibWeb: SVGElement includes GlobalEventHandlers This fixes many tests on wpt/html/webappapis/scripting/events/event-handler-all-global-events.html --- Userland/Libraries/LibWeb/SVG/SVGElement.h | 7 ++++++- Userland/Libraries/LibWeb/SVG/SVGElement.idl | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Userland/Libraries/LibWeb/SVG/SVGElement.h b/Userland/Libraries/LibWeb/SVG/SVGElement.h index 3771a49ccc0..d14a2e19380 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGElement.h +++ b/Userland/Libraries/LibWeb/SVG/SVGElement.h @@ -11,7 +11,9 @@ namespace Web::SVG { -class SVGElement : public DOM::Element { +class SVGElement + : public DOM::Element + , public HTML::GlobalEventHandlers { WEB_PLATFORM_OBJECT(SVGElement, DOM::Element); public: @@ -42,6 +44,9 @@ protected: JS::NonnullGCPtr svg_animated_length_for_property(CSS::PropertyID) const; private: + // ^HTML::GlobalEventHandlers + virtual JS::GCPtr global_event_handlers_to_event_target(FlyString const&) override { return *this; } + virtual bool is_svg_element() const final { return true; } }; diff --git a/Userland/Libraries/LibWeb/SVG/SVGElement.idl b/Userland/Libraries/LibWeb/SVG/SVGElement.idl index 09b1e68ce0f..f3a2493abaf 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGElement.idl +++ b/Userland/Libraries/LibWeb/SVG/SVGElement.idl @@ -8,5 +8,6 @@ interface SVGElement : Element { }; +SVGElement includes GlobalEventHandlers; SVGElement includes HTMLOrSVGElement; SVGElement includes ElementCSSInlineStyle;