SVGTextElement.cpp 742 B

123456789101112131415161718192021222324252627282930
  1. /*
  2. * Copyright (c) 2023, MacDue <macdue@dueutil.tech>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #include <LibWeb/Layout/SVGTextBox.h>
  7. #include <LibWeb/SVG/SVGTextElement.h>
  8. namespace Web::SVG {
  9. JS_DEFINE_ALLOCATOR(SVGTextElement);
  10. SVGTextElement::SVGTextElement(DOM::Document& document, DOM::QualifiedName qualified_name)
  11. : SVGTextPositioningElement(document, move(qualified_name))
  12. {
  13. }
  14. void SVGTextElement::initialize(JS::Realm& realm)
  15. {
  16. Base::initialize(realm);
  17. WEB_SET_PROTOTYPE_FOR_INTERFACE(SVGTextElement);
  18. }
  19. JS::GCPtr<Layout::Node> SVGTextElement::create_layout_node(NonnullRefPtr<CSS::StyleProperties> style)
  20. {
  21. return heap().allocate_without_realm<Layout::SVGTextBox>(document(), *this, move(style));
  22. }
  23. }