Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[cssom] Serialization of custom identifiers #2858

Open
ewilligers opened this issue Jul 2, 2018 · 2 comments
Open

[cssom] Serialization of custom identifiers #2858

ewilligers opened this issue Jul 2, 2018 · 2 comments

Comments

@ewilligers
Copy link
Contributor

https://drafts.csswg.org/css-grid/#propdef-grid-template-areas

Note: These rules can produce cell names that do not match the syntax, such as "1st 2nd 3rd", which requires escaping when referencing those areas by name in other properties, like grid-row: \31st; to reference the area named 1st.

The following parsing tests show variation between browsers in how custom identifiers are serialized:

test_valid_value("grid-column-end",  "\\31st", "\\31 st"); // passes in Blink, Firefox
test_valid_value("grid-column-end",  "\\31st", "1st"); // passes in Edge
test_valid_value("grid-column-end",  "\\31st", '"1st"'); // passes in WebKit

None of these serializations are accepted by any of the main browsers as a property value: none of the browsers round-trip. If we would like to round trip, we would need to serialize as "\\31st".

@upsuper
Copy link
Member

upsuper commented Jul 2, 2018

It accepts <custom-ident> which clearly indicates that Edge and WebKit are wrong (the value they serialize is invalid). And CSSOM where serialization is generally defined doesn't seem to contain anything about that. I guess we can get serialization of <custom-ident> defined to do the Blink / Gecko way.

@upsuper upsuper changed the title [css-values] [css-grid] Serialization of custom identifiers [cssom] [css-grid] Serialization of custom identifiers Jul 2, 2018
@upsuper upsuper added css-grid-1 cssom-1 Current Work labels Jul 2, 2018
ewilligers pushed a commit to ewilligers/web-platform-tests that referenced this issue Jul 4, 2018
Spec: https://drafts.csswg.org/css-grid/

These tests highlight the following 5 issues:

Spec
[cssom] [css-grid] Serialization of custom identifiers
w3c/csswg-drafts#2858

Spec
[css-grid] grid-line custom identifier auto?
w3c/csswg-drafts#2856

Edge
grid-area should reject non-integer numbers
https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/18112694/

Firefox
grid-auto-columns/rows should accept multiple track-size values
https://bugzilla.mozilla.org/show_bug.cgi?id=1339672

WebKit
[CSS Grid Layout] Fix grid-{row, column, area} shorthand CSSOM serialization
https://bugs.webkit.org/show_bug.cgi?id=149890

Note that some properties such as grid and grid-template are not yet tested.
@fantasai fantasai changed the title [cssom] [css-grid] Serialization of custom identifiers [cssom] Serialization of custom identifiers Jul 24, 2018
ewilligers pushed a commit to ewilligers/web-platform-tests that referenced this issue Aug 22, 2018
Spec: https://drafts.csswg.org/css-grid/

These tests highlight the following 5 issues:

Spec
[cssom] [css-grid] Serialization of custom identifiers
w3c/csswg-drafts#2858

Spec
[css-grid] grid-line custom identifier auto?
w3c/csswg-drafts#2856

Edge
grid-area should reject non-integer numbers
https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/18112694/

Firefox
grid-auto-columns/rows should accept multiple track-size values
https://bugzilla.mozilla.org/show_bug.cgi?id=1339672

WebKit
[CSS Grid Layout] Fix grid-{row, column, area} shorthand CSSOM serialization
https://bugs.webkit.org/show_bug.cgi?id=149890

Note that some properties such as grid and grid-template are not yet tested.
ewilligers pushed a commit to ewilligers/web-platform-tests that referenced this issue Sep 4, 2018
Spec: https://drafts.csswg.org/css-grid/

These tests highlight the following 5 issues:

Spec
[cssom] [css-grid] Serialization of custom identifiers
w3c/csswg-drafts#2858

Spec
[css-grid] grid-line custom identifier auto?
w3c/csswg-drafts#2856

Edge
grid-area should reject non-integer numbers
https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/18112694/

Firefox
grid-auto-columns/rows should accept multiple track-size values
https://bugzilla.mozilla.org/show_bug.cgi?id=1339672

WebKit
[CSS Grid Layout] Fix grid-{row, column, area} shorthand CSSOM serialization
https://bugs.webkit.org/show_bug.cgi?id=149890

Note that some properties such as grid and grid-template are not yet tested.
@ewilligers ewilligers added the css-values-4 Current Work label Sep 5, 2018
moz-wptsync-bot pushed a commit to web-platform-tests/wpt that referenced this issue Nov 24, 2019
…t are clearly invalid.

w3c/csswg-drafts#2858

Differential Revision: https://phabricator.services.mozilla.com/D54417

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1598932
gecko-commit: fec93f8968c976eb4c84f2bcd62df2a95e004a75
gecko-integration-branch: autoland
gecko-reviewers: emilio
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this issue Nov 25, 2019
…on results that are clearly invalid. r=emilio

w3c/csswg-drafts#2858

Differential Revision: https://phabricator.services.mozilla.com/D54417

--HG--
extra : moz-landing-system : lando
moz-wptsync-bot pushed a commit to web-platform-tests/wpt that referenced this issue Nov 25, 2019
…t are clearly invalid.

w3c/csswg-drafts#2858

Differential Revision: https://phabricator.services.mozilla.com/D54417

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1598932
gecko-commit: fec93f8968c976eb4c84f2bcd62df2a95e004a75
gecko-integration-branch: autoland
gecko-reviewers: emilio
xeonchen pushed a commit to xeonchen/gecko that referenced this issue Nov 25, 2019
@tabatkins
Copy link
Member

Untagging Values, as it has nothing to say about how to spell these types. The Syntax spec is quite clear here - \31st and \31 st are both valid ways to spell an ident containing the characters "1st". It looks like CSSOM is lacking detail on how to serialize arbitrary idents, but round-tripping is always an implicit requirement, so \31 st is probably the best way do it, and luckily it's what Blink and Firefox already do. This should be clarified in CSSOM.

Safari and Edge are just plain wrong on this issue - 1st and "1st" are both invalid idents (they're a dimension and a string, respectively, neither of which are accepted by these properties).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants