W3C home > Mailing lists > Public > public-css-archive@w3.org > June 2018

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

From: Manuel Rego Casasnovas via GitHub <sysbot+gh@w3.org>
Date: Fri, 22 Jun 2018 21:19:40 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-399585146-1529702378-sysbot+gh@w3.org>
@frivoal one question about this, are there other elements that can have an intrinsic size different from zero if they have no contents?

Grid Layout is special, because when you define the sizes of the tracks you're somehow defining the size of the grid container too.

What's the use case for this example? Why someone wants to apply `contain: size` and have the size of the grid container to be only the fixed tracks? Wouldn't be similar if you get a 0x0 size (like it happens right now in Chromium)?

I'm doing all these questions because I've been taking a look to the issue and I'm not sure if it deserves the implementation complexity it might require.

For widths it's simple, you compute the intrinsic/preferred widths like if you have no grid items, so only the tracks with fixed sizes are taken into account and you get the 100px width.
Then you do the layout normally, and probably the grid would overflow that size if there are content-sized tracks with some items.

But for heights, browsers don't have a phase to compute the intrinsic height, so we'd need to run the track sizing algorithm for rows ignoring the contents, and then run it again for the real layout. It's true we could get this information from the style without running the algorithm, as this is only relevant when the height is indefinite, still we don't have explicit code for that and I'm wondering if it'd be really useful.

If there's not a strong use case, and grids are the only ones affected by this, maybe an option for grid container, would be to add them to the replaced elements sentence, saying that their intrinsic size is zero with size containment.

Of course I might be missing many things, this was just a quick look, but before going deeper I want to understand the reasons behind it.

-- 
GitHub Notification of comment by mrego
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/2804#issuecomment-399585146 using your GitHub account
Received on Friday, 22 June 2018 21:19:43 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 9 October 2019 08:16:44 UTC