Re: [csswg-drafts] [selectors-4] [css-syntax-3] Does the U+0000 → U+FFFD rule apply to selector parsing? (#4927)

Yes, that's a Chrome/Safari bug.

I'm not sure how I could actually make the spec clearer; it seems to be laid out pretty explicitly to me:

* As Simon says, Selectors links to <https://drafts.csswg.org/css-syntax-3/#css-parse-something-according-to-a-css-grammar>.
* That's section 5.3.1; the upper-level section 5.3 <https://drafts.csswg.org/css-syntax/#parser-entry-points> says:

 > [The algorithms] assume that they are invoked on a token stream, but they may also be invoked on a string; if so, first perform input preprocessing to produce a code point stream, then perform tokenization to produce a token stream.

 Afaict, that's completely explicit about what to do here.

* If you skipped that and tried to follow the algorithm itself, step 1 of the algo links you to <https://drafts.csswg.org/css-syntax/#parse-a-list-of-component-values>, which links to <https://drafts.csswg.org/css-syntax/#consume-a-component-value>, whose first instruction is "consume the next input token"; if you're just assuming you have a string here, there's no such thing as an "input token" and you're in completely undefined territory.

(Closing as Question Answered, but if you can see any holes in this that I could patch up, feel free to comment or re-open.)

-- 
GitHub Notification of comment by tabatkins
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/4927#issuecomment-610633086 using your GitHub account

Received on Tuesday, 7 April 2020 21:36:34 UTC