mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 12:19:54 +00:00
LibWeb: Ensure inert contenteditable elements are not editable
This commit is contained in:
parent
1e691bd26d
commit
8547c1a743
Notes:
github-actions[bot]
2025-02-21 12:43:26 +00:00
Author: https://github.com/tcl3
Commit: 8547c1a743
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3475
Reviewed-by: https://github.com/AtkinsSJ ✅
1 changed files with 6 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue