mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-07 21:59:54 +00:00
The spec defines a generic list interfaces that we can reuse. Currently we only have SVGTransformList, but we will need this to add SVGNumberList as well.
35 lines
1.1 KiB
C++
35 lines
1.1 KiB
C++
/*
|
|
* Copyright (c) 2024, MacDue <macdue@dueutil.tech>
|
|
* Copyright (c) 2025, Jelle Raaijmakers <jelle@ladybird.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <LibWeb/SVG/SVGList.h>
|
|
#include <LibWeb/SVG/SVGTransform.h>
|
|
|
|
namespace Web::SVG {
|
|
|
|
// https://svgwg.org/svg2-draft/single-page.html#coords-InterfaceSVGTransformList
|
|
class SVGTransformList final
|
|
: public Bindings::PlatformObject
|
|
, public SVGList<GC::Ref<SVGTransform>> {
|
|
WEB_PLATFORM_OBJECT(SVGTransformList, Bindings::PlatformObject);
|
|
GC_DECLARE_ALLOCATOR(SVGTransformList);
|
|
|
|
public:
|
|
[[nodiscard]] static GC::Ref<SVGTransformList> create(JS::Realm& realm, Vector<GC::Ref<SVGTransform>>, ReadOnlyList);
|
|
[[nodiscard]] static GC::Ref<SVGTransformList> create(JS::Realm& realm, ReadOnlyList);
|
|
virtual ~SVGTransformList() override = default;
|
|
|
|
private:
|
|
SVGTransformList(JS::Realm&, Vector<GC::Ref<SVGTransform>>, ReadOnlyList);
|
|
SVGTransformList(JS::Realm&, ReadOnlyList);
|
|
|
|
virtual void initialize(JS::Realm&) override;
|
|
virtual void visit_edges(Visitor&) override;
|
|
};
|
|
|
|
}
|