Re: [csswg-drafts] [css-grid-2] Mapping implicit line names from grid areas to orthogonal subgrids (#9418)

The relevant spec section is https://www.w3.org/TR/css-grid-2/#subgrid-area-inheritance

Analyzing the testcase:
![Diagram of the testcase](https://github.com/w3c/csswg-drafts/assets/725717/58cc0415-decd-4542-8172-40ba0a612238)

1. The master grid has a 4-column 1-row area called "x", which creates "x-start" and "x-end" lines in both axes.
2. The subgrid covers this same area, adopting the "x-start" and "x-end" line names in the subgridded axis (i.e. for its vertical tracks, which are in fact its rows since it has a vertical writing mode).
3. The subgrid items are placed into the subgrid, starting with the top left corner. They have explicit row placement, but automatic column placement, so each one ends up in a different column:
    1. The first item's row placement is "x-start", implicit span of 1, so it starts at the first (x-start) vertical line and spans to the second vertical line. It remains in the first horizontal track (first column) of the subgrid.
    2. The second item's row placement is "x", so it stretches from the x-start vertical line to the x-end vertical line, and occupies the second horizontal track of the subgrid.
    3. The third item's row placement is "x-start / x-end", so it also occupies all the vertical tracks, and the third horizontal track of the subgrid.
    4. Te fourth item's row placement is "x-end", implicit span of 1. It wants to be placed at vertical lines 5 (x-end) and 6, but it gets clamped to lines 4 and 5, occupying the grid cell at the intersection of the 4th horizontal and 4th vertical tracks in the subgrid.

This, afaict, yields the rendering in WebKit. CC @tabatkins for sanity check.

(I noticed that in https://www.w3.org/TR/css-grid-2/#subgrid-area-inheritance we didn't specify that only the subgridded axes inherits names, but that doesn't affect the results here anyway.)

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


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

Received on Tuesday, 3 October 2023 19:57:21 UTC