repeat(auto-fit/auto-fill) generates a single column on an absolutely positioned grid with max-width of 100%
Categories
(Core :: Layout: Grid, defect)
Tracking
()
People
(Reporter: profic, Assigned: TYLin)
References
Details
Attachments
(3 files, 1 obsolete file)
Steps to reproduce:
I used repeat(auto-fit, value-in-pixels) for grid-template-columns (via the grid shortcut) for an absolutely positioned grid with max-width of 100%
a sandbox: https://codepen.io/Ivan-U7n/pen/qBegEwr
Actual results:
only a single column was generated
Expected results:
grid should have as many columns of given size as max-width allows
Comment 1•9 months ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::Layout: Grid' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
Assignee | ||
Comment 2•9 months ago
|
||
Capture the testcase in the codepen in comment 0 as a standalone html file.
Assignee | ||
Updated•9 months ago
|
Assignee | ||
Comment 3•9 months ago
|
||
Add a reduced testcase to compare the behavior. Firefox and Chrome have the same behavior on Case 1 and Case 2.
Quote the spec https://drafts.csswg.org/css-grid-1/#auto-repeat
When auto-fill is given as the repetition number, if the grid container has a definite preferred size or maximum size in the relevant axis, then the number of repetitions is the largest possible positive integer that does not cause the grid to overflow the content box of its grid container taking gap into account;
auto-fit
behaves similarly. It looks like Firefox failed to consider definite maximum size when the grid container has absolute positioning.
Assignee | ||
Updated•9 months ago
|
Reporter | ||
Comment 4•9 months ago
|
||
(In reply to Ting-Yu Lin [:TYLin] (PST, UTC-8) from comment #3)
Add a reduced testcase to compare the behavior. Firefox and Chrome have the same behavior on Case 1 and Case 2.
I forgot to mention that both Blink and WebKit produce expected results
BTW, thanks for making the reduced testcase, I wanted to do it myself, but had no clue on what the relevant bits were
Assignee | ||
Comment 5•9 months ago
|
||
Updated•9 months ago
|
![]() |
||
Comment 7•9 months ago
|
||
bugherder |
Comment hidden (obsolete) |
Comment hidden (obsolete) |
Comment 11•8 months ago
|
||
Backer out from beta at the developer's request for causing regressions.
https://hg.mozilla.org/releases/mozilla-beta/rev/f46853c1956d6221e3b0bd4698bb90f3c2a2e272
Assignee | ||
Comment 12•8 months ago
|
||
Per dholbert's suggestion in bug 1936276 comment 10, I agree it is better to backout the patch to fix the regression. However, the patch cannot be backout cleanly on truck due to a conflict. I've prepared a patch in bug 1936276 to revert the patch. Once bug 1936276 landed, we should reopen this.
Comment 13•8 months ago
|
||
The patch landed in nightly and beta is affected.
:TYLin, is this bug important enough to require an uplift?
- If yes, please nominate the patch for beta approval. Also, don't forget to request an uplift for the patches in the regression caused by this fix.
- If no, please set
status-firefox134
towontfix
.
For more information, please visit BugBot documentation.
Assignee | ||
Comment 14•8 months ago
|
||
Bug 1936276 landed on nightly. Per comment 12, let's reopen this bug.
Updated•8 months ago
|
Comment 15•6 months ago
|
||
Comment 16•6 months ago
|
||
bugherder |
Updated•6 months ago
|
Updated•6 months ago
|
Comment 17•6 months ago
|
||
I can reproduce this issue in Release v135.0 and I confirm the fix in Beta v136.0b3 and Nightly v137.0a1 in Windows 10, MacOS 14 and Ubuntu 22 using all of the test cases attached. Test case 3 is properly showing columns instead of rows.
Description
•