SVGGeometryBox.h 951 B

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