From c35c146cbd31cbba1259e04cf6b4578bad4855b5 Mon Sep 17 00:00:00 2001 From: David Shin Date: Wed, 13 Nov 2024 20:29:13 +0000 Subject: [PATCH] Bug 1768921 - Ensure that padding inflated bounds of in-flow children are included in the scrollable element's overflow area. r=dholbert This means that when users scroll to the inline-end of a scroller, they will see that the inline-end padding of that scroller is added in. This is achieved by unioning an additional rect into the scrollable element's overflow area (Which is an accumulation of the recursive overflow-area contributions from its subtree). This additional rect is calculated as follows: - In-flow children and float's margin boxes are unioned (including zero-size boxes) - The unioned rect is then inflated by the scrollable element's padding Note: The bounds of zero-area in-flow-child rects are included in this rect, in both block- and inline- directions. This is a change in behavior; Divs of huge inline size and zero block size used to not affect the scrollable overflow, where divs with huge block size and zero inline size did, as a side effect of now removed `nsBlockFrame::ConsiderBlockEndEdgeOfChildren`. Note on WPT change sizing-orthog-(vlr|vrl)-in-htb-(008|020)-ref.xht - the padding existed to force empty space below `p#sentence-after`. However, this only applies to previous Firefox. Any combination of browser + default font (+ its default size) causing a scroll would cause the test to fail as false positive (According to wpt.fyi, this is what happens with sizing-orthog-(vlr|vrl)-008.xht tests). This change brings Firefox's scroll behaviour inline with other browsers. Differential Revision: https://phabricator.services.mozilla.com/D151310 --- dom/html/test/test_bug375003-2.html | 28 +- layout/generic/ScrollContainerFrame.cpp | 21 -- layout/generic/crashtests/crashtests.list | 4 +- layout/generic/nsBlockFrame.cpp | 309 ++++++++++++------ layout/generic/nsBlockFrame.h | 14 +- layout/generic/nsLineBox.cpp | 35 +- layout/generic/nsLineBox.h | 16 + layout/reftests/bugs/458296-1c.html | 10 - layout/reftests/bugs/825999-ref.html | 14 +- layout/reftests/bugs/825999.html | 6 + layout/reftests/bugs/966992-1-ref.html | 16 +- layout/reftests/bugs/966992-1.html | 26 -- layout/reftests/bugs/reftest.list | 1 - .../scrollable-horizontal-margin-ref.html | 6 +- .../scrollable-horizontal-margin.html | 6 +- .../position-sticky/padding-3-ref.html | 2 +- layout/tables/crashtests/crashtests.list | 4 +- .../inline-block-replaced-width-008.xht.ini | 3 - .../inline-replaced-width-009.xht.ini | 3 - .../content-visibility-090.html.ini | 3 + .../margin-block-end-scroll-area-001.html.ini | 2 + ...gonal-flow-with-inline-end-margin.html.ini | 3 - .../overflow-clip-margin-002.html.ini | 2 +- .../overflow-clip-margin-005.html.ini | 2 +- .../overflow-clip-margin-007.html.ini | 3 - .../overflow-clip-margin-012.html.ini | 3 - .../css-overflow/overflow-padding.html.ini | 5 - .../scrollable-overflow-padding.html.ini | 118 ++++--- .../css/cssom-view/scrollWidthHeight.xht.ini | 6 - .../sizing-orthog-vlr-in-htb-008-ref.xht | 1 - .../sizing-orthog-vlr-in-htb-020-ref.xht | 1 - .../sizing-orthog-vrl-in-htb-008-ref.xht | 1 - .../sizing-orthog-vrl-in-htb-020-ref.xht | 1 - 33 files changed, 387 insertions(+), 288 deletions(-) delete mode 100644 layout/reftests/bugs/458296-1c.html delete mode 100644 testing/web-platform/meta/css/CSS2/normal-flow/inline-block-replaced-width-008.xht.ini delete mode 100644 testing/web-platform/meta/css/CSS2/normal-flow/inline-replaced-width-009.xht.ini create mode 100644 testing/web-platform/meta/css/css-contain/content-visibility/content-visibility-090.html.ini create mode 100644 testing/web-platform/meta/css/css-overflow/margin-block-end-scroll-area-001.html.ini delete mode 100644 testing/web-platform/meta/css/css-overflow/orthogonal-flow-with-inline-end-margin.html.ini delete mode 100644 testing/web-platform/meta/css/css-overflow/overflow-clip-margin-007.html.ini delete mode 100644 testing/web-platform/meta/css/css-overflow/overflow-clip-margin-012.html.ini delete mode 100644 testing/web-platform/meta/css/css-overflow/overflow-padding.html.ini delete mode 100644 testing/web-platform/meta/css/cssom-view/scrollWidthHeight.xht.ini diff --git a/dom/html/test/test_bug375003-2.html b/dom/html/test/test_bug375003-2.html index b8b985846ca5..037bb75174a3 100644 --- a/dom/html/test/test_bug375003-2.html +++ b/dom/html/test/test_bug375003-2.html @@ -18,7 +18,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=375003 body { color:black; background-color:white; font-size:12px; padding:10px; margin:0; } - + #div1,#abs1,#table1 { border: 20px solid lime; padding: 30px; @@ -47,28 +47,38 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=375003 -
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

