diff --git a/Libraries/LibWeb/SVG/SVGAElement.cpp b/Libraries/LibWeb/SVG/SVGAElement.cpp index 6fdfe9b3324..8613d8f3898 100644 --- a/Libraries/LibWeb/SVG/SVGAElement.cpp +++ b/Libraries/LibWeb/SVG/SVGAElement.cpp @@ -32,6 +32,7 @@ void SVGAElement::visit_edges(Cell::Visitor& visitor) Base::visit_edges(visitor); SVGURIReferenceMixin::visit_edges(visitor); visitor.visit(m_rel_list); + visitor.visit(m_target); } void SVGAElement::attribute_changed(FlyString const& name, Optional const& old_value, Optional const& value, Optional const& namespace_) @@ -61,6 +62,14 @@ i32 SVGAElement::default_tab_index_value() const return 0; } +// https://svgwg.org/svg2-draft/linking.html#__svg__SVGAElement__target +GC::Ref SVGAElement::target() +{ + if (!m_target) + m_target = SVGAnimatedString::create(realm(), *this, HTML::AttributeNames::target); + return *m_target; +} + // https://svgwg.org/svg2-draft/linking.html#__svg__SVGAElement__relList GC::Ref SVGAElement::rel_list() { diff --git a/Libraries/LibWeb/SVG/SVGAElement.h b/Libraries/LibWeb/SVG/SVGAElement.h index 539b932bca8..f85049ebf6d 100644 --- a/Libraries/LibWeb/SVG/SVGAElement.h +++ b/Libraries/LibWeb/SVG/SVGAElement.h @@ -21,6 +21,8 @@ class SVGAElement final public: virtual ~SVGAElement() override; + GC::Ref target(); + GC::Ref rel_list(); virtual GC::Ptr create_layout_node(GC::Ref) override; @@ -38,6 +40,8 @@ private: virtual i32 default_tab_index_value() const override; GC::Ptr m_rel_list; + + GC::Ptr m_target; }; } diff --git a/Libraries/LibWeb/SVG/SVGAElement.idl b/Libraries/LibWeb/SVG/SVGAElement.idl index f2ddf394821..9fa6c4299fb 100644 --- a/Libraries/LibWeb/SVG/SVGAElement.idl +++ b/Libraries/LibWeb/SVG/SVGAElement.idl @@ -6,7 +6,7 @@ [Exposed=Window] interface SVGAElement : SVGGraphicsElement { - [FIXME, SameObject] readonly attribute SVGAnimatedString target; + [SameObject] readonly attribute SVGAnimatedString target; [Reflect] attribute DOMString download; [Reflect] attribute USVString ping; [Reflect] attribute DOMString rel; diff --git a/Tests/LibWeb/Text/expected/wpt-import/svg/idlharness.window.txt b/Tests/LibWeb/Text/expected/wpt-import/svg/idlharness.window.txt index 40ed1a69e6e..3cc82797627 100644 --- a/Tests/LibWeb/Text/expected/wpt-import/svg/idlharness.window.txt +++ b/Tests/LibWeb/Text/expected/wpt-import/svg/idlharness.window.txt @@ -2,8 +2,8 @@ Harness status: OK Found 1781 tests -934 Pass -847 Fail +940 Pass +841 Fail Pass idl_test setup Pass idl_test validation Pass Partial interface Document: original interface defined @@ -346,10 +346,10 @@ Pass SVGAnimatedString interface: existence and properties of interface prototyp Pass SVGAnimatedString interface: existence and properties of interface prototype object's @@unscopables property Pass SVGAnimatedString interface: attribute baseVal Pass SVGAnimatedString interface: attribute animVal -Fail SVGAnimatedString must be primary interface of objects.a.target -Fail Stringification of objects.a.target -Fail SVGAnimatedString interface: objects.a.target must inherit property "baseVal" with the proper type -Fail SVGAnimatedString interface: objects.a.target must inherit property "animVal" with the proper type +Pass SVGAnimatedString must be primary interface of objects.a.target +Pass Stringification of objects.a.target +Pass SVGAnimatedString interface: objects.a.target must inherit property "baseVal" with the proper type +Pass SVGAnimatedString interface: objects.a.target must inherit property "animVal" with the proper type Pass SVGAnimatedRect interface: existence and properties of interface object Pass SVGAnimatedRect interface object length Pass SVGAnimatedRect interface object name @@ -1552,7 +1552,7 @@ Pass SVGAElement interface object name Pass SVGAElement interface: existence and properties of interface prototype object Pass SVGAElement interface: existence and properties of interface prototype object's "constructor" property Pass SVGAElement interface: existence and properties of interface prototype object's @@unscopables property -Fail SVGAElement interface: attribute target +Pass SVGAElement interface: attribute target Pass SVGAElement interface: attribute download Pass SVGAElement interface: attribute ping Pass SVGAElement interface: attribute rel @@ -1574,7 +1574,7 @@ Fail SVGAElement interface: attribute hash Pass SVGAElement interface: attribute href Pass SVGAElement must be primary interface of objects.a Pass Stringification of objects.a -Fail SVGAElement interface: objects.a must inherit property "target" with the proper type +Pass SVGAElement interface: objects.a must inherit property "target" with the proper type Pass SVGAElement interface: objects.a must inherit property "download" with the proper type Pass SVGAElement interface: objects.a must inherit property "ping" with the proper type Pass SVGAElement interface: objects.a must inherit property "rel" with the proper type