SVGSVGBox.h 933 B

123456789101112131415161718192021222324252627282930313233343536
  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/ReplacedBox.h>
  8. #include <LibWeb/SVG/SVGSVGElement.h>
  9. namespace Web::Layout {
  10. class SVGSVGBox final : public ReplacedBox {
  11. JS_CELL(SVGSVGBox, ReplacedBox);
  12. public:
  13. SVGSVGBox(DOM::Document&, SVG::SVGSVGElement&, NonnullRefPtr<CSS::StyleProperties>);
  14. virtual ~SVGSVGBox() override = default;
  15. SVG::SVGSVGElement& dom_node() { return verify_cast<SVG::SVGSVGElement>(ReplacedBox::dom_node()); }
  16. virtual bool can_have_children() const override { return true; }
  17. virtual JS::GCPtr<Painting::Paintable> create_paintable() const override;
  18. virtual void prepare_for_replaced_layout() override;
  19. private:
  20. virtual bool is_svg_svg_box() const final { return true; }
  21. };
  22. template<>
  23. inline bool Node::fast_is<SVGSVGBox>() const { return is_svg_svg_box(); }
  24. }