ladybird/Libraries/LibHTML/DOM/Text.h
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

21 lines
533 B
C++

#pragma once
#include <AK/String.h>
#include <LibHTML/DOM/Node.h>
class Text final : public Node {
public:
explicit Text(Document&, const String&);
virtual ~Text() override;
const String& data() const { return m_data; }
virtual String tag_name() const override { return "#text"; }
virtual String text_content() const override { return m_data; }
private:
virtual RefPtr<LayoutNode> create_layout_node(const StyleResolver&, const StyleProperties* parent_properties) const override;
String m_data;
};