W3C home > Mailing lists > Public > public-css-archive@w3.org > April 2020

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

From: Mats Palmgren via GitHub <sysbot+gh@w3.org>
Date: Thu, 09 Apr 2020 03:43:56 +0000
To: public-css-archive@w3.org
Message-ID: <issues.opened-596999149-1586403835-sysbot+gh@w3.org>
MatsPalmgren has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-grid][css-contain] Clarify that `contain:size` affects track sizing ==
Consider the following case:
```html
<div style="display:inline-grid; contain:size;">
  <item style="background:red">Hello Kitty</item>
</div>
```

My understanding of the CSS Containment spec is that the intent of `contain:size` is that all size calculations should be done as if the element has no children:
https://drafts.csswg.org/css-contain/#containment-size
Chromium and Gecko agrees that the content-box size in the above case is 0x0, which is correct. I tend to think that the track sizes also should be zero and thus that it should render the same as:
```html
<div style="display:inline-grid; grid:0/0;">
  <item style="background:red">Hello Kitty</item>
</div>
```
Neither Chromium nor Gecko does that currently, but I intend to fix this in Gecko ([bug 1488878](https://bugzilla.mozilla.org/show_bug.cgi?id=1488878)).

I can't find any spec text dealing with this case explicitly though, so I would like CSS Grid to clarify that  when the Grid container has `contain:size` the [Track Sizing Algorithm](https://drafts.csswg.org/css-grid/#algo-track-sizing) should be run as if the container has no items. This will have the effect that any [intrinsic track sizes](https://drafts.csswg.org/css-grid/#intrinsic-sizing-function) will be zero.

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/4931 using your GitHub account
Received on Thursday, 9 April 2020 03:43:59 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:42:04 UTC