Re: [csswg-drafts] [css-contain] specified column/row sizes on grid containers should contribute to contain:size

While grid and table are similar in some respects, there is one key difference that matters with regards to css-contain: tables cannot<sup>[1]</sup> be forced to be smaller than their min-content size. That makes it impossible for `contain: size` to apply to table (and table parts). If it did, we would have to layout tables to a size smaller than their min-content, and how to do so is undefined.

This is not a problem for grid, and so we should not need to call out grid specifically here.

Now, specifically on the bug you found, this is a chrome bug and a clear spec violation. The main effect of `contain:size` is:
> When laying out the containing element, it must be treated as having no contents.

This means that you are correct: 
> [...] grid elements which have content-relative sizing on their columns/rows (e.g grid-template-columns: auto) should be treated as if the sizing were zero when contain:size is applied. However, if the value is specified (e.g. grid-template-row: 20px) with contain:size applied, it should be treated as being explicitly sized at whatever the specified size is [...]

Based on that, I don't believe any normative change to the spec is needed. Maybe a note could help, but I am not convinced, why list this particular situation, and not all the other cases? However, we should certainly add a test case to the test suite to make sure this is caught, and file a bug on chrome.


----

[1]: With some partial exceptions when using `table-layout: fixed`, but which are insufficient to invalidate the statement that in the general case, tables cannot be made smaller than their min-content.

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

Received on Friday, 22 June 2018 01:24:39 UTC