[css-houdini-drafts] [css-properties-values-api] <custom-ident> in syntax string?

SimonSapin has just created a new issue for 
https://github.com/w3c/css-houdini-drafts:

== [css-properties-values-api] <custom-ident> in syntax string? ==
https://drafts.css-houdini.org/css-properties-values-api/#supported-syntax-strings
> The following syntax strings are supported:
> […]
> Any string, the contents of which matches the 
[`<ident>`](https://drafts.csswg.org/css-values-4/#typedef-ident) 
production

Which links to https://drafts.csswg.org/css-values-4/#typedef-ident
> Identifiers, generically denoted by `<ident>`, consist of a sequence
 of characters conforming to the 
[`<ident-token>`](https://drafts.csswg.org/css-syntax-3/#typedef-ident-token)
 grammar. [CSS3SYN] 

Which links to 
https://drafts.csswg.org/css-syntax-3/#typedef-ident-token

`<ident-token>` is rather complex, for example with backslash-escapes.
 But you likely don’t want to use a full CSS tokenizer (e.g. accepting
 CSS comments between tokens) to parse syntax strings. And JavaScript 
string literals have their own escaping which also uses backslashes, 
so users might have to use double-backslashes.

There is a somewhat-related precedent in the 
[grid-template-areas](https://drafts.csswg.org/css-grid/#grid-template-areas-property)
 property which has quoted strings that can contain arbitrary 
identifiers. The identifier syntax there is "A sequence of [name code 
points](https://drafts.csswg.org/css-syntax-3/#name-code-point)". 
Doing the same here would avoid double-backslashes and keep things 
relatively simple.

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

Received on Friday, 22 July 2016 17:06:55 UTC