diff --git a/Userland/Libraries/LibWeb/SVG/SVGTransformList.cpp b/Userland/Libraries/LibWeb/SVG/SVGTransformList.cpp index b582f268ece..664d1847dac 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGTransformList.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGTransformList.cpp @@ -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> SVGTransformList::get_item(WebIDL::UnsignedLong index) { diff --git a/Userland/Libraries/LibWeb/SVG/SVGTransformList.h b/Userland/Libraries/LibWeb/SVG/SVGTransformList.h index e4f2b213161..34985803edd 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGTransformList.h +++ b/Userland/Libraries/LibWeb/SVG/SVGTransformList.h @@ -22,6 +22,8 @@ public: [[nodiscard]] static JS::NonnullGCPtr create(JS::Realm& realm); virtual ~SVGTransformList() override; + WebIDL::UnsignedLong length(); + WebIDL::ExceptionOr> get_item(WebIDL::UnsignedLong index); JS::NonnullGCPtr append_item(JS::NonnullGCPtr new_item); diff --git a/Userland/Libraries/LibWeb/SVG/SVGTransformList.idl b/Userland/Libraries/LibWeb/SVG/SVGTransformList.idl index 2baf34e0b99..495ed4cbbb9 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGTransformList.idl +++ b/Userland/Libraries/LibWeb/SVG/SVGTransformList.idl @@ -3,7 +3,7 @@ // https://svgwg.org/svg2-draft/single-page.html#coords-InterfaceSVGTransformList [Exposed=Window] interface SVGTransformList { - [FIXME] readonly attribute unsigned long length; + readonly attribute unsigned long length; [FIXME] readonly attribute unsigned long numberOfItems; [FIXME] undefined clear();