W3C home > Mailing lists > Public > public-css-archive@w3.org > September 2017

[csswg-drafts] [css-syntax-3] <hash-token> seems to get type ID for sequence "#-\" followed by EOF

From: Darien Maillet Valentine via GitHub <sysbot+gh@w3.org>
Date: Sun, 17 Sep 2017 03:10:20 +0000
To: public-css-archive@w3.org
Message-ID: <issues.opened-258274759-1505617808-sysbot+gh@w3.org>
bathos has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-syntax-3] <hash-token> seems to get type ID for sequence "#-\" followed by EOF  ==
In [consume a token](https://drafts.csswg.org/css-syntax-3/#consume-token), the following steps are given for handling "#":

> If the next input code point is a name code point or the next two input code points are a valid escape, then:
> 1. Create a `<hash-token>`.
> 2. If the next 3 input code points would start an identifier, set the `<hash-token>`’s type flag to "id".
> 3. Consume a name, and set the `<hash-token>`’s value to the returned string.
> 4. Return the `<hash-token>`.

The "would start an identifier" check confirms that the backslash of an escape is not followed by a newline, but confirming that it is not followed by EOF is deferred to "consume an escaped codepoint", via "consume a name" (step 3).

I’m not sure if it really matters in practice (perhaps this is even intentional), but it struck me as odd that (assuming I’m reading it correctly) this would mean that the sequence `U+0023 U+002D U+005C EOF` would produce a hash token whose type is set to ID, even though "-" isn’t a valid ID.

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/1821 using your GitHub account
Received on Sunday, 17 September 2017 03:10:13 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:41:18 UTC