Closed Bug 1708884 Opened 3 years ago Closed 2 years ago

grid items should resolve their content-based minimum size to 0, if they span a flexible track

Categories

(Core :: Layout: Grid, defect)

defect

Tracking

()

VERIFIED DUPLICATE of bug 1799111
Webcompat Priority P2

People

(Reporter: denschub, Unassigned)

References

Details

Attachments

(1 file)

Attached file Simplified testcase

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.

Mats, do you know who's right?

Flags: needinfo?(mats)

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 flexible

Otherwise, 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.

Summary: `overflow: hidden` and `overflow: scroll` appear to be broken inside a multi-span grid element → grid items should resolve their content-based minimum size to 0, if they span a flexible track

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?

Severity: -- → S3
Webcompat Priority: P2 → ?
Webcompat Priority: ? → P2
See Also: → 1743614

(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).

Status: NEW → RESOLVED
Closed: 2 years ago
Flags: needinfo?(MatsPalmgren_bugz)
Resolution: --- → DUPLICATE

I transferred the see-also links to bug 1530097, so I'll drop them from here now.

This is now fixed in Nightly, almost certainly via bug 1799111, so let's dupe this over there instead.

Status: RESOLVED → VERIFIED
Duplicate of bug: 1799111
No longer duplicate of bug: 1530097
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: