Closed Bug 1526553 Opened 2 years ago Closed 2 years ago

[wpt-sync] Sync PR 15212 - [css-grid] Handle indefinite percentages in fit-content()

Categories

(Core :: CSS Parsing and Computation, enhancement, P4)

enhancement

Tracking

()

RESOLVED FIXED
mozilla67
Tracking Status
firefox67 --- fixed

People

(Reporter: mozilla.org, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 15212 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/15212
Details from upstream follow.

Oriol Brufau <obrufau@igalia.com> wrote:

[css-grid] Handle indefinite percentages in fit-content()

If the size of the grid container depends on the size of its tracks,
a percentage in fit-content() is indefinite. Without this patch, some
places treated this case as fit-content(0), which prevented the grid
container from growing enough to contain the max-content contribution
of its grid items.

This patch treats such fit-content() as minmax(auto, max-content),
but once the size of the grid container is known and it is laid out
"for real", then the percentage is definite and it's used.

The spec is not clear about what exactly should happen, but
minmax(auto, max-content) is consistent with percentage track sizes
and with the description of fit-content().

The change aligns Blink with Firefox and Edge.

Spec: https://drafts.csswg.org/css-grid/#track-sizes

BUG=927865

TEST=external/wpt/css/css-grid/layout-algorithm/grid-fit-content-percentage.html

Change-Id: If39c39a9a97a14f6cdee4545b560eb897053c342
Reviewed-on: https://chromium-review.googlesource.com/c/1450123
Reviewed-by: Javier Fernandez \<jfernandez@igalia.com>
Reviewed-by: Manuel Rego \<rego@igalia.com>
Commit-Queue: Oriol Brufau \<obrufau@igalia.com>
Cr-Commit-Position: refs/heads/master@{#628736}

Component: web-platform-tests → CSS Parsing and Computation
Product: Testing → Core
Ran 1 tests and 5 subtests
OK     : 1
PASS   : 5
Pushed by wptsync@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/94a568ed72d7
[wpt PR 15212] - [css-grid] Handle indefinite percentages in fit-content(), a=testonly
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla67
You need to log in before you can comment on or make changes to this bug.