Closed Bug 1957501 Opened 10 months ago Closed 8 months ago

Prototype Step 3 of Grid Sizing Algorithm: Re-resolve column sizes using updated content contributions

Categories

(Core :: Layout: Grid, task)

task

Tracking

()

RESOLVED FIXED
141 Branch
Tracking Status
firefox141 --- fixed

People

(Reporter: TYLin, Assigned: TYLin)

References

Details

(Whiteboard: [grid-percentages:m1], [wptsync upstream])

Attachments

(3 files)

Step 3:

Then, if the min-content contribution of any grid item has changed based on the row sizes and alignment calculated in step 2, re-resolve the sizes of the grid columns with the new min-content and max-content contributions (once only).
To find the block-axis available space for any items whose inline-axis size contributions require it, use the grid row sizes calculated in the previous step. If the grid container’s block size is definite, also apply align-content to account for the effective row gap sizes.

https://drafts.csswg.org/css-grid-2/#algo-grid-sizing

Blocks: 1957502
Whiteboard: [grid-percentages:triage] → [grid-percentages:m1]
Assignee: nobody → aethanyc
Status: NEW → ASSIGNED
Summary: Prototype the step 3 of Grid Sizing Algorithm → Prototype Step 3 of Grid Sizing Algorithm: Re-resolve column sizes using updated content contributions
Depends on: 1968137

CalculateTrackSizesForAxis() is the top-level function that implements the
Grid Sizing Algorithm. This patch moves the call from
ComputeBSizeForResolvingRowSizes() into Reflow() to make it clearer that the
track sizing is initiated from there.

Previously, the first pass to resolve row sizes was guarded by a multi-pass pref
and conditioned on having an unconstrained block-size, while the second pass
always ran. This patch restructures the logic so that the first pass always
runs, and the second pass runs only when the conditions are met. This makes the
flow clearer and emphasizes that the second pass is the "extra" step introduced
by the new behavior.

This patch prepares for the next part, which will add an additional pass for
resolving the column sizes in the block guarded by the multi-pass pref.

This patch does not change behavior.

grid-item-inline-contribution-002.html fails to properly assert that grid
column sizes are re-resolved in Firefox. For example, using DevTools to inspect
the first column shows it is 10px, yet Firefox still passes the test without
fixing this bug.

grid-item-inline-contribution-004.html is adapted from
grid-item-inline-contribution-002.html It correctly tests the re-resolution of
the grid columns sizes by requiring the first column to be exactly 50px in order
to render a green rectangle.

Pushed by aethanyc@gmail.com: https://github.com/mozilla-firefox/firefox/commit/5097793fedb1 https://hg.mozilla.org/integration/autoland/rev/7da021992ad3 Part 1 - Move CalculateTrackSizesForAxis() from ComputeBSizeForResolvingRowSizes() to Reflow(). r=dholbert https://github.com/mozilla-firefox/firefox/commit/ae6c881c8c0d https://hg.mozilla.org/integration/autoland/rev/1345749b131c Part 2 - Re-resolve grid column sizes based on resolved row sizes. r=dholbert https://github.com/mozilla-firefox/firefox/commit/1846ad7a508b https://hg.mozilla.org/integration/autoland/rev/537ed21ed596 Part 3 - Add a WPT and update test expectation. r=dholbert
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/52888 for changes under testing/web-platform/tests
Whiteboard: [grid-percentages:m1] → [grid-percentages:m1], [wptsync upstream]
Status: ASSIGNED → RESOLVED
Closed: 8 months ago
Resolution: --- → FIXED
Target Milestone: --- → 141 Branch
Upstream PR merged by moz-wptsync-bot
QA Whiteboard: [qa-triage-done-c142/b141]
Duplicate of this bug: 1719273
Blocks: 1453571
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: