Re: [csswg-drafts] [css-grid][css-contain] Clarify that `contain:size` affects track sizing (#4931)

Chromium and Firefox are not interoperable in these cases:

```html
<div style="display: inline-grid; grid-auto-columns: 50px; height: 50px; contain: size; border: 5px solid">
  <div style="background: yellow"></div>
</div>
```

```html
<div style="display: inline-grid; grid-template-columns: 50px; height: 50px; contain: size; border: 5px solid"></div>
```

In Chromium, the content area of the grid container is 50px wide, in Firefox it's 0px.

@MatsPalmgren, in https://bugzilla.mozilla.org/show_bug.cgi?id=1488878#c1 you say that what you want to implement is

1. place items into the grid as usual
2. run Track Sizing algo but pretend we have no items
3. calculate the container's size from the track sizes as usual

This seems what Chromium is doing, i.e. step 1 can create implicit tracks, tracks may end up being bigger than 0px in step 2, and this affects the size of the grid container in step 3.

However, according to the CSS Grid spec, once we know the size of the grid container, it's laid out again "for real". So there are more steps:

4. place items into the grid as usual
5. run Track Sizing algo, this time taking the items into account

Then I'm not sure why you think that the tracks should be 0px in your example. Do you want to avoid laying the grid again if there is size containment?


-- 
GitHub Notification of comment by Loirooriol
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/4931#issuecomment-611665708 using your GitHub account

Received on Thursday, 9 April 2020 17:55:38 UTC