2023-07-22 19:24:55 +01:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2023, MacDue <macdue@dueutil.tech>
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <LibWeb/SVG/SVGTextContentElement.h>
|
|
|
|
#include <LibWeb/WebIDL/ExceptionOr.h>
|
|
|
|
|
|
|
|
namespace Web::SVG {
|
|
|
|
|
|
|
|
// https://svgwg.org/svg2-draft/text.html#InterfaceSVGTextPositioningElement
|
|
|
|
class SVGTextPositioningElement : public SVGTextContentElement {
|
|
|
|
WEB_PLATFORM_OBJECT(SVGTextPositioningElement, SVGTextContentElement);
|
|
|
|
|
|
|
|
public:
|
2024-11-14 08:14:16 -05:00
|
|
|
virtual void attribute_changed(FlyString const& name, Optional<String> const& old_value, Optional<String> const& value, Optional<FlyString> const& namespace_) override;
|
2023-07-22 19:24:55 +01:00
|
|
|
|
2024-07-21 16:21:28 +02:00
|
|
|
Gfx::FloatPoint get_offset(CSSPixelSize const& viewport_size) const;
|
2023-07-22 19:24:55 +01:00
|
|
|
|
2024-11-15 04:01:23 +13:00
|
|
|
GC::Ref<SVGAnimatedLength> x() const;
|
|
|
|
GC::Ref<SVGAnimatedLength> y() const;
|
|
|
|
GC::Ref<SVGAnimatedLength> dx() const;
|
|
|
|
GC::Ref<SVGAnimatedLength> dy() const;
|
2023-07-22 19:24:55 +01:00
|
|
|
|
|
|
|
protected:
|
|
|
|
SVGTextPositioningElement(DOM::Document&, DOM::QualifiedName);
|
|
|
|
|
2023-08-07 08:41:28 +02:00
|
|
|
virtual void initialize(JS::Realm&) override;
|
2023-07-22 19:24:55 +01:00
|
|
|
|
|
|
|
private:
|
2024-07-21 16:21:28 +02:00
|
|
|
Optional<NumberPercentage> m_x;
|
|
|
|
Optional<NumberPercentage> m_y;
|
|
|
|
Optional<NumberPercentage> m_dx;
|
|
|
|
Optional<NumberPercentage> m_dy;
|
2023-07-22 19:24:55 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|