fune/testing/web-platform/tests/css/css-flexbox/min-size-auto-overflow-clip.html
Emilio Cobos Álvarez cad147e22f Bug 1894627 [wpt PR 46009] - Fix automatic min size handling of flex and grid items to match the spec., a=testonly
Automatic update from web-platform-tests
Fix automatic min size handling of flex and grid items to match the spec.

This is a prerequisite to fix issue 40877677 and related issues because
otherwise overflow: clip stops applying min-size: auto.

Both the grid and flex specs mention "scroll container" already, which
means that visible and clip should behave the same:

 * https://drafts.csswg.org/css-grid/#min-size-auto
 * https://drafts.csswg.org/css-flexbox/#min-size-auto

There's technically a difference between "is scroll container" (what the
spec says) and "overflow is not clip or visible", but the CSSWG already
resolved on just looking at the overflow value in:
https://github.com/w3c/csswg-drafts/issues/7714

Blink was doing the right thing for flex only on replaced elements for
some reason. For grid, most stuff works already due to it using
ComputedStyle::IsScrollContainer, but there was one case missing, which
I added a test for.

Bug: 40877677
Change-Id: I49f57b725ae7feb18250f1e40b3856ec2231bfb1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5505559
Reviewed-by: John Palmer <jopalmer@google.com>
Reviewed-by: John Palmer <jopalmer@chromium.org>
Reviewed-by: Morten Stenshorne <mstensho@chromium.org>
Auto-Submit: Emilio Cobos Álvarez <emilio@chromium.org>
Commit-Queue: Ian Kilpatrick <ikilpatrick@chromium.org>
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1295163}

--

wpt-commits: fc9991bceed83699c5839775d403ca8bcf7e94b7
wpt-pr: 46009
2024-05-06 07:43:02 +00:00

18 lines
568 B
HTML

<!doctype html>
<meta charset="utf-8">
<link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io">
<link rel="help" href="https://drafts.csswg.org/css-flexbox/#min-size-auto">
<link rel="match" href="min-size-auto-overflow-clip-ref.html">
<title>overflow: visible and clip behave the same for min-size purposes</title>
<style>
.flex {
display: flex;
width: 100px;
border: 1px solid;
}
</style>
<div class="flex">
<div style="overflow: clip">
<div style="background: green; width: 150px; height: 50px;"></div>
</div>
</div>