SVGBox.h 811 B

1234567891011121314151617181920212223242526272829303132
  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. JS_CELL(SVGBox, Box);
  13. public:
  14. SVGBox(DOM::Document&, SVG::SVGElement&, NonnullRefPtr<CSS::StyleProperties>);
  15. virtual ~SVGBox() override = default;
  16. SVG::SVGElement& dom_node() { return verify_cast<SVG::SVGElement>(*Box::dom_node()); }
  17. SVG::SVGElement const& dom_node() const { return verify_cast<SVG::SVGElement>(*Box::dom_node()); }
  18. private:
  19. virtual bool is_svg_box() const final { return true; }
  20. };
  21. template<>
  22. inline bool Node::fast_is<SVGBox>() const { return is_svg_box(); }
  23. }