SVGForeignObjectElement.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. * Copyright (c) 2022, Andreas Kling <kling@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <LibWeb/SVG/SVGGraphicsElement.h>
  8. namespace Web::SVG {
  9. // https://svgwg.org/svg2-draft/embedded.html#InterfaceSVGForeignObjectElement
  10. class SVGForeignObjectElement final : public SVGGraphicsElement {
  11. WEB_PLATFORM_OBJECT(SVGForeignObjectElement, SVGGraphicsElement);
  12. JS_DECLARE_ALLOCATOR(SVGForeignObjectElement);
  13. public:
  14. virtual ~SVGForeignObjectElement() override;
  15. virtual JS::GCPtr<Layout::Node> create_layout_node(NonnullRefPtr<CSS::StyleProperties>) override;
  16. JS::NonnullGCPtr<SVG::SVGAnimatedLength> x();
  17. JS::NonnullGCPtr<SVG::SVGAnimatedLength> y();
  18. JS::NonnullGCPtr<SVG::SVGAnimatedLength> width();
  19. JS::NonnullGCPtr<SVG::SVGAnimatedLength> height();
  20. private:
  21. SVGForeignObjectElement(DOM::Document& document, DOM::QualifiedName qualified_name);
  22. virtual void initialize(JS::Realm&) override;
  23. virtual void visit_edges(Cell::Visitor&) override;
  24. virtual void apply_presentational_hints(CSS::StyleProperties&) const override;
  25. JS::GCPtr<SVG::SVGAnimatedLength> m_x;
  26. JS::GCPtr<SVG::SVGAnimatedLength> m_y;
  27. JS::GCPtr<SVG::SVGAnimatedLength> m_width;
  28. JS::GCPtr<SVG::SVGAnimatedLength> m_height;
  29. };
  30. }