
This makes it more symmetrical with adopt_own() (which is used to create a NonnullOwnPtr from the result of a naked new.)
26 lines
456 B
C++
26 lines
456 B
C++
/*
|
|
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#include <LibWeb/DOM/Text.h>
|
|
#include <LibWeb/Layout/TextNode.h>
|
|
|
|
namespace Web::DOM {
|
|
|
|
Text::Text(Document& document, const String& data)
|
|
: CharacterData(document, NodeType::TEXT_NODE, data)
|
|
{
|
|
}
|
|
|
|
Text::~Text()
|
|
{
|
|
}
|
|
|
|
RefPtr<Layout::Node> Text::create_layout_node()
|
|
{
|
|
return adopt_ref(*new Layout::TextNode(document(), *this));
|
|
}
|
|
|
|
}
|