ladybird/Tests/LibWeb/Text/input/hit_testing
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
..
basic.html Meta: Add DOCTYPEs to most text tests 2025-03-20 11:50:49 +01:00
block-element-inside-inline-element.html Meta: Add DOCTYPEs to most text tests 2025-03-20 11:50:49 +01:00
box-outside-of-abspos-containing-block-border-rect.html LibWeb: Always check paintable boxes children during hit-testing 2024-03-05 15:43:17 +01:00
button.html LibWeb: Fix hit-testing for button element 2024-02-13 14:22:14 +01:00
click-outside-of-box-with-hidden-overflow.html Meta: Add DOCTYPEs to text tests that need rebaselining after 2025-03-20 11:50:49 +01:00
click-outside-of-box-with-lines-and-hidden-overflow.html Meta: Add DOCTYPEs to text tests that need rebaselining after 2025-03-20 11:50:49 +01:00
content-editable-empty.html LibWeb: Ensure empty contenteditable boxes contain the hit test position 2026-02-21 01:02:06 +00:00
css-transforms.html LibWeb: Transform PaintableBox::hit_test positions 2024-11-23 22:06:32 +01:00
empty-anonymous-container-overlapping.html LibWeb: Don't hit test anonymous containers if there are no fragments 2025-07-05 23:56:42 +01:00
float-with-inline-sibling-after.html LibWeb: Skip out-of-flow boxes when wrapping inlines in anonymous block 2023-12-11 13:19:12 +01:00
grapheme.html LibWeb: Ensure hit testing is grapheme aware 2025-08-22 14:06:46 +02:00
grid.html LibWeb: Treat grid item as it creates stacking context during painting 2023-08-22 11:33:24 +02:00
hit-testing-an-xml-svg-should-not-crash.svg LibWeb: Rename internals.signalTextTestIsDone() to signalTestIsDone() 2025-03-18 20:09:46 +01:00
inline-content-inside-anonymous-container.html LibWeb: Do not hit test anonymous containers' box for inline content 2025-07-05 23:56:42 +01:00
inline-stacking-context.html Meta: Add DOCTYPEs to most text tests 2025-03-20 11:50:49 +01:00
nested-inline-paintables.html Meta: Add DOCTYPEs to most text tests 2025-03-20 11:50:49 +01:00
open-details-by-clicking-on-triangle.html Meta: Add DOCTYPEs to most text tests 2025-03-20 11:50:49 +01:00
overflow-hidden-with-positioned-child-after-scroll.html Tests: Add hit-testing test for overflow:hidden with viewport scroll 2026-01-15 19:50:53 +01:00
overflow-hidden-wrapped-into-css-translate.html LibWeb: Use local coordinates for overflow clip hit testing 2026-01-21 12:57:22 +01:00
overflow-scroll.html LibWeb: Scale font size by 1.15 for line-height: normal 2025-05-05 13:15:56 +02:00
pointer-events-no-parent-extension.html Meta: Add DOCTYPEs to text tests that need rebaselining after 2025-03-20 11:50:49 +01:00
pointer-events.html LibWeb: Hit test StackingContext's children before testing visibility 2025-08-29 01:25:01 +02:00
positioned-z-index-0-and-floats.html Meta: Add DOCTYPEs to most text tests 2025-03-20 11:50:49 +01:00
stacking-context-inside-scrollable-box.html LibWeb: Adjust stacking context position by scroll offset in hit-testing 2024-08-07 18:14:41 +02:00
stacking-context-with-inline-content.html LibWeb: Fix hit testing for text inside stacking context roots 2026-01-25 10:55:30 +01:00
svg-path.html LibWeb: Add hit-testing test for SVG path 2024-02-14 06:56:22 +01:00
text.html Meta: Add DOCTYPEs to most text tests 2025-03-20 11:50:49 +01:00
visibility-visible-inside-hidden-stacking-context.html LibWeb: Allow hit testing visible children of hidden stacking contexts 2026-01-25 10:55:30 +01:00
visibility-visible-inside-hidden.html LibWeb: Allow hit testing visible children of hidden elements 2026-01-25 10:55:30 +01:00
visibility.html LibWeb: Prevent hidden PaintableWithLines being hit tested 2025-09-08 15:36:27 +02:00