Files
ladybird/Tests/LibWeb/Text/expected/hit_testing/content-editable-empty.txt
Timothy Flynn a112eb4881 LibWeb: Ensure empty contenteditable boxes contain the hit test position
There are actually a couple of bugs here:

1. As of commit ebda8fcf11, editing hosts
   are now excluded from Node::is_editable. Since this special hit test
   handling is specifically for contenteditable nodes, we would not
   enter this branch for these nodes.

2. We were not checking if the contenteditable node actually contained
   the hit testing position. So if a page had multiple empty editable
   nodes, we would just return whichever was hit test first.

These bugs were exposed by 7c9b3c08fa.
This commit resulted in the text cursor hit test node being set as the
document focus node. If we returned the wrong result, we would not set
the correct node.

This was seen on discord, where clicking the message box would result in
the search box being focused.
2026-02-21 01:02:06 +00:00

3 lines
32 B
Plaintext

<DIV id="div1">
<DIV id="div2">