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:
Jelle Raaijmakers 2024-12-06 11:41:20 +01:00 committed by Jelle Raaijmakers
parent f88c13a58c
commit 1c55153d43
Notes: github-actions[bot] 2024-12-10 13:55:36 +00:00
22 changed files with 85 additions and 102 deletions

View file

@ -394,10 +394,7 @@ void HTMLTextAreaElement::create_shadow_tree_if_needed()
void HTMLTextAreaElement::handle_readonly_attribute(Optional<String> const& maybe_value)
{
// The readonly attribute is a boolean attribute that controls whether or not the user can edit the form control. When specified, the element is not mutable.
m_is_mutable = !maybe_value.has_value();
if (m_text_node)
m_text_node->set_always_editable(m_is_mutable);
set_is_mutable(!maybe_value.has_value());
}
// https://html.spec.whatwg.org/multipage/form-elements.html#dom-textarea-maxlength