2020-10-05 16:14:36 -07:00
|
|
|
/*
|
2021-04-22 16:53:07 -07:00
|
|
|
* Copyright (c) 2020, Matthew Olsson <mattco@serenityos.org>
|
2020-10-05 16:14:36 -07:00
|
|
|
*
|
2021-04-22 01:24:48 -07:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-10-05 16:14:36 -07:00
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2023-04-11 00:18:28 +01:00
|
|
|
#include <AK/Optional.h>
|
2020-11-22 15:53:01 +01:00
|
|
|
#include <LibWeb/Layout/SVGGraphicsBox.h>
|
2022-02-11 12:32:55 +00:00
|
|
|
#include <LibWeb/SVG/SVGGeometryElement.h>
|
2020-10-05 16:14:36 -07:00
|
|
|
|
2020-11-22 15:53:01 +01:00
|
|
|
namespace Web::Layout {
|
2020-10-05 16:14:36 -07:00
|
|
|
|
2022-02-11 12:37:22 +00:00
|
|
|
class SVGGeometryBox final : public SVGGraphicsBox {
|
2024-11-15 04:01:23 +13:00
|
|
|
GC_CELL(SVGGeometryBox, SVGGraphicsBox);
|
|
|
|
GC_DECLARE_ALLOCATOR(SVGGeometryBox);
|
2022-10-17 14:41:50 +02:00
|
|
|
|
2020-10-05 16:14:36 -07:00
|
|
|
public:
|
2024-12-20 16:35:12 +01:00
|
|
|
SVGGeometryBox(DOM::Document&, SVG::SVGGeometryElement&, GC::Ref<CSS::ComputedProperties>);
|
2022-02-11 12:37:22 +00:00
|
|
|
virtual ~SVGGeometryBox() override = default;
|
2020-10-05 16:14:36 -07:00
|
|
|
|
2023-03-10 21:15:15 +01:00
|
|
|
SVG::SVGGeometryElement& dom_node() { return static_cast<SVG::SVGGeometryElement&>(SVGGraphicsBox::dom_node()); }
|
|
|
|
SVG::SVGGeometryElement const& dom_node() const { return static_cast<SVG::SVGGeometryElement const&>(SVGGraphicsBox::dom_node()); }
|
2020-10-05 16:14:36 -07:00
|
|
|
|
2024-11-15 04:01:23 +13:00
|
|
|
virtual GC::Ptr<Painting::Paintable> create_paintable() const override;
|
2022-03-10 22:38:08 +01:00
|
|
|
|
2021-10-18 16:26:05 +02:00
|
|
|
private:
|
2022-02-11 12:37:22 +00:00
|
|
|
virtual bool is_svg_geometry_box() const final { return true; }
|
2020-10-05 16:14:36 -07:00
|
|
|
};
|
|
|
|
|
2021-10-18 16:26:05 +02:00
|
|
|
template<>
|
2022-02-11 12:37:22 +00:00
|
|
|
inline bool Node::fast_is<SVGGeometryBox>() const { return is_svg_geometry_box(); }
|
2021-10-18 16:26:05 +02:00
|
|
|
|
2020-10-05 16:14:36 -07:00
|
|
|
}
|