mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 11:49:44 +00:00
LibWeb: Add SVGAnimatedEnumeration
This commit is contained in:
parent
1aa50ac34a
commit
aeef179668
Notes:
github-actions[bot]
2025-02-22 09:15:33 +00:00
Author: https://github.com/gmta
Commit: aeef179668
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3657
8 changed files with 115 additions and 0 deletions
37
Libraries/LibWeb/SVG/SVGAnimatedEnumeration.h
Normal file
37
Libraries/LibWeb/SVG/SVGAnimatedEnumeration.h
Normal file
|
@ -0,0 +1,37 @@
|
|||
/*
|
||||
* Copyright (c) 2025, Jelle Raaijmakers <jelle@ladybird.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <LibWeb/Bindings/PlatformObject.h>
|
||||
|
||||
namespace Web::SVG {
|
||||
|
||||
// https://svgwg.org/svg2-draft/types.html#InterfaceSVGAnimatedEnumeration
|
||||
class SVGAnimatedEnumeration final : public Bindings::PlatformObject {
|
||||
WEB_PLATFORM_OBJECT(SVGAnimatedEnumeration, Bindings::PlatformObject);
|
||||
GC_DECLARE_ALLOCATOR(SVGAnimatedEnumeration);
|
||||
|
||||
public:
|
||||
[[nodiscard]] static GC::Ref<SVGAnimatedEnumeration> create(JS::Realm&, u16 value);
|
||||
virtual ~SVGAnimatedEnumeration() override;
|
||||
|
||||
u16 base_val() const { return base_or_anim_value(); }
|
||||
WebIDL::ExceptionOr<void> set_base_val(u16);
|
||||
|
||||
u16 anim_val() const { return base_or_anim_value(); }
|
||||
|
||||
private:
|
||||
SVGAnimatedEnumeration(JS::Realm&, u16 value);
|
||||
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
|
||||
u16 base_or_anim_value() const;
|
||||
|
||||
u16 m_value;
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue