LibWeb/SVG: Implement SVGTransformList.numberOfItems

This commit is contained in:
Jamie Mansfield 2024-06-02 12:48:35 +01:00 committed by Andreas Kling
parent 4a1d02e7d8
commit 48e834918a
Notes: sideshowbarker 2024-07-17 05:18:58 +09:00
3 changed files with 9 additions and 1 deletions

View File

@ -30,6 +30,13 @@ WebIDL::UnsignedLong SVGTransformList::length()
return m_transforms.size();
}
// https://svgwg.org/svg2-draft/single-page.html#types-__svg__SVGNameList__numberOfItems
WebIDL::UnsignedLong SVGTransformList::number_of_items()
{
// 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)
{

View File

@ -23,6 +23,7 @@ public:
virtual ~SVGTransformList() override;
WebIDL::UnsignedLong length();
WebIDL::UnsignedLong number_of_items();
WebIDL::ExceptionOr<JS::NonnullGCPtr<SVGTransform>> get_item(WebIDL::UnsignedLong index);

View File

@ -4,7 +4,7 @@
[Exposed=Window]
interface SVGTransformList {
readonly attribute unsigned long length;
[FIXME] readonly attribute unsigned long numberOfItems;
readonly attribute unsigned long numberOfItems;
[FIXME] undefined clear();
// FIXME: SVGTransform initialize(SVGTransform newItem);