ladybird/Libraries/LibHTML/DOM/Text.cpp
Andreas Kling f150134de9 LibHTML: Make Node::create_layout_node() virtual
Instead of branching on the Node type, let subclasses decide how their
layout nodes get constructed.

This will allow elements to create custom layout nodes if they want.
2019-10-05 23:29:01 +02:00

17 lines
348 B
C++

#include <LibHTML/DOM/Text.h>
#include <LibHTML/Layout/LayoutText.h>
Text::Text(Document& document, const String& data)
: Node(document, NodeType::TEXT_NODE)
, m_data(data)
{
}
Text::~Text()
{
}
RefPtr<LayoutNode> Text::create_layout_node(const StyleResolver&, const StyleProperties*) const
{
return adopt(*new LayoutText(*this));
}