Comment.cpp 625 B

12345678910111213141516171819202122232425262728
  1. /*
  2. * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #include <LibWeb/DOM/Comment.h>
  7. #include <LibWeb/DOM/Window.h>
  8. #include <LibWeb/Layout/TextNode.h>
  9. namespace Web::DOM {
  10. Comment::Comment(Document& document, const String& data)
  11. : CharacterData(document, NodeType::COMMENT_NODE, data)
  12. {
  13. }
  14. Comment::~Comment()
  15. {
  16. }
  17. // https://dom.spec.whatwg.org/#dom-comment-comment
  18. NonnullRefPtr<Comment> Comment::create_with_global_object(Bindings::WindowObject& window, String const& data)
  19. {
  20. return make_ref_counted<Comment>(window.impl().document(), data);
  21. }
  22. }