This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
I've sent an e-mail to the Working Group, but it never delivered. So I repost it here: To: www-style@w3.org Subject: [css-syntax] 4.3.11. Consume a name? The specification reads: ``Repeatedly consume the next input code point from the stream:'' And whenever the code point does not match the two clauses mentioned below, ``anything else Return result.'' I believe that this description wrong. The current code point should be reconsumed, before returning the result, thereby preventing that a non-matching symbol from the input stream is eaten by the algorithm. A counter-example: #ident{ } would then first consume the "#", which triggers the `Consume a name'-algorithm. It then continues with the `name code point'-path, all the way up to "{". Here it returns result, while "{" is still consumed. If I may suggest a better wording, it would be: ``anything else Reconsume the current input code point and return result.'' See: http://www.w3.org/TR/css-syntax-3/#reconsume-the-current-input-code-point http://www.w3.org/TR/css-syntax-3/#consume-a-name Background: While implementing Java tokenizer/parser for CSS, my relevant piece of code is: String consumeName() { StringBuilder result = new StringBuilder(); int code, next; while (true) { code = preprocess(); if (isName(code)) { result.appendCodePoint(code); continue; } next = preprocess(); if (isValidEscape(code, next)) { result.appendCodePoint(consumeEscape(next)); continue; } break; } pushback(next); // note these pushbacks! pushback(code); // they are not specified return result.toString(); }
Nah, it delivered. I just haven't gotten to it yet - I'll do so in a few minutes. (I took November off and am very slowly working my way through my email backlog.) I'll close this bug in the meantime.