mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 01:35:08 +02: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
Notes:
github-actions[bot]
2024-12-10 13:55:36 +00:00
Author: https://github.com/gmta Commit: https://github.com/LadybirdBrowser/ladybird/commit/1c55153d433 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2844
@@ -288,11 +288,7 @@ bool is_element_editable(Web::DOM::Element const& element)
|
||||
bool is_element_mutable(Web::DOM::Element const& element)
|
||||
{
|
||||
// Denotes elements that are editing hosts or content editable.
|
||||
if (!is<HTML::HTMLElement>(element))
|
||||
return false;
|
||||
|
||||
auto const& html_element = static_cast<HTML::HTMLElement const&>(element);
|
||||
return html_element.is_editable();
|
||||
return element.is_editable_or_editing_host();
|
||||
}
|
||||
|
||||
// https://w3c.github.io/webdriver/#dfn-mutable-form-control-element
|
||||
|
||||
Reference in New Issue
Block a user