2022-03-20 11:20:06 +01:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2022, Andreas Kling <kling@serenityos.org>
|
|
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <LibWeb/SVG/SVGGraphicsElement.h>
|
2023-01-06 13:19:34 -05:00
|
|
|
#include <LibWeb/WebIDL/ExceptionOr.h>
|
2022-03-20 11:20:06 +01:00
|
|
|
|
|
|
|
|
namespace Web::SVG {
|
|
|
|
|
|
|
|
|
|
// https://svgwg.org/svg2-draft/text.html#InterfaceSVGTextContentElement
|
|
|
|
|
class SVGTextContentElement : public SVGGraphicsElement {
|
2022-08-28 13:42:07 +02:00
|
|
|
WEB_PLATFORM_OBJECT(SVGTextContentElement, SVGGraphicsElement);
|
|
|
|
|
|
2022-03-20 11:20:06 +01:00
|
|
|
public:
|
2023-06-08 21:32:33 +03:00
|
|
|
virtual JS::GCPtr<Layout::Node> create_layout_node(NonnullRefPtr<CSS::StyleProperties>) override;
|
|
|
|
|
|
|
|
|
|
virtual void parse_attribute(DeprecatedFlyString const& name, DeprecatedString const& value) override;
|
|
|
|
|
|
2023-01-06 13:19:34 -05:00
|
|
|
WebIDL::ExceptionOr<int> get_number_of_chars() const;
|
2022-03-20 11:20:06 +01:00
|
|
|
|
2023-06-08 21:32:33 +03:00
|
|
|
Gfx::FloatPoint get_offset() const;
|
|
|
|
|
|
2022-08-28 13:42:07 +02:00
|
|
|
protected:
|
2022-03-20 11:20:06 +01:00
|
|
|
SVGTextContentElement(DOM::Document&, DOM::QualifiedName);
|
2023-01-10 06:28:20 -05:00
|
|
|
|
2023-01-28 12:33:35 -05:00
|
|
|
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
2023-06-08 21:32:33 +03:00
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
float m_x { 0 };
|
|
|
|
|
float m_y { 0 };
|
|
|
|
|
float m_dx { 0 };
|
|
|
|
|
float m_dy { 0 };
|
2022-03-20 11:20:06 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
}
|