mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-03 23:25:20 +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:
committed by
Jelle Raaijmakers
parent
f88c13a58c
commit
1c55153d43
@@ -384,7 +384,7 @@ bool command_insert_paragraph_action(DOM::Document& document, String const&)
|
||||
// 2. If the active range's start node is neither editable nor an editing host, return true.
|
||||
auto& active_range = *selection.range();
|
||||
GC::Ptr<DOM::Node> node = active_range.start_container();
|
||||
if (!node->is_editable() && !is_editing_host(*node))
|
||||
if (!node->is_editable_or_editing_host())
|
||||
return true;
|
||||
|
||||
// 3. Let node and offset be the active range's start node and offset.
|
||||
|
||||
Reference in New Issue
Block a user