commit 43f1e817690f7e169d54a3df2854aa71171ec546 parent 37af7f38bfbb71198b7419f75e718ef9d802b527 Author: Ian Kilpatrick <ikilpatrick@chromium.org> Date: Sat, 22 Nov 2025 21:12:09 +0000 Bug 2001466 [wpt PR 56159] - [calc-size] Fix flex line-wrapping behaviour., a=testonly Automatic update from web-platform-tests [calc-size] Fix flex line-wrapping behaviour. Previously we'd use LayoutUnit::Max to force ComputeBlockSizeForFragment to resolve. This worked (ignoring some saturation issue), but was incorrect for calc-size(). Resolve ComputeBlockSizeForFragment with an indefinite intrinsic-size instead, then resolve the max block-size if needed. Change-Id: I48bb17d95cb9ffdd381f2563e800a4d9cf7dc046 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7173658 Commit-Queue: Ian Kilpatrick <ikilpatrick@chromium.org> Reviewed-by: David Grogan <dgrogan@chromium.org> Reviewed-by: David Baron <dbaron@chromium.org> Cr-Commit-Position: refs/heads/main@{#1548070} -- wpt-commits: 6c7eeb9c46b4b41248081b46bc3e8ced23e26d7e wpt-pr: 56159 Diffstat:
3 files changed, 30 insertions(+), 2 deletions(-)
diff --git a/testing/web-platform/tests/css/css-flexbox/flex-container-max-content-002.tentative.html b/testing/web-platform/tests/css/css-flexbox/flex-container-max-content-002.tentative.html @@ -151,7 +151,7 @@ <div data-expected-width="85" data-expected-height="35">X X</div> </div> <div class="flex min" style="flex-flow: column wrap" - data-expected-width="95" data-expected-height="80"> + data-expected-width="180" data-expected-height="45"> <div data-expected-width="85" data-expected-height="35">X X</div> <div data-expected-width="85" data-expected-height="35">X X</div> </div> diff --git a/testing/web-platform/tests/css/css-flexbox/flex-container-min-content-002.tentative.html b/testing/web-platform/tests/css/css-flexbox/flex-container-min-content-002.tentative.html @@ -151,7 +151,7 @@ <div data-expected-width="35" data-expected-height="60">X X</div> </div> <div class="flex min" style="flex-flow: column wrap" - data-expected-width="45" data-expected-height="130"> + data-expected-width="45" data-expected-height="70"> <div data-expected-width="35" data-expected-height="60">X X</div> <div data-expected-width="35" data-expected-height="60">X X</div> </div> diff --git a/testing/web-platform/tests/css/css-values/calc-size/calc-size-flex-008.html b/testing/web-platform/tests/css/css-values/calc-size/calc-size-flex-008.html @@ -0,0 +1,28 @@ +<!DOCTYPE html> +<link rel="help" href="https://drafts.csswg.org/css-values-5/#calc-size"> +<link rel="match" href="../../reference/ref-filled-green-100px-square.xht"> +<p>Test passes if there is a filled green square and <strong>no red</strong>. +<style> +#flex { + display: flex; + flex-direction: column; + flex-wrap: wrap; + + width: 100px; + height: calc-size(auto, min(size, 100px)); + background: red; +} + +#flex > div { + width: 100px; + height: 60px; + background: green; +} +</style> +<!-- There should only be one flex-line as at the time of determining the + available main-size it is indefinite, and calc-size() shouldn't resolve. + See: https://drafts.csswg.org/css-flexbox-1/#algo-available --> +<div id="flex"> + <div></div> + <div></div> +</div>