SVGBox.h 784 B

123456789101112131415161718192021222324252627282930
  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/BlockContainer.h>
  8. #include <LibWeb/SVG/SVGElement.h>
  9. #include <LibWeb/SVG/SVGGraphicsElement.h>
  10. namespace Web::Layout {
  11. class SVGBox : public Box {
  12. public:
  13. SVGBox(DOM::Document&, SVG::SVGElement&, NonnullRefPtr<CSS::StyleProperties>);
  14. virtual ~SVGBox() override = default;
  15. SVG::SVGElement& dom_node() { return verify_cast<SVG::SVGElement>(*Box::dom_node()); }
  16. SVG::SVGElement const& dom_node() const { return verify_cast<SVG::SVGElement>(*Box::dom_node()); }
  17. private:
  18. virtual bool is_svg_box() const final { return true; }
  19. };
  20. template<>
  21. inline bool Node::fast_is<SVGBox>() const { return is_svg_box(); }
  22. }