grid rows are squished in Firefox with version 143's multi-pass track sizing behavior (for grids with a specified 'max-height' and whose items have effective 'min-height:0')
Categories
(Core :: Layout: Grid, defect)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox-esr115 | --- | unaffected |
| firefox-esr140 | --- | unaffected |
| firefox143 | --- | wontfix |
| firefox144 | --- | fixed |
| firefox145 | --- | fixed |
People
(Reporter: dpellegrini, Assigned: TYLin)
References
(Regression)
Details
(Keywords: regression)
Attachments
(8 files)
|
117.92 KB,
image/png
|
Details | |
|
270.08 KB,
image/png
|
Details | |
|
8.69 KB,
text/html
|
Details | |
|
300.69 KB,
image/png
|
Details | |
|
342 bytes,
text/html
|
Details | |
|
306 bytes,
text/html
|
Details | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
phab-bot
:
approval-mozilla-beta+
|
Details | Review |
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:143.0) Gecko/20100101 Firefox/143.0
Steps to reproduce:
I have a div element that has these props in order to display a grid
overflowY: 'auto',
padding: '1.5rem',
scrollbarWidth: 'none',
display: 'grid',
gridTemplateColumns: '1fr',
gap: '20px 26px',
'@media screen and (min-width: 1150px)': {
gridTemplateColumns: 'repeat(2, minmax(0, 1fr))',
},
'@media screen and (min-width: 1480px)': {
gridTemplateColumns: 'repeat(3, minmax(0, 1fr))',
},
'@media screen and (min-width: 1830px)': {
gridTemplateColumns: 'repeat(4, minmax(0, 1fr))',
},
The grid was displayed well
Actual results:
From when I got the automatic update to ver 143.0.1
The grid does not display correctly anymore it is all shrinked
Expected results:
The grid displays correctly as it happens in other browsers, see the attached picture where I compare the results from chrome and firefox
Comment 1•3 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.
Comment 2•3 months ago
|
||
Please attach a complete testcase to the bug using the Attach New File button. Also if this worked in Firefox before you could get a regression range using https://mozilla.github.io/mozregression/
| Reporter | ||
Comment 3•3 months ago
|
||
| Reporter | ||
Comment 4•3 months ago
|
||
This is the simple grid example that shows the problems I mentioned earlier
| Reporter | ||
Updated•3 months ago
|
| Reporter | ||
Comment 5•3 months ago
|
||
With MozRegression I found that the issue started with the version built on July 30th, the day before it was working great, see the above image.
| Assignee | ||
Comment 6•3 months ago
|
||
In Firefox 143, we enabled the new multi-pass grid sizing track algorithm in bug 1957244. If I turn off layout.css.grid-multi-pass-track-sizing.enabled (setting it to false) in about:config, it appears that the simple testcase in comment 4 renders as expected.
A wordaround for this bug is to remove overflow: hidden; in .grid-item, as it can disable the automatic minimum height of the grid item https://drafts.csswg.org/css-grid-2/#min-size-auto
Comment 7•3 months ago
|
||
Set release status flags based on info from the regressing bug 1957244
Updated•3 months ago
|
| Reporter | ||
Comment 8•3 months ago
|
||
I have read the above suggestions, but the only thing that helped me was to go in the advanced settings of Firefox (through about:config) and change the layout.css.grid-multi-pass-track-sizing.enabled to false :(
Which I do not think is a best practice
Comment 9•3 months ago
|
||
Here's a more-reduced testcase (reduced from attachment 9514956 [details]).
I've simplified it a bit to have min-height:0 on the grid item (whereas the original testcase implicitly has min-height:0, from default min-height:auto behavior combined with overflow:hidden, on its grid items).
I think content is getting squished here because in one of the layout passes, we must be strictly applying the max-height as a constraint on the collective size of the grid rows, and we think they're squishable because their contents all have min-height:0. Apparently this doesn't happen in other browsers (though they match our behavior if I change the max-height to an explicit height).
Comment 10•3 months ago
|
||
Just for illustration / in case it's useful diagnostically... Here's a variant of the previous testcase, where I just swapped to use height instead of max-height to constrain the grid's height.
That change doesn't impact our rendering, but it makes Chrome go from not-squishing to squishing (i.e. they agree with us).
Updated•3 months ago
|
Updated•3 months ago
|
Updated•3 months ago
|
Comment 11•3 months ago
|
||
:TYLin is there any plans to work on this for 144? Marking as fix-optional for now.
| Assignee | ||
Comment 12•3 months ago
|
||
We still want to consider min-block-size. Otherwise the following tests will
fail.
- /css/css-grid/alignment/grid-gutters-016.html
- /css/css-grid/grid-definition/grid-auto-repeat-min-size-004.html
The WPTs in this patch are adapted from bug 1990170 comment 3 (testcase 2).
Updated•3 months ago
|
| Assignee | ||
Comment 13•3 months ago
|
||
:TYLin is there any plans to work on this for 144? Marking as fix-optional for now.
Yes, uploaded a patch to fix this.
Comment 14•3 months ago
|
||
Comment 15•3 months ago
|
||
| bugherder | ||
Comment 16•3 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.
- See https://wiki.mozilla.org/Release_Management/Requesting_an_Uplift for documentation on how to request an uplift.
- If no, please set
status-firefox144towontfix.
For more information, please visit BugBot documentation.
Comment 17•3 months ago
|
||
firefox-beta Uplift Approval Request
- User impact if declined: The grid rows may be collapsed if the grid container's max-block-size is small.
- Code covered by automated testing: yes
- Fix verified in Nightly: yes
- Needs manual QE test: no
- Steps to reproduce for manual QE testing:
- Risk associated with taking this patch: low
- Explanation of risk level: It is a one line change that affects only grid containers with no block-size and specified max-block-size.
- String changes made/needed: N/A
- Is Android affected?: yes
| Assignee | ||
Comment 18•3 months ago
|
||
We still want to consider min-block-size. Otherwise the following tests will
fail.
- /css/css-grid/alignment/grid-gutters-016.html
- /css/css-grid/grid-definition/grid-auto-repeat-min-size-004.html
The WPTs in this patch are adapted from bug 1990170 comment 3 (testcase 2).
Original Revision: https://phabricator.services.mozilla.com/D267003
| Assignee | ||
Updated•3 months ago
|
Updated•3 months ago
|
Updated•3 months ago
|
Comment 19•3 months ago
|
||
| uplift | ||
Description
•