From 912511a1527d052f1c90af8a7c2be113a20e80c0 Mon Sep 17 00:00:00 2001 From: Edward Banner Date: Tue, 15 Oct 2024 10:35:11 -0400 Subject: [PATCH] LibWeb: Use containing block to compute scrollable overflow Instead of using child boxes to compute scrollable overflow for the box, we use descendants which have the box as their containing block. --- .../abspos-box-with-block-level-sibling.txt | 4 ++-- .../abspos-box-with-replaced-element.txt | 2 +- .../abspos-flex-container-with-auto-height.txt | 2 +- .../abspos-flexbox-with-auto-height.txt | 4 ++-- .../abspos-flexbox-with-auto-width.txt | 2 +- ...abspos-image-with-min-height-constraint.txt | 4 ++-- .../expected/abspos-with-percentage-insets.txt | 2 +- ...abspos-with-static-position-in-one-axis.txt | 4 ++-- ...ced-abspos-element-must-not-be-negative.txt | 2 +- ...ced-abspos-element-must-not-be-negative.txt | 2 +- .../abspos-grid-with-definite-width.txt | 4 ++-- ...abspos-with-auto-margins-in-inline-axis.txt | 4 ++-- ...ne-children-and-nonempty-floating-child.txt | 2 +- .../max-width-must-not-expand-element.txt | 2 +- .../max-width-percentage-100-border-box.txt | 2 +- .../max-width-percentage-100.txt | 2 +- ...ins-set-zero-if-containing-size-smaller.txt | 2 +- ...fy-layout-internal-box-without-crashing.txt | 6 +++--- .../expected/css-logical-inset-properties.txt | 2 +- ...x-abspos-item-with-preceding-whitespace.txt | 6 +++--- ...-child-static-position-with-align-items.txt | 18 +++++++++--------- ...position-with-padding-on-flex-container.txt | 6 +++--- ...bspos-flex-child-with-percentage-height.txt | 2 +- ...-contribution-with-main-size-constraint.txt | 2 +- .../abspos-with-grid-container-as-parent.txt | 2 +- Tests/LibWeb/Layout/expected/input-image.txt | 6 +++--- Tests/LibWeb/Layout/expected/link-sheet.txt | 4 ++-- .../misc/create-iframes-using-innerhtml.txt | 6 +++--- .../pseudo-element-with-custom-properties.txt | 6 +++--- .../expected/table-fixup-with-rowspan.txt | 2 +- .../abspos-pseudo-element-inside-table.txt | 12 ++++++------ .../expected/table/align-top-and-bottom.txt | 2 +- .../avoid-div-by-zero-in-table-measures.txt | 6 +++--- Tests/LibWeb/Layout/expected/table/basic.txt | 2 +- .../table/border-collapse-is-inherited.txt | 2 +- .../expected/table/border-spacing-rowspan.txt | 2 +- .../Layout/expected/table/bottom-caption.txt | 2 +- .../expected/table/clip-spans-to-table-end.txt | 2 +- .../table/long-caption-increases-width.txt | 2 +- .../expected/table/nested-table-box-width.txt | 2 +- .../propagate-style-update-to-wrapper.txt | 2 +- .../row-outer-size-with-computed-size.txt | 2 +- .../table/row-span-and-nested-tables.txt | 2 +- .../table/rowspan-with-trailing-characters.txt | 4 ++-- Tests/LibWeb/Layout/expected/table/rowspan.txt | 2 +- Tests/LibWeb/Layout/expected/table/size.txt | 4 ++-- ...le-formation-with-rowspan-in-the-middle.txt | 4 ++-- .../table/top-caption-with-padding.txt | 2 +- .../Libraries/LibWeb/Layout/LayoutState.cpp | 11 +++++++---- 49 files changed, 92 insertions(+), 89 deletions(-) diff --git a/Tests/LibWeb/Layout/expected/abspos-box-with-block-level-sibling.txt b/Tests/LibWeb/Layout/expected/abspos-box-with-block-level-sibling.txt index d83cca97b5e..1a9fcb8afc2 100644 --- a/Tests/LibWeb/Layout/expected/abspos-box-with-block-level-sibling.txt +++ b/Tests/LibWeb/Layout/expected/abspos-box-with-block-level-sibling.txt @@ -7,8 +7,8 @@ Viewport <#document> at (0,0) content-size 800x600 children: not-inline TextNode <#text> ViewportPaintable (Viewport<#document>) [0,0 800x600] - PaintableWithLines (BlockContainer) [0,0 800x246] overflow: [5,5 790x433] - PaintableWithLines (BlockContainer) [13,13 774x220] overflow: [18,18 764x420] + PaintableWithLines (BlockContainer) [0,0 800x246] + PaintableWithLines (BlockContainer) [13,13 774x220] PaintableWithLines (BlockContainer
.static) [18,18 210x210] PaintableWithLines (BlockContainer
.absolute) [18,228 110x210] PaintableWithLines (BlockContainer(anonymous)) [18,228 764x0] diff --git a/Tests/LibWeb/Layout/expected/abspos-box-with-replaced-element.txt b/Tests/LibWeb/Layout/expected/abspos-box-with-replaced-element.txt index 76806becf02..8c1bf64305e 100644 --- a/Tests/LibWeb/Layout/expected/abspos-box-with-replaced-element.txt +++ b/Tests/LibWeb/Layout/expected/abspos-box-with-replaced-element.txt @@ -6,7 +6,7 @@ Viewport <#document> at (0,0) content-size 800x600 children: not-inline ImageBox at (262,12) content-size 248x26.46875 children: not-inline ViewportPaintable (Viewport<#document>) [0,0 800x600] - PaintableWithLines (BlockContainer) [0,0 800x2] overflow: [9,9 502x102] + PaintableWithLines (BlockContainer) [0,0 800x2] PaintableWithLines (BlockContainer) [9,9 502x102] PaintableWithLines (BlockContainer
.image-container) [260,10 250x30.46875] overflow: [261,11 249x28.46875] ImagePaintable (ImageBox) [261,11 250x28.46875] diff --git a/Tests/LibWeb/Layout/expected/abspos-flex-container-with-auto-height.txt b/Tests/LibWeb/Layout/expected/abspos-flex-container-with-auto-height.txt index 8751debfe60..ef556995209 100644 --- a/Tests/LibWeb/Layout/expected/abspos-flex-container-with-auto-height.txt +++ b/Tests/LibWeb/Layout/expected/abspos-flex-container-with-auto-height.txt @@ -7,7 +7,7 @@ Viewport <#document> at (0,0) content-size 800x600 children: not-inline TextNode <#text> ViewportPaintable (Viewport<#document>) [0,0 800x600] - PaintableWithLines (BlockContainer) [0,0 800x2] overflow: [8,8 514.859375x21] + PaintableWithLines (BlockContainer) [0,0 800x2] PaintableBox (Box) [8,8 514.859375x21] PaintableWithLines (BlockContainer
) [9,9 512.859375x19] TextPaintable (TextNode<#text>) diff --git a/Tests/LibWeb/Layout/expected/abspos-flexbox-with-auto-height.txt b/Tests/LibWeb/Layout/expected/abspos-flexbox-with-auto-height.txt index ae65a680f07..29e4726d300 100644 --- a/Tests/LibWeb/Layout/expected/abspos-flexbox-with-auto-height.txt +++ b/Tests/LibWeb/Layout/expected/abspos-flexbox-with-auto-height.txt @@ -8,8 +8,8 @@ Viewport <#document> at (0,0) content-size 800x600 children: not-inline TextNode <#text> ViewportPaintable (Viewport<#document>) [0,0 800x600] - PaintableWithLines (BlockContainer) [0,0 800x20] overflow: [1,1 798x30] - PaintableWithLines (BlockContainer) [9,9 782x2] overflow: [10,10 312.453125x21] + PaintableWithLines (BlockContainer) [0,0 800x20] + PaintableWithLines (BlockContainer) [9,9 782x2] PaintableBox (Box