2023-06-08 14:32:33 -04:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2023, Aliaksandr Kalenik <kalenik.aliaksandr@gmail.com>
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <AK/Optional.h>
|
|
|
|
#include <LibWeb/Layout/SVGGraphicsBox.h>
|
2023-07-22 14:24:55 -04:00
|
|
|
#include <LibWeb/SVG/SVGTextPositioningElement.h>
|
2023-06-08 14:32:33 -04:00
|
|
|
|
|
|
|
namespace Web::Layout {
|
|
|
|
|
|
|
|
class SVGTextBox final : public SVGGraphicsBox {
|
2024-11-14 10:01:23 -05:00
|
|
|
GC_CELL(SVGTextBox, SVGGraphicsBox);
|
|
|
|
GC_DECLARE_ALLOCATOR(SVGTextBox);
|
2023-06-08 14:32:33 -04:00
|
|
|
|
|
|
|
public:
|
2024-12-20 10:35:12 -05:00
|
|
|
SVGTextBox(DOM::Document&, SVG::SVGTextPositioningElement&, GC::Ref<CSS::ComputedProperties>);
|
2023-06-08 14:32:33 -04:00
|
|
|
virtual ~SVGTextBox() override = default;
|
|
|
|
|
2023-07-22 14:24:55 -04:00
|
|
|
SVG::SVGTextPositioningElement& dom_node() { return static_cast<SVG::SVGTextPositioningElement&>(SVGGraphicsBox::dom_node()); }
|
|
|
|
SVG::SVGTextPositioningElement const& dom_node() const { return static_cast<SVG::SVGTextPositioningElement const&>(SVGGraphicsBox::dom_node()); }
|
2023-06-08 14:32:33 -04:00
|
|
|
|
2024-11-14 10:01:23 -05:00
|
|
|
virtual GC::Ptr<Painting::Paintable> create_paintable() const override;
|
2023-06-08 14:32:33 -04:00
|
|
|
|
|
|
|
private:
|
|
|
|
CSSPixelPoint viewbox_origin() const;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|