mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 11:49:44 +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
|
@ -588,7 +588,7 @@ void FormAssociatedTextControlElement::set_the_selection_range(Optional<WebIDL::
|
|||
void FormAssociatedTextControlElement::handle_insert(String const& data)
|
||||
{
|
||||
auto text_node = form_associated_element_to_text_node();
|
||||
if (!text_node || !text_node->is_editable())
|
||||
if (!text_node || !is_mutable())
|
||||
return;
|
||||
|
||||
String data_for_insertion = data;
|
||||
|
@ -613,7 +613,7 @@ void FormAssociatedTextControlElement::handle_insert(String const& data)
|
|||
void FormAssociatedTextControlElement::handle_delete(DeleteDirection direction)
|
||||
{
|
||||
auto text_node = form_associated_element_to_text_node();
|
||||
if (!text_node || !text_node->is_editable())
|
||||
if (!text_node || !is_mutable())
|
||||
return;
|
||||
auto selection_start = this->selection_start();
|
||||
auto selection_end = this->selection_end();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue