LibWeb/SVG: Implement SVGTransformList.length

This commit is contained in:
Jamie Mansfield 2024-06-02 12:46:15 +01:00 committed by Andreas Kling
commit 4a1d02e7d8
Notes: sideshowbarker 2024-07-17 03:03:15 +09:00
3 changed files with 10 additions and 1 deletions

View file

@ -23,6 +23,13 @@ SVGTransformList::~SVGTransformList() = default;
SVGTransformList::SVGTransformList(JS::Realm& realm)
: PlatformObject(realm) {};
// https://svgwg.org/svg2-draft/single-page.html#types-__svg__SVGNameList__length
WebIDL::UnsignedLong SVGTransformList::length()
{
// The length and numberOfItems IDL attributes represents the length of the list, and on getting simply return the length of the list.
return m_transforms.size();
}
// https://svgwg.org/svg2-draft/single-page.html#types-__svg__SVGNameList__getItem
WebIDL::ExceptionOr<JS::NonnullGCPtr<SVGTransform>> SVGTransformList::get_item(WebIDL::UnsignedLong index)
{