SVGForeignObjectElement.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. public:
  13. virtual ~SVGForeignObjectElement() override;
  14. virtual JS::GCPtr<Layout::Node> create_layout_node(NonnullRefPtr<CSS::StyleProperties>) override;
  15. JS::NonnullGCPtr<SVG::SVGAnimatedLength> x();
  16. JS::NonnullGCPtr<SVG::SVGAnimatedLength> y();
  17. JS::NonnullGCPtr<SVG::SVGAnimatedLength> width();
  18. JS::NonnullGCPtr<SVG::SVGAnimatedLength> height();
  19. private:
  20. SVGForeignObjectElement(DOM::Document& document, DOM::QualifiedName qualified_name);
  21. virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
  22. virtual void visit_edges(Cell::Visitor&) override;
  23. virtual void apply_presentational_hints(CSS::StyleProperties&) const override;
  24. JS::GCPtr<SVG::SVGAnimatedLength> m_x;
  25. JS::GCPtr<SVG::SVGAnimatedLength> m_y;
  26. JS::GCPtr<SVG::SVGAnimatedLength> m_width;
  27. JS::GCPtr<SVG::SVGAnimatedLength> m_height;
  28. };
  29. }