SVGTextElement.cpp 764 B

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