SVGGElement.cpp 868 B

12345678910111213141516171819202122232425262728293031323334
  1. /*
  2. * Copyright (c) 2021, Andreas Kling <andreas@ladybird.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #include <AK/StringBuilder.h>
  7. #include <LibWeb/Bindings/Intrinsics.h>
  8. #include <LibWeb/Bindings/SVGGElementPrototype.h>
  9. #include <LibWeb/DOM/Document.h>
  10. #include <LibWeb/Layout/SVGGraphicsBox.h>
  11. #include <LibWeb/SVG/SVGGElement.h>
  12. namespace Web::SVG {
  13. JS_DEFINE_ALLOCATOR(SVGGElement);
  14. SVGGElement::SVGGElement(DOM::Document& document, DOM::QualifiedName qualified_name)
  15. : SVGGraphicsElement(document, move(qualified_name))
  16. {
  17. }
  18. void SVGGElement::initialize(JS::Realm& realm)
  19. {
  20. Base::initialize(realm);
  21. WEB_SET_PROTOTYPE_FOR_INTERFACE(SVGGElement);
  22. }
  23. JS::GCPtr<Layout::Node> SVGGElement::create_layout_node(CSS::StyleProperties style)
  24. {
  25. return heap().allocate_without_realm<Layout::SVGGraphicsBox>(document(), *this, move(style));
  26. }
  27. }