Re: [csswg-drafts] [css-grid-2][css-grid] `grid-template-rows/columns` Computed / Resolved Values for 'subgrid' values (#4362)

Interesting, it seems we have a different idea of what the `grid-template-rows/columns` _[used value](https://drafts.csswg.org/css-cascade-4/#used-value)_ is. The linked definition says:
> The **used value** is the result of taking the computed value and completing any remaining calculations to make it the absolute theoretical value used in the layout of the document.

As I read that, the _used value_ can only ever include names from the _computed value_, not any names from ancestors.  The algorithm for line name matching would then consult all the used values (from the subgrid and its ancestor grid(s)) in concert to resolve a name for item placement. (That's how it's implemented it in Gecko at least.  At no point do we have a data structure that holds all the names merged together.)

The spec text however, seems to suggest that the subgrid's _used value_ holds all the names merged together ("whether the names were explicitly created for the subgrid or adopted from the parent grid").

Including the names from ancestors is quite a bit more complicated to implement. Is this justified by a use case?  It also seems a bit weird that adopted names from ancestors should taint the round-trip value.

Personally, I'd rather not include the ancestor names, but I don't feel strongly about it.

If ancestor names are to be included, then the spec should probably define the merge order so that it can be implemented interoperably. E.g.
```css
.grid { grid-template-columns: [a] auto; }
.subgrid { grid-template-columns: subgrid [b]; }
```
Is the resolved value `subgrid [a b]` or `subgrid [b a]`?

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

Received on Friday, 11 October 2019 18:02:59 UTC