diff --git a/Userland/Libraries/LibWeb/SVG/SVGTransformList.cpp b/Userland/Libraries/LibWeb/SVG/SVGTransformList.cpp index 664d1847dac..0548d7724e0 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGTransformList.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGTransformList.cpp @@ -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> SVGTransformList::get_item(WebIDL::UnsignedLong index) { diff --git a/Userland/Libraries/LibWeb/SVG/SVGTransformList.h b/Userland/Libraries/LibWeb/SVG/SVGTransformList.h index 34985803edd..a182a3b1b1c 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGTransformList.h +++ b/Userland/Libraries/LibWeb/SVG/SVGTransformList.h @@ -23,6 +23,7 @@ public: virtual ~SVGTransformList() override; WebIDL::UnsignedLong length(); + WebIDL::UnsignedLong number_of_items(); WebIDL::ExceptionOr> get_item(WebIDL::UnsignedLong index); diff --git a/Userland/Libraries/LibWeb/SVG/SVGTransformList.idl b/Userland/Libraries/LibWeb/SVG/SVGTransformList.idl index 495ed4cbbb9..0b9ed0deb99 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGTransformList.idl +++ b/Userland/Libraries/LibWeb/SVG/SVGTransformList.idl @@ -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);