diff --git a/Libraries/LibWeb/Layout/LayoutState.cpp b/Libraries/LibWeb/Layout/LayoutState.cpp index 3b28755d91d..bc5cc21e530 100644 --- a/Libraries/LibWeb/Layout/LayoutState.cpp +++ b/Libraries/LibWeb/Layout/LayoutState.cpp @@ -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; diff --git a/Tests/LibWeb/Layout/expected/block-and-inline/bfc-float-left-break-vertically-2.txt b/Tests/LibWeb/Layout/expected/block-and-inline/bfc-float-left-break-vertically-2.txt index 43b2f8d7243..6d8570c29af 100644 --- a/Tests/LibWeb/Layout/expected/block-and-inline/bfc-float-left-break-vertically-2.txt +++ b/Tests/LibWeb/Layout/expected/block-and-inline/bfc-float-left-break-vertically-2.txt @@ -11,7 +11,7 @@ Viewport <#document> at (0,0) content-size 800x600 children: not-inline ViewportPaintable (Viewport<#document>) [0,0 800x600] PaintableWithLines (BlockContainer) [0,0 800x150] - PaintableWithLines (BlockContainer
) [0,0 200x0] overflow: [0,0 200x150] + PaintableWithLines (BlockContainer) [0,0 200x0] overflow: [0,100 150x50] PaintableWithLines (BlockContainer) [8,16 784x17] PaintableWithLines (InlineNode(anonymous)) diff --git a/Tests/LibWeb/Layout/expected/css-namespace-rule-matches.txt b/Tests/LibWeb/Layout/expected/css-namespace-rule-matches.txt index 514ae94a596..b15f5d71b4e 100644 --- a/Tests/LibWeb/Layout/expected/css-namespace-rule-matches.txt +++ b/Tests/LibWeb/Layout/expected/css-namespace-rule-matches.txt @@ -13,7 +13,7 @@ Viewport <#document> at (0,0) content-size 800x600 children: not-inline ViewportPaintable (Viewport<#document>) [0,0 800x600] PaintableWithLines (BlockContainer) [0,0 800x600] - PaintableWithLines (BlockContainer
) [8,20 784x22] overflow: [8,20 784x42] + PaintableWithLines (BlockContainer) [8,20 784x22] PaintableWithLines (BlockContainer