mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-21 09:49:21 +00:00
LibWeb: Check for editability and visibility of "formattable nodes"
The associated spec was only partially implemented.
This commit is contained in:
parent
85abad30b0
commit
67800091c5
Notes:
github-actions[bot]
2025-01-10 22:38:39 +00:00
Author: https://github.com/gmta
Commit: 67800091c5
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3216
1 changed files with 2 additions and 1 deletions
|
@ -1642,7 +1642,8 @@ bool is_extraneous_line_break(GC::Ref<DOM::Node> node)
|
||||||
bool is_formattable_node(GC::Ref<DOM::Node> node)
|
bool is_formattable_node(GC::Ref<DOM::Node> node)
|
||||||
{
|
{
|
||||||
// A formattable node is an editable visible node that is either a Text node, an img, or a br.
|
// A formattable node is an editable visible node that is either a Text node, an img, or a br.
|
||||||
return is<DOM::Text>(*node) || is<HTML::HTMLImageElement>(*node) || is<HTML::HTMLBRElement>(*node);
|
return node->is_editable() && is_visible_node(node)
|
||||||
|
&& (is<DOM::Text>(*node) || is<HTML::HTMLImageElement>(*node) || is<HTML::HTMLBRElement>(*node));
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://w3c.github.io/editing/docs/execCommand/#in-the-same-editing-host
|
// https://w3c.github.io/editing/docs/execCommand/#in-the-same-editing-host
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue