-
Notifications
You must be signed in to change notification settings - Fork 757
Description
A declaration name is an <ident-token> representing unescaped code points.
It is first tokenized as an ident-like token...
ident-start code point Reconsume the current input code point, consume an ident-like token, and return it.
https://drafts.csswg.org/css-syntax-3/#consume-token
... by consuming code points as an ident sequence...
This section describes how to consume an ident-like token [...].
Consume an ident sequence, and let
stringbe the result.
https://drafts.csswg.org/css-syntax-3/#consume-ident-like-token
... which consumes escaped code points and gather the result...
the stream starts with a valid escape Consume an escaped code point. Append the returned code point to
result.
https://drafts.csswg.org/css-syntax-3/#consume-an-ident-sequence
... then a declaration is consumed with <ident-token> as its name:
- If the next token is an
<ident-token>, consume a token frominputand setdecl's name to the token’s value.
But it is not escaped during serialization, which is required for custom properties:
<style>style { --a\ b: 1 }</style>
<script>
document.styleSheets[0].cssRules[0].cssText // style { --a\ b: 1 }
</script>It could also be representing unescaped code points in consuming a declaration.