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 believe that the following CSS2 fragment is legal CSS, if my reading of CSS 2 is correct, yet the validator incorrectly reports an error with grammar=CSS2 selected. Test case: selector { color: gr\000065en; } Reasoning: in CSS2 no terminating space is required after a full-length numeric escape sequence, filled out to the maximum of six characters. So in CSS2 the property value is "red". See the productions for "escape" in the CSS2 grammar. [FYI, compare selector { color: gre\000065n; } selector { color: r\000065 d; } both of which is correctly reported as valid. It seems to be that the parser is reading characters after the sixth hex digit and parsing them as part of the number.] Regards, Cecil Ward.
Created attachment 462 [details] A patch The idea of the patch is to terminate parsing of an escape sequence when either a non-digit is encountered, or six chars has been processed. In both cases whitespace following the escape sequence, if any, is skipped.
Comment on attachment 462 [details] A patch The code in CssParser.convertStringIndex() fails to enforce the "no more than 6 chars" rule for escape sequences. In fact, it has a (count < 6) check, but fails to increment the counter.
Created attachment 463 [details] CSS1 allows escape sequences 4 chars long maximum CSS1 allows escape sequences to be 4 chars long maximum, while CSS2+ allows 6 chars. We need to conditionalize on CSS version.
Peter, Your patch looks good to me. I commited it to CVS, so now we can test and move to prod if all looks good. Yves, will you have a chance to double-check the patch?
CVS version now in production. Closing.