Closed Bug 2094432 Opened 17 days ago Closed 13 days ago

[wpt-sync] Sync PR 64931 - WebKit export of https://bugs.webkit.org/show_bug.cgi?id=328991

Categories

(Core :: Layout: Flexbox, task, P4)

task

Tracking

()

RESOLVED FIXED
163 Branch
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

WebKit export from bug: Flex item sized larger than its own (<!---->correctly-<!---->sized)<!----> content:<!----> `<!---->aspect-<!---->ratio`<!----> box with `<!---->width:<!---->auto`<!----> containing a `<!---->\<<!---->use><!---->`<!---->-<!---->referenced `<!---->\<<!---->svg><!---->`<!---->

<pre>
Flex item containing a percentage-sized <svg> in an aspect-ratio box is sized larger than its content

A box with aspect-ratio, a definite height and width: auto contributes
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
auto grid 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:

 &quot;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.&quot;

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-content and width: fit-content on 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>

Component: web-platform-tests → Layout: Flexbox
Product: Testing → Core

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

Status: NEW → RESOLVED
Closed: 13 days ago
Resolution: --- → FIXED
Target Milestone: --- → 163 Branch
You need to log in before you can comment on or make changes to this bug.