SVGGeometryBox.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  1. /*
  2. * Copyright (c) 2020, Matthew Olsson <mattco@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <AK/Optional.h>
  8. #include <LibWeb/Layout/SVGGraphicsBox.h>
  9. #include <LibWeb/SVG/SVGGeometryElement.h>
  10. namespace Web::Layout {
  11. class SVGGeometryBox final : public SVGGraphicsBox {
  12. JS_CELL(SVGGeometryBox, SVGGraphicsBox);
  13. public:
  14. SVGGeometryBox(DOM::Document&, SVG::SVGGeometryElement&, NonnullRefPtr<CSS::StyleProperties>);
  15. virtual ~SVGGeometryBox() override = default;
  16. SVG::SVGGeometryElement& dom_node() { return static_cast<SVG::SVGGeometryElement&>(SVGGraphicsBox::dom_node()); }
  17. SVG::SVGGeometryElement const& dom_node() const { return static_cast<SVG::SVGGeometryElement const&>(SVGGraphicsBox::dom_node()); }
  18. virtual JS::GCPtr<Painting::Paintable> create_paintable() const override;
  19. private:
  20. virtual bool is_svg_geometry_box() const final { return true; }
  21. };
  22. template<>
  23. inline bool Node::fast_is<SVGGeometryBox>() const { return is_svg_geometry_box(); }
  24. }