SVGTextElement.cpp 763 B

12345678910111213141516171819202122232425262728
  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. SVGTextElement::SVGTextElement(DOM::Document& document, DOM::QualifiedName qualified_name)
  10. : SVGTextPositioningElement(document, move(qualified_name))
  11. {
  12. }
  13. void SVGTextElement::initialize(JS::Realm& realm)
  14. {
  15. Base::initialize(realm);
  16. set_prototype(&Bindings::ensure_web_prototype<Bindings::SVGTextElementPrototype>(realm, "SVGTextElement"));
  17. }
  18. JS::GCPtr<Layout::Node> SVGTextElement::create_layout_node(NonnullRefPtr<CSS::StyleProperties> style)
  19. {
  20. return heap().allocate_without_realm<Layout::SVGTextBox>(document(), *this, move(style));
  21. }
  22. }