LibWeb/SVG: Implement the SVGAElement.target attribute

This commit is contained in:
Tim Ledbetter 2025-07-12 02:06:51 +01:00 committed by Jelle Raaijmakers
commit d86f0a1b29
Notes: github-actions[bot] 2025-07-12 09:06:57 +00:00
4 changed files with 22 additions and 9 deletions

View file

@ -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<String> const& old_value, Optional<String> const& value, Optional<FlyString> 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<SVGAnimatedString> 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<DOM::DOMTokenList> SVGAElement::rel_list()
{