1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 11:27:34 +00:00

LibWeb: Implement the SVGAnimatedLength type

This commit is contained in:
Timothy Flynn 2022-03-21 14:33:11 -04:00 committed by Andreas Kling
parent ebf3829f1c
commit 7a6b4e33ba
5 changed files with 71 additions and 0 deletions

View file

@ -0,0 +1,37 @@
/*
* Copyright (c) 2022, Tim Flynn <trflynn89@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/RefCounted.h>
#include <AK/Weakable.h>
#include <LibWeb/Bindings/Wrappable.h>
#include <LibWeb/SVG/SVGLength.h>
namespace Web::SVG {
// https://www.w3.org/TR/SVG11/types.html#InterfaceSVGAnimatedLength
class SVGAnimatedLength
: public RefCounted<SVGAnimatedLength>
, public Bindings::Wrappable
, public Weakable<SVGAnimatedLength> {
public:
using WrapperType = Bindings::SVGAnimatedLengthWrapper;
static NonnullRefPtr<SVGAnimatedLength> create(NonnullRefPtr<SVGLength> base_val, NonnullRefPtr<SVGLength> anim_val);
virtual ~SVGAnimatedLength() = default;
NonnullRefPtr<SVGLength> const& base_val() const { return m_base_val; }
NonnullRefPtr<SVGLength> const& anim_val() const { return m_anim_val; }
private:
SVGAnimatedLength(NonnullRefPtr<SVGLength> base_val, NonnullRefPtr<SVGLength> anim_val);
NonnullRefPtr<SVGLength> m_base_val;
NonnullRefPtr<SVGLength> m_anim_val;
};
}