Re: [csswg-drafts] [css-grid] Serialization of grid-template-rows/columns (#4173)

For the specified value, Blink used to expand integral `repeat()` until https://crbug.com/716114. I also fixed WebKit in https://webkit.org/b/197840. So both should output `"repeat(1, [] 10px)"`.

Regarding `[]`, I don't know whether it should be preserved in the specified value. But I don't think it should in the resolved value, because from https://drafts.csswg.org/css-grid/#computed-tracks

> A computed track list is a list alternating between line name sets and track sections, with the first and last items being line name sets.

> A line name set is a (potentially empty) set of identifiers representing line names.

This means that if you specify `1px [] 2px 3px`, the computed value will be `[] 1px [] 2px [] 3px []`. Including the extra `[]` in the serialization would be unexpected IMO, so skipping them all seems better.

Getting back to `repeat()`, Blink and WebKit still expand integral repeat() in the computed value. This is wrong according to the spec. However, note that for grid containers, the resolved value is the used one, with `repeat()` expanded.

I'm not a fan of special casing `repeat(1`.

To summarize, I think the expected serializations should be:
 - Specified value: `"repeat(1, [] 10px)"` or `"repeat(1, 10px)"`, dunno
 - Computed value (resolved value for non-grids): `"repeat(1, 10px)"`
 - Used value (resolved value for grids): `"10px"`

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

Received on Wednesday, 18 September 2019 01:06:59 UTC