mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 04:39:06 +00:00
LibWeb/SVG: Implement the SVGAElement.target
attribute
This commit is contained in:
parent
910fd426a2
commit
d86f0a1b29
Notes:
github-actions[bot]
2025-07-12 09:06:57 +00:00
Author: https://github.com/tcl3
Commit: d86f0a1b29
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5412
Reviewed-by: https://github.com/gmta ✅
Reviewed-by: https://github.com/shannonbooth
4 changed files with 22 additions and 9 deletions
|
@ -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()
|
||||
{
|
||||
|
|
|
@ -21,6 +21,8 @@ class SVGAElement final
|
|||
public:
|
||||
virtual ~SVGAElement() override;
|
||||
|
||||
GC::Ref<SVGAnimatedString> target();
|
||||
|
||||
GC::Ref<DOM::DOMTokenList> rel_list();
|
||||
|
||||
virtual GC::Ptr<Layout::Node> create_layout_node(GC::Ref<CSS::ComputedProperties>) override;
|
||||
|
@ -38,6 +40,8 @@ private:
|
|||
virtual i32 default_tab_index_value() const override;
|
||||
|
||||
GC::Ptr<DOM::DOMTokenList> m_rel_list;
|
||||
|
||||
GC::Ptr<SVGAnimatedString> m_target;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue