mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-07 21:59:54 +00:00
LibWeb: Implement SVGAnimatedLengthList
This commit is contained in:
parent
797e6dd4eb
commit
527a293047
Notes:
github-actions[bot]
2025-11-20 22:16:33 +00:00
Author: https://github.com/gmta
Commit: 527a293047
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6878
8 changed files with 98 additions and 10 deletions
38
Libraries/LibWeb/SVG/SVGAnimatedLengthList.cpp
Normal file
38
Libraries/LibWeb/SVG/SVGAnimatedLengthList.cpp
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
/*
|
||||
* Copyright (c) 2025, Jelle Raaijmakers <jelle@ladybird.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <LibWeb/Bindings/Intrinsics.h>
|
||||
#include <LibWeb/Bindings/SVGAnimatedLengthListPrototype.h>
|
||||
#include <LibWeb/SVG/SVGAnimatedLengthList.h>
|
||||
|
||||
namespace Web::SVG {
|
||||
|
||||
GC_DEFINE_ALLOCATOR(SVGAnimatedLengthList);
|
||||
|
||||
GC::Ref<SVGAnimatedLengthList> SVGAnimatedLengthList::create(JS::Realm& realm, GC::Ref<SVGLengthList> base_val)
|
||||
{
|
||||
return realm.create<SVGAnimatedLengthList>(realm, base_val);
|
||||
}
|
||||
|
||||
SVGAnimatedLengthList::SVGAnimatedLengthList(JS::Realm& realm, GC::Ref<SVGLengthList> base_val)
|
||||
: PlatformObject(realm)
|
||||
, m_base_val(base_val)
|
||||
{
|
||||
}
|
||||
|
||||
void SVGAnimatedLengthList::initialize(JS::Realm& realm)
|
||||
{
|
||||
WEB_SET_PROTOTYPE_FOR_INTERFACE(SVGAnimatedLengthList);
|
||||
Base::initialize(realm);
|
||||
}
|
||||
|
||||
void SVGAnimatedLengthList::visit_edges(Visitor& visitor)
|
||||
{
|
||||
Base::visit_edges(visitor);
|
||||
visitor.visit(m_base_val);
|
||||
}
|
||||
|
||||
}
|
||||
38
Libraries/LibWeb/SVG/SVGAnimatedLengthList.h
Normal file
38
Libraries/LibWeb/SVG/SVGAnimatedLengthList.h
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
/*
|
||||
* Copyright (c) 2025, Jelle Raaijmakers <jelle@ladybird.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <LibWeb/Bindings/PlatformObject.h>
|
||||
#include <LibWeb/SVG/SVGLengthList.h>
|
||||
|
||||
namespace Web::SVG {
|
||||
|
||||
// https://svgwg.org/svg2-draft/types.html#InterfaceSVGAnimatedLengthList
|
||||
class SVGAnimatedLengthList final : public Bindings::PlatformObject {
|
||||
WEB_PLATFORM_OBJECT(SVGAnimatedLengthList, Bindings::PlatformObject);
|
||||
GC_DECLARE_ALLOCATOR(SVGAnimatedLengthList);
|
||||
|
||||
public:
|
||||
[[nodiscard]] static GC::Ref<SVGAnimatedLengthList> create(JS::Realm&, GC::Ref<SVGLengthList>);
|
||||
virtual ~SVGAnimatedLengthList() override = default;
|
||||
|
||||
// https://svgwg.org/svg2-draft/types.html#__svg__SVGAnimatedLengthList__baseVal
|
||||
GC::Ref<SVGLengthList> base_val() const { return m_base_val; }
|
||||
|
||||
// https://svgwg.org/svg2-draft/types.html#__svg__SVGAnimatedLengthList__animVal
|
||||
GC::Ref<SVGLengthList> anim_val() const { return m_base_val; }
|
||||
|
||||
private:
|
||||
SVGAnimatedLengthList(JS::Realm&, GC::Ref<SVGLengthList>);
|
||||
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
virtual void visit_edges(Visitor&) override;
|
||||
|
||||
GC::Ref<SVGLengthList> m_base_val;
|
||||
};
|
||||
|
||||
}
|
||||
8
Libraries/LibWeb/SVG/SVGAnimatedLengthList.idl
Normal file
8
Libraries/LibWeb/SVG/SVGAnimatedLengthList.idl
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
#import <SVG/SVGLengthList.idl>
|
||||
|
||||
// https://svgwg.org/svg2-draft/types.html#InterfaceSVGAnimatedLengthList
|
||||
[Exposed=Window]
|
||||
interface SVGAnimatedLengthList {
|
||||
[SameObject] readonly attribute SVGLengthList baseVal;
|
||||
[SameObject] readonly attribute SVGLengthList animVal;
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue