[wpt-sync] Sync PR 64931 - WebKit export of https://bugs.webkit.org/show_bug.cgi?id=328991
Categories
(Core :: Layout: Flexbox, task, P4)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox163 | --- | fixed |
People
(Reporter: wpt-sync, Unassigned)
References
()
Details
(Whiteboard: [wptsync downstream])
Sync web-platform-tests PR 64931 into mozilla-central (this bug is closed when the sync is complete).
PR: https://github.com/web-platform-tests/wpt/pull/64931
Details from upstream follow.
Ahmad Saleem <ahmad.saleem792+github@gmail.com> wrote:
WebKit export of https://bugs.webkit.org/show_bug.cgi?id=328991
<pre>
Flex item containing a percentage-sized <svg> in an aspect-ratio box is sized larger than its contentA box with
aspect-ratio, a definite height andwidth: autocontributes
its ratio-derived width to its parent's intrinsic sizes. However,
applyAutomaticContentBasedMinimumSize() raised both the min-content and the
max-content contributions to the content's own sizes. A percentage-sized
replaced child such as an <svg> without a viewBox has a zero min-content
contribution but a max-content contribution of its 300px default width, so the
box's max-content contribution became 300px even though the box itself laid
out at the correct size. A shrink-to-fit parent, such as a flex item or an
autogrid track, was then sized from that inflated value.CSS Box Sizing Level 4, section 4.3 "Automatic Content-based Minimum Sizes",
<a href="https://www.w3.org/TR/css-sizing-4/#aspect-ratio-minimum">https://www.w3.org/TR/css-sizing-4/#aspect-ratio-minimum</a>, says:"In order to avoid unintentional overflow, the automatic minimum size in the ratio-dependent axis of a box with a preferred aspect ratio that is neither a replaced element, nor a scroll container in that axis, is its min-content size capped by its maximum size."The automatic minimum is the min-content size, so it only raises the minimum
size; the max-content size is not involved. Floor the max-content contribution
by the raised minimum instead of by the content's max-content size.The same helper is reached through computeIntrinsicKeywordLogicalWidths(), so
width: max-contentandwidth: fit-contenton the aspect-ratio box itself
are fixed as well. The now-unused max-content value is no longer computed.
The test also covers a min-content wider than the ratio width, where the floor
must still raise the contribution.WebKit-Bug: <a href="https://bugs.webkit.org/show_bug.cgi?id=328991">https://bugs.webkit.org/show_bug.cgi?id=328991</a>
WebKit-Canonical-Link: <a href="https://commits.webkit.org/326112@main">https://commits.webkit.org/326112@main</a>
</pre>
| Assignee | ||
Updated•17 days ago
|
| Assignee | ||
Comment 1•17 days ago
|
||
Pushed to try (stability) https://treeherder.mozilla.org/jobs?repo=try&landoInstance=lando-prod-2025&landoCommitID=121671
| Assignee | ||
Comment 2•16 days ago
|
||
CI Results
Ran 0 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI
Total 4 tests
Status Summary
Firefox
PASS: 3
FAIL: 1
Chrome
PASS: 4
Safari
FAIL: 4
Links
Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base
Details
New Tests That Don't Pass
- /css/css-flexbox/aspect-ratio-nonreplaced-max-content-contribution-001.html [wpt.fyi]:
FAIL(Chrome:PASS, Safari:FAIL)
Comment 4•13 days ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/bc9b923903cf
https://hg.mozilla.org/mozilla-central/rev/b06b6dabcc08
Description
•