-

diff --git a/layout/reftests/bugs/966992-1.html b/layout/reftests/bugs/966992-1.html index 2038c613ed58..44a84fa3afde 100644 --- a/layout/reftests/bugs/966992-1.html +++ b/layout/reftests/bugs/966992-1.html @@ -14,19 +14,6 @@ input { font-family: monospace; } -p { - position:absolute; - margin:0; - width:70%; - height: 1px; - background:magenta; -} -.rel p { width:200%; } -.block { - border:1px solid grey; height:50px; width:200px; padding:20px; - overflow:auto; overflow-clip-box:content-box; -} -.rel { position:relative; } .button { width:0px; padding:0 50px; overflow:hidden; } .pb { overflow-clip-box:padding-box; } .cb { overflow-clip-box:content-box; } @@ -34,19 +21,6 @@ p { -
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

-
- -
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
-
- -
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

-
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

- -
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

-
diff --git a/layout/reftests/bugs/reftest.list b/layout/reftests/bugs/reftest.list index b0b0c1179b90..e43e7eeebe12 100644 --- a/layout/reftests/bugs/reftest.list +++ b/layout/reftests/bugs/reftest.list @@ -1167,7 +1167,6 @@ fuzzy(0-10,0-8) == 456219-2.html 456219-2-ref.html == 457398-2.html 457398-2-ref.html == 458296-1a.html 458296-1-ref.html == 458296-1b.html 458296-1-ref.html -== 458296-1c.html 458296-1-ref.html == 458296-1d.html 458296-1-ref.html == 458487-1a.html 458487-1-ref.html == 458487-1b.html 458487-1-ref.html diff --git a/layout/reftests/margin-collapsing/scrollable-horizontal-margin-ref.html b/layout/reftests/margin-collapsing/scrollable-horizontal-margin-ref.html index 358c1f2bbc49..1ffd1f6f58b0 100644 --- a/layout/reftests/margin-collapsing/scrollable-horizontal-margin-ref.html +++ b/layout/reftests/margin-collapsing/scrollable-horizontal-margin-ref.html @@ -1,17 +1,17 @@ - Testcase for bug 724352 + Testcase for bug 1768921 diff --git a/layout/reftests/margin-collapsing/scrollable-horizontal-margin.html b/layout/reftests/margin-collapsing/scrollable-horizontal-margin.html index 5616b36fca54..9bd02800b002 100644 --- a/layout/reftests/margin-collapsing/scrollable-horizontal-margin.html +++ b/layout/reftests/margin-collapsing/scrollable-horizontal-margin.html @@ -1,13 +1,15 @@ - Testcase for bug 724352 + Testcase for bug 1768921 +