mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-02 22:30:31 +00:00
LibWeb: Implement the SVGGeometryElement.pathLength
attribute
This commit is contained in:
parent
410e82c9fd
commit
caf45f2317
Notes:
github-actions[bot]
2025-07-11 23:50:23 +00:00
Author: https://github.com/tcl3
Commit: caf45f2317
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5410
Reviewed-by: https://github.com/shannonbooth
6 changed files with 54 additions and 10 deletions
|
@ -22,6 +22,12 @@ void SVGGeometryElement::initialize(JS::Realm& realm)
|
|||
Base::initialize(realm);
|
||||
}
|
||||
|
||||
void SVGGeometryElement::visit_edges(Cell::Visitor& visitor)
|
||||
{
|
||||
Base::visit_edges(visitor);
|
||||
visitor.visit(m_path_length);
|
||||
}
|
||||
|
||||
GC::Ptr<Layout::Node> SVGGeometryElement::create_layout_node(GC::Ref<CSS::ComputedProperties> style)
|
||||
{
|
||||
return heap().allocate<Layout::SVGGeometryBox>(document(), *this, move(style));
|
||||
|
@ -38,4 +44,11 @@ GC::Ref<Geometry::DOMPoint> SVGGeometryElement::get_point_at_length(float distan
|
|||
return Geometry::DOMPoint::construct_impl(realm(), 0, 0, 0, 0);
|
||||
}
|
||||
|
||||
GC::Ref<SVGAnimatedNumber> SVGGeometryElement::path_length()
|
||||
{
|
||||
if (!m_path_length)
|
||||
m_path_length = SVGAnimatedNumber::create(realm(), *this, AttributeNames::pathLength, 0.f);
|
||||
return *m_path_length;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue