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

> with option A: [...] the item's content-box size is 0px x 0px

The grid area would be 0x0, yes, but wouldn't the item be bigger due to the automatic minimum size? Or would it not apply since we would kind of be treating the `auto` track sizing function as `0px`? On the one hand, I think it's bad if the automatic minimum size forces an item to grow bigger than its grid area. On the other hand, the item being 0x0 also seems bad. So I'm not a fan of option A.

> When you calculate the size of the box, you treat it as having no content, and therefore do not reserve room for any implicit track.

@frivoal You don't? So Chromium is wrong?

To summarize this issue, below I list the possibly unclear questions about the interaction of grid and size containment.

When sizing a grid container with size containment under a min/max-content constraint,

1. Should we run the placement algorithm (creating implicit tracks if needed)?
   Florian says we shouldn't? Chromium does, Firefox does not.
2. Should we run the track sizing algorithm?
   The spec says so. Chromium does, Firefox just sets the size of the grid container to 0.
3. If 1 and 2 are affirmative, should tracks take intrinsic contributions of the items into account?
   No, that would defeat the point of using size containment.

When laying out the grid container with size containment into that size,

4. Should we run the placement algorithm (creating implicit tracks if needed)?
   Yes, we need to know where to place the items in order to display them.
5. Should we run the track sizing algorithm?
   Yes, we need to know the sizes of the grid areas in order to size the grid items.
6. If 4 and 5 are affirmative, should tracks take intrinsic contributions of the items into account?
   Yes with option B, not with option A. Chromium and Firefox do it.
7. If 6 is negative, should the automatic minimum size still apply?
   Maybe not?

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

Received on Monday, 13 April 2020 21:51:27 UTC