ladybird/Userland/Libraries/LibWeb/DOM/Comment.cpp

25 lines
621 B
C++
Raw Normal View History

/*
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <LibWeb/DOM/Comment.h>
#include <LibWeb/HTML/Window.h>
#include <LibWeb/Layout/TextNode.h>
namespace Web::DOM {
2022-04-01 20:58:27 +03:00
Comment::Comment(Document& document, String const& data)
: CharacterData(document, NodeType::COMMENT_NODE, data)
{
}
// https://dom.spec.whatwg.org/#dom-comment-comment
JS::NonnullGCPtr<Comment> Comment::create_with_global_object(HTML::Window& window, String const& data)
{
return *window.heap().allocate<Comment>(window.realm(), window.associated_document(), data);
}
}