LibWeb: Ensure inert contenteditable elements are not editable

This commit is contained in:
Tim Ledbetter 2025-02-05 23:33:13 +00:00 committed by Sam Atkins
commit 8547c1a743
Notes: github-actions[bot] 2025-02-21 12:43:26 +00:00

View file

@ -1311,6 +1311,12 @@ bool Node::is_editable() const
if (!parent() || !parent()->is_editable_or_editing_host())
return false;
// https://html.spec.whatwg.org/multipage/interaction.html#inert-subtrees
// When a node is inert:
// - If it is editable, the node behaves as if it were non-editable.
if (is_inert())
return false;
// and either it is an HTML element,
if (is<HTML::HTMLElement>(this))
return true;