mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 12:19:54 +00:00
LibWeb/SVG: Implement SVGTransformList.length
This commit is contained in:
parent
ad9457b725
commit
4a1d02e7d8
Notes:
sideshowbarker
2024-07-17 03:03:15 +09:00
Author: https://github.com/jamierocks
Commit: 4a1d02e7d8
Pull-request: https://github.com/SerenityOS/serenity/pull/24525
3 changed files with 10 additions and 1 deletions
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -22,6 +22,8 @@ public:
|
|||
[[nodiscard]] static JS::NonnullGCPtr<SVGTransformList> create(JS::Realm& realm);
|
||||
virtual ~SVGTransformList() override;
|
||||
|
||||
WebIDL::UnsignedLong length();
|
||||
|
||||
WebIDL::ExceptionOr<JS::NonnullGCPtr<SVGTransform>> get_item(WebIDL::UnsignedLong index);
|
||||
|
||||
JS::NonnullGCPtr<SVGTransform> append_item(JS::NonnullGCPtr<SVGTransform> new_item);
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue