grid items should resolve their content-based minimum size to 0, if they span a flexible track
Categories
(Core :: Layout: Grid, defect)
Tracking
()
Webcompat Priority | P2 |
People
(Reporter: denschub, Unassigned)
References
Details
Attachments
(1 file)
444 bytes,
text/html
|
Details |
See the attached testcase and compare the output in Firefox vs Chrome/Safari. In Firefox, the green element spans its full 2000px, while in Chrome, the outer overflow: hidden
container contrains the element.
I'm honestly not sure what's going on here and if this an issue in Gecko or Blink, but since Safari seems to agree, and since this broke an actual website, this may be our issue.
Comment 1•3 years ago
|
||
Regression window(with layout.css.grid.enabled = true):
https://hg.mozilla.org/integration/mozilla-inbound/pushloghtml?fromchange=bb03ea15520d120bb6bff4d1d7227c3744feec5f&tochange=282e4426f1e19175f6374be13fe9065da433ab44
Comment 3•3 years ago
|
||
Note that we match Chrome if you add min-width: 0
to the grid item here (the child of the grid).
So this is a difference between us vs. Chrome in the computation of the automatic minimum width for this grid item. They seem to be resolving it to 0, whereas we're resolving it to something large.
I think this boils down to this bit of spec text, about the conditions under which the automatic minimum width resolves to something nonzero:
...its automatic minimum size in a given axis is the content-based minimum size if all of the following are true:
[...]
if it spans more than one track in that axis, none of those tracks are flexibleOtherwise, the automatic minimum size is zero, as usual.
https://www.w3.org/TR/css-grid-2/#min-size-auto
In this case, one of the spanned tracks is flexible (1fr). So the automatic minimum size should resolve to 0. So I think Chrome is correct here.
Updated•3 years ago
|
Comment 4•3 years ago
|
||
It looks like this is kind of the same as bug 1530097 (at least, it's one of resolutions mentioned in bug 1530097 comment 4), and there's already WPT tests that cover this behavior per bug 1658676 comment 1.
mats, should we dupe this to bug 1530097?
Updated•3 years ago
|
Updated•3 years ago
|
Updated•2 years ago
|
Comment 5•2 years ago
|
||
(In reply to Daniel Holbert [:dholbert] from comment #4)
mats, should we dupe this to bug 1530097?
Mats is no longer active, so I'm going to go ahead and answer "yes" to comment 4, and I'll mark this as a dupe (and transfer over the see-also associations).
Comment 6•2 years ago
|
||
I transferred the see-also links to bug 1530097, so I'll drop them from here now.
Comment 7•1 year ago
|
||
This is now fixed in Nightly, almost certainly via bug 1799111, so let's dupe this over there instead.
Description
•