summaryrefslogtreecommitdiff
path: root/Libraries/LibHTML/DOM/Text.h
blob: c507dbb3ba6d046f56ba82a9bf9b0152dd18b8d0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#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_style) const override;

    String m_data;
};

template<>
inline bool is<Text>(const Node& node)
{
    return node.is_text();
}