LibWeb: Prevent hidden PaintableWithLines being hit tested

Now follows the same pattern as PaintableBox and StackingContext, where
it exits if hidden, then hit tests children, then hit tests itself if
it's `visible_for_hit_testing()`.
This commit is contained in:
zac 2025-09-08 22:10:51 +10:00 committed by Alexander Kalenik
parent 4e892b8b67
commit 5c14db868d
Notes: github-actions[bot] 2025-09-08 13:37:27 +00:00
3 changed files with 8 additions and 2 deletions

View file

@ -1266,6 +1266,9 @@ TraversalDecision PaintableWithLines::hit_test(CSSPixelPoint position, HitTestTy
if (clip_rect_for_hit_testing().has_value() && !clip_rect_for_hit_testing()->contains(position))
return TraversalDecision::Continue;
if (computed_values().visibility() != CSS::Visibility::Visible)
return TraversalDecision::Continue;
// TextCursor hit testing mode should be able to place cursor in contenteditable elements even if they are empty
if (m_fragments.is_empty()
&& !has_children()