This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 5581 - Several invalid forms of @charset syntax reported as valid in explicit css2.1 grammar - part II
Summary: Several invalid forms of @charset syntax reported as valid in explicit css2.1...
Status: RESOLVED FIXED
Alias: None
Product: CSSValidator
Classification: Unclassified
Component: CSS 2.1 (show other bugs)
Version: CSS Validator
Hardware: PC Windows XP
: P2 normal
Target Milestone: ---
Assignee: This bug has no owner yet - up for the taking
QA Contact: qa-dev tracking
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-03-20 12:04 UTC by CecilWard
Modified: 2008-04-03 14:06 UTC (History)
0 users

See Also:


Attachments
test case (48 bytes, text/css)
2008-03-31 14:55 UTC, Olivier Thereaux
Details
test case 2 (48 bytes, text/css)
2008-03-31 14:55 UTC, Olivier Thereaux
Details
test case 3 (48 bytes, text/css)
2008-03-31 14:56 UTC, Olivier Thereaux
Details
simple quote for charset -> fails (45 bytes, text/css)
2008-04-03 14:06 UTC, Yves Lafon
Details

Description CecilWard 2008-03-20 12:04:32 UTC
The following test cases are mistakenly reported as "valid" against the explicitly selected CSS 2.1 grammar.
[ checked at 2008-03-20 against live snapshot of the validator, http://qa-dev.w3.org:8001/css-validator/#validate_by_input+with_options ]

--
test case 8: selected grammar=CSS2.1

@charset /**/"utf-8";

Correct response: INVALID; should report INVALID when selected CSS 2.1 grammar
Current status: INCORRECT: The validator's response is INCORRECT, as of 2008-03-20.

--

--
test case 9: selected grammar=CSS2.1

@charset/**/ "utf-8";

Correct response: INVALID; should report INVALID when selected CSS 2.1 grammar
Current status: INCORRECT: The validator's response is INCORRECT, as of 2008-03-20.

--

--
test case 10: selected grammar=CSS2.1

@charset "utf-8"/**/;

Correct response: INVALID; should report INVALID when selected CSS 2.1 grammar
Current status: INCORRECT: The validator's response is INCORRECT, as of 2008-03-20.


Regards,

Cecil Ward.
Comment 1 CecilWard 2008-03-20 13:05:10 UTC
Note: see discussion ref bug 3381

It now appears that, just as predicted earlier, the parsing of the @charset rule has been adversly affected by changes in respect of the bugfixes for bug 3381.

The problem is the current production for the @charset rule in the grammar, which is not 'atomic', not a terminal. It is not ok to allow a lexer to do its usual work in the middle of processing the @charset rule because it is not at liberty to for example collapse multiple items of whitespace nor to eat up comments completely in CSS2.1 mode.

The suggested modification to the lexer in respect of @charset described in http://www.w3.org/Style/css2-updates/CR-CSS21-20070719-errata.html is not radical enough.
Comment 2 Yves Lafon 2008-03-28 10:14:42 UTC
It would be relatively easy to parse only the strict version of CSS21, however the hard part here is to allow CSS2 constructs ("@charset S* STRING S* ;) while managing to cope with the strict version.
Comment 3 Yves Lafon 2008-03-28 15:14:46 UTC
Fixed, all the test cases reporter are rejected as they should.
Also there is a special test to have the string starting with " and not ', per
http://www.w3.org/TR/CSS21/syndata.html#charset

Available on http://qa-dev.w3.org:8001/css-validator/
Thanks,
Comment 4 Olivier Thereaux 2008-03-31 14:55:10 UTC
Created attachment 543 [details]
test case
Comment 5 Olivier Thereaux 2008-03-31 14:55:39 UTC
Created attachment 544 [details]
test case 2
Comment 6 Olivier Thereaux 2008-03-31 14:56:00 UTC
Created attachment 545 [details]
test case 3
Comment 7 Yves Lafon 2008-04-03 14:06:45 UTC
Created attachment 546 [details]
simple quote for charset -> fails