summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-02-10 18:23:02 +0100
committerAndreas Kling <kling@serenityos.org>2021-02-10 19:06:20 +0100
commit41ff7268db1d7821aaa194d0ba89a1b9fa493714 (patch)
tree2c6f27bb28abf0d40ad27908fa357a3e384bbcd1 /Userland/Libraries/LibWeb
parent2eddd74e85d5dbe748507e9dd739c6259ea44964 (diff)
downloadserenity-41ff7268db1d7821aaa194d0ba89a1b9fa493714.zip
LibWeb: Add a way to make a DOM::Text always editable
This will be useful for input element purposes.
Diffstat (limited to 'Userland/Libraries/LibWeb')
-rw-r--r--Userland/Libraries/LibWeb/DOM/Text.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/Userland/Libraries/LibWeb/DOM/Text.h b/Userland/Libraries/LibWeb/DOM/Text.h
index 0e6f4a2dbd..f10cfd2033 100644
--- a/Userland/Libraries/LibWeb/DOM/Text.h
+++ b/Userland/Libraries/LibWeb/DOM/Text.h
@@ -39,10 +39,16 @@ public:
explicit Text(Document&, const String&);
virtual ~Text() override;
+ // ^Node
virtual FlyString node_name() const override { return "#text"; }
+ virtual bool is_editable() const override { return m_always_editable || CharacterData::is_editable(); }
+
+ void set_always_editable(bool b) { m_always_editable = b; }
private:
virtual RefPtr<Layout::Node> create_layout_node() override;
+
+ bool m_always_editable { false };
};
}