mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-04 18:23:39 +00:00
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.
21 lines
533 B
C++
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;
|
|
};
|