Skip to content

[cssom] Serialization of custom identifiers #2858

@ewilligers

Description

@ewilligers

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".

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions