[csswg-drafts] [css-grid-2] Subgrids and CQs are problematic (#7822)

tabatkins has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-grid-2] Subgrids and CQs are problematic ==
There are a few problematic things about subgrid when it comes to Container Queries.

1. Single-axis size containment isn't meaningful for subgrids.

 It needs some clarification in the spec, but if a subgrid has full size containment, its children also shouldn't affect the size of the parent grid's tracks (this is an implication of "lays out as if empty", taken to its full conclusion). But if you have just inline size containment, it's not clear what that means for the children. Their sizes don't just affect the subgrid's size; they affect the size of the parent grid's tracks, which can spill out to affect things far outside the subtree, in both axises.

 Probably we want to define that either single-axis size containment gets "upgraded" to full size containment for subgrids, or that size containment makes you an independent grid, like layout containment does.

2. CQs can change whether a subgrid's item participates in the parent grid at all.

 I don't think this is a true circularity, but @bfgeek tells me it's probably problematic for Chrome's impl if the set of grid items being looked at by the grid layout algo changes midway thru. This can't happen normally - for a CQ to depend on grid layout, it would have to be on a grid item, but then it can only affect the grid item's children, so the set of grid items being laid out doesn't change.  But for subgrid this isn't true; its children are lifted into the parent grid for layout purposes, and a CQ can change whether or not they do so (it can make a child abspos, or turn a further nested subgrid child into an independent grid, etc).

 Unsure what the right fix for this is.

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/7822 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Monday, 3 October 2022 22:51:47 UTC