mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 20:59:16 +00:00
LibWeb: Refactor "editable" and "editing host" concepts
The DOM spec defines what it means for an element to be an "editing host", and the Editing spec does the same for the "editable" concept. Replace our `Node::is_editable()` implementation with these spec-compliant algorithms. An editing host is an element that has the properties to make its contents effectively editable. Editable elements are descendants of an editing host. Concepts like the inheritable contenteditable attribute are propagated through the editable algorithm.
This commit is contained in:
parent
f88c13a58c
commit
1c55153d43
Notes:
github-actions[bot]
2024-12-10 13:55:36 +00:00
Author: https://github.com/gmta
Commit: 1c55153d43
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2844
22 changed files with 85 additions and 102 deletions
|
@ -26,9 +26,6 @@ public:
|
|||
|
||||
// ^Node
|
||||
virtual FlyString node_name() const override { return "#text"_fly_string; }
|
||||
virtual bool is_editable() const override { return m_always_editable || CharacterData::is_editable(); }
|
||||
|
||||
void set_always_editable(bool b) { m_always_editable = b; }
|
||||
|
||||
Optional<size_t> max_length() const { return m_max_length; }
|
||||
void set_max_length(Optional<size_t> max_length) { m_max_length = move(max_length); }
|
||||
|
@ -51,7 +48,6 @@ protected:
|
|||
private:
|
||||
GC::Ptr<Element> m_owner;
|
||||
|
||||
bool m_always_editable { false };
|
||||
Optional<size_t> m_max_length {};
|
||||
bool m_is_password_input { false };
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue