tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit 63fc322b2400dcd3d95d3cd2e801a30984014856
parent 24eb3096279d4e49a0e97940b4145d48be6952fa
Author: Ting-Yu Lin <tlin@mozilla.com>
Date:   Wed,  1 Oct 2025 17:07:17 +0000

Bug 1990170 - Don't clamp max-block-size for bSizeForResolvingRowSizes when re-resolving row sizes. r=layout-reviewers,dholbert

We still want to consider min-block-size. Otherwise the following tests will
fail.

- /css/css-grid/alignment/grid-gutters-016.html
- /css/css-grid/grid-definition/grid-auto-repeat-min-size-004.html

The WPTs in this patch are adapted from bug 1990170 comment 3 (testcase 2).

Differential Revision: https://phabricator.services.mozilla.com/D267003

Diffstat:
Mlayout/generic/nsGridContainerFrame.cpp | 5+++--
Atesting/web-platform/tests/css/css-grid/layout-algorithm/grid-track-ignores-max-size-001.html | 29+++++++++++++++++++++++++++++
Atesting/web-platform/tests/css/css-grid/layout-algorithm/grid-track-ignores-max-size-002.html | 27+++++++++++++++++++++++++++
3 files changed, 59 insertions(+), 2 deletions(-)

diff --git a/layout/generic/nsGridContainerFrame.cpp b/layout/generic/nsGridContainerFrame.cpp @@ -9547,8 +9547,9 @@ void nsGridContainerFrame::Reflow(nsPresContext* aPresContext, // two-pass row sizes resolution." if (bSizeForResolvingRowSizes == NS_UNCONSTRAINEDSIZE && !IsMasonry(LogicalAxis::Block)) { - bSizeForResolvingRowSizes = gridRI.mReflowInput->ApplyMinMaxBSize( - gridRI.mRows.TotalTrackSizeWithoutAlignment(this)); + bSizeForResolvingRowSizes = + std::max(gridRI.mRows.TotalTrackSizeWithoutAlignment(this), + gridRI.mReflowInput->ComputedMinBSize()); NS_ASSERTION(bSizeForResolvingRowSizes != NS_UNCONSTRAINEDSIZE, "The block-size for re-resolving the row sizes should be " diff --git a/testing/web-platform/tests/css/css-grid/layout-algorithm/grid-track-ignores-max-size-001.html b/testing/web-platform/tests/css/css-grid/layout-algorithm/grid-track-ignores-max-size-001.html @@ -0,0 +1,29 @@ +<!DOCTYPE html> +<link rel="author" title="Ting-Yu Lin" href="mailto:tlin@mozilla.com"> +<link rel="author" title="Mozilla" href="https://www.mozilla.org/"> +<link rel="help" href="https://drafts.csswg.org/css-grid-2/#algo-grid-sizing"> +<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1990170"> +<link rel="stylesheet" type="text/css" href="/fonts/ahem.css"> +<link rel="match" href="../../reference/ref-filled-green-100px-square-only.html"> +<meta name="assert" content="This test verifies that when resolving the row sizes, grid container's max-block-size is ignored."> + +<style> +.grid { + display: grid; + inline-size: 100px; + block-size: auto; + max-block-size: 10px; +} + +.item { + background: green; + min-height: 0; + font: 100px/1 Ahem; + color: rgba(255, 255, 255, 0); +} +</style> + +<p>Test passes if there is a filled green square.</p> +<div class="grid"> + <div class="item">X</div> +</div> diff --git a/testing/web-platform/tests/css/css-grid/layout-algorithm/grid-track-ignores-max-size-002.html b/testing/web-platform/tests/css/css-grid/layout-algorithm/grid-track-ignores-max-size-002.html @@ -0,0 +1,27 @@ +<!DOCTYPE html> +<link rel="author" title="Ting-Yu Lin" href="mailto:tlin@mozilla.com"> +<link rel="author" title="Mozilla" href="https://www.mozilla.org/"> +<link rel="help" href="https://drafts.csswg.org/css-grid-2/#algo-grid-sizing"> +<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1990170"> +<link rel="match" href="../../reference/ref-filled-green-100px-square-only.html"> +<meta name="assert" content="This test verifies that when resolving the row sizes, grid container's max-block-size is ignored."> + +<style> +.grid { + display: grid; + inline-size: 100px; + block-size: auto; + max-block-size: 10px; +} + +.item { + background: green; + min-height: 0; + line-height: 0; +} +</style> + +<p>Test passes if there is a filled green square.</p> +<div class="grid"> + <div class="item"><canvas width="100" height="100"></canvas></div> +</div>