mirror of
https://github.com/zebrajr/ladybird.git
synced 2025-12-06 00:19:53 +01: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
|
|
@ -1642,7 +1642,8 @@ bool is_extraneous_line_break(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.
|
||||
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
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user