Text.cpp 799 B

12345678910111213141516171819202122232425262728293031323334
  1. /*
  2. * Copyright (c) 2018-2022, Andreas Kling <kling@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #include <LibWeb/DOM/Text.h>
  7. #include <LibWeb/HTML/HTMLInputElement.h>
  8. #include <LibWeb/HTML/Window.h>
  9. #include <LibWeb/Layout/TextNode.h>
  10. namespace Web::DOM {
  11. Text::Text(Document& document, const String& data)
  12. : CharacterData(document, NodeType::TEXT_NODE, data)
  13. {
  14. }
  15. Text::~Text()
  16. {
  17. }
  18. // https://dom.spec.whatwg.org/#dom-text-text
  19. NonnullRefPtr<Text> Text::create_with_global_object(Bindings::WindowObject& window, String const& data)
  20. {
  21. return make_ref_counted<Text>(window.impl().associated_document(), data);
  22. }
  23. void Text::set_owner_input_element(Badge<HTML::HTMLInputElement>, HTML::HTMLInputElement& input_element)
  24. {
  25. m_owner_input_element = input_element;
  26. }
  27. }