[csswg-drafts] [css-grid] How to serialize the strings in grid-template-areas?

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

== [css-grid] How to serialize the strings in grid-template-areas? ==
['grid-template-areas'](https://drafts.csswg.org/css-grid/#grid-template-areas-property) takes several strings as its value, each representing one row of the grid. These strings are then parsed into area labels.

We're basically using strings here as a convenient way to delimit the rows.  They're *not* strings in the traditional sense, where their value contains uninterpreted text; instead, they're just a funny way of writing an ident sequence. Several implementations thus just *store* the property's value as a sequence of area labels, and regenerate the string on demand when needed for serialization purposes.

This means that, in Chrome/WebKit/Edge, a declaration like `grid-template-areas: "  a \9 b ";` is serialized in computed values as just `"a b"`, the simplest string that has the same effect.  Only Firefox preserves the precise string, serializing as `"  a \9 b "`. [Testcase](http://software.hixie.ch/utilities/js/live-dom-viewer/saved/6327)

Firefox is technically correct here, in that strings are preserved and serialized exactly as entered in every other case. But I don't think the other browsers are necessarily *wrong* here; these aren't traditional strings, and it's reasonable to "forget" what the original string was in favor of just preserving the meaning. Currently the tests for this feature are written with the assumption of simplification; [here's a Moz bug about the failure](https://bugzilla.mozilla.org/show_bug.cgi?id=1500590) and [a Chrome bug they opened pointing out this violates CSSOM's serialization rules](https://bugs.chromium.org/p/chromium/issues/detail?id=897444).

Should we declare one way or the other correct? Or allow them both?

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

Received on Sunday, 28 October 2018 16:31:34 UTC