SVGSVGElement.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*
  2. * Copyright (c) 2020, Matthew Olsson <matthewcolsson@gmail.com>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <LibGfx/Bitmap.h>
  8. #include <LibWeb/SVG/SVGGraphicsElement.h>
  9. #include <LibWeb/SVG/ViewBox.h>
  10. namespace Web::SVG {
  11. class SVGSVGElement final : public SVGGraphicsElement {
  12. public:
  13. using WrapperType = Bindings::SVGSVGElementWrapper;
  14. SVGSVGElement(DOM::Document&, DOM::QualifiedName);
  15. virtual RefPtr<Layout::Node> create_layout_node(NonnullRefPtr<CSS::StyleProperties>) override;
  16. virtual void apply_presentational_hints(CSS::StyleProperties&) const override;
  17. virtual bool requires_svg_container() const override { return false; }
  18. virtual bool is_svg_container() const override { return true; }
  19. Optional<ViewBox> const& view_box() const { return m_view_box; }
  20. private:
  21. virtual bool is_svg_svg_element() const override { return true; }
  22. virtual void parse_attribute(FlyString const& name, String const& value) override;
  23. Optional<ViewBox> m_view_box;
  24. };
  25. }
  26. namespace Web::DOM {
  27. template<>
  28. inline bool Node::fast_is<SVG::SVGSVGElement>() const { return is_svg_svg_element(); }
  29. }