Closed Bug 1581106 Opened 5 years ago Closed 5 years ago

[css-grid-2] 'repeat(auto-fill, <line-names>+)' isn't expanded correctly in a subgridded axis

Categories

(Core :: Layout: Grid, defect, P2)

defect

Tracking

()

RESOLVED FIXED
mozilla71
Tracking Status
firefox-esr60 --- unaffected
firefox-esr68 --- wontfix
firefox67 --- wontfix
firefox68 --- wontfix
firefox69 --- wontfix
firefox70 --- wontfix
firefox71 --- fixed

People

(Reporter: MatsPalmgren_bugz, Assigned: MatsPalmgren_bugz)

References

(Regression)

Details

(Keywords: regression, testcase)

Attachments

(4 files)

Attached file Testcase

https://drafts.csswg.org/css-grid-2/#subgrid-per-axis
"The auto-fill keyword is only valid once per <line-name-list>, and repeats enough times for the name list to match the subgrid’s specified grid span (falling back to 0 if the span is already fulfilled)."

In the testcase, the first 3 grids should look the same.
The last grid should NOT look like the first 3 (it's the fallback to zero case - i.e. the 'y' line does not exist so the item should be placed in the last column).

It appears StyleGridTemplateComponent::RepeatAutoIndex() only reports the auto-repeat associated with the TrackList, not the Subgrid. (In the old C++ representation of this style value, the repeat index/flag was shared IIRC since they are mutually exclusive.) Anyway, there's some confusion about this in the Grid layout code currently.

Fwiw, this was actually working mostly correct before bug 1519958.
(I think the line-name matching was slightly wrong though. Our matching logic is assuming a track-repeat which merges the line-names from the line before/after with the edge names inside the repeat(), which shouldn't happen for a line-name-list repeat.)

Keywords: regression
Regressed by: 1519958

Sorry for the delay here; I've been meaning to set aside some time to page the grid syntax & layout model back into my head so as to review this. Planning on getting through this tomorrow.

Attachment #9094803 - Attachment description: Bug 1581106 part 3 - [css-grid-2] Implement 'repeat(auto-fill, <line-names>+)' in subgridded axis. r=dholbert → Bug 1581106 part 3 - [css-grid-2] Implement 'repeat(auto-fill, <line-names>)' in subgridded axis. r=emilio
Pushed by mpalmgren@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/75d66006c4a1
part 1 - Remove unused aNumRepeatTracks param (idempotent change).  r=dholbert
https://hg.mozilla.org/integration/autoland/rev/9fd948f30837
part 2 - Simplify LineNameMap ctor by deducing track clamping bounds instead of passing them as params (idempotent change).  r=dholbert
https://hg.mozilla.org/integration/autoland/rev/91d2317a3e64
part 3 - [css-grid-2] Implement 'repeat(auto-fill, <line-names>)' in subgridded axis.  r=emilio
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/19404 for changes under testing/web-platform/tests
Upstream web-platform-tests status checks passed, PR will merge once commit reaches central.
Flags: in-testsuite+
Upstream PR merged by moz-wptsync-bot
Regressions: 1618351
Has Regression Range: --- → yes
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: