css-houdini-drafts
css-houdini-drafts copied to clipboard
[css-properties-values-api] PropertyDescriptor::name unnecessarily uses CSS syntax
This is pretty much the same as https://github.com/w3c/csswg-drafts/issues/1325.
https://drafts.css-houdini.org/css-properties-values-api/#register-a-custom-property
Attempt to parse name as a
<custom-property-name>.
This suggests using a CSS parser to parse the contents of a JS string, with CSS backslash-escapes (in addition to any JS backslash-escapes, if the JS string was initially a literal). Instead it should only check something like "starts with two dashes U+002D U+002D".
So you are saying that it shouldn't be an error to register a typed custom property with a name that can never be used through CSS, e.g. "--my name here"?
You can definitely use that property name, you just need to escape it: --my\20name\20here.
But yeah, need to align this with the other things that register a name without invoking the CSS parser on it.
Thanks! Makes sense.
#465 was fixed in ec027417a8 and probably can be closed.