LibWeb: Stop zero-area children from causing scrollable overflow

This commit is contained in:
Psychpsyo 2024-11-23 12:41:29 +01:00 committed by Andreas Kling
commit 1d44df74f7
Notes: github-actions[bot] 2024-11-24 10:11:48 +00:00
37 changed files with 67 additions and 53 deletions

View file

@ -109,6 +109,10 @@ static CSSPixelRect measure_scrollable_overflow(Box const& box)
auto child_border_box = child.paintable_box()->absolute_border_box_rect();
// Border boxes with zero area do not affect the scrollable overflow area.
if (child_border_box.is_empty())
return TraversalDecision::Continue;
// NOTE: Here we check that the child is not wholly in the negative scrollable overflow region.
if (child_border_box.bottom() < 0 || child_border_box.right() < 0)
return TraversalDecision::Continue;