Closed Bug 2781 Opened 26 years ago Closed 26 years ago

CSS parser is incorrectly treating <!-- and --> (CDO/CDC)

Categories

(Core :: CSS Parsing and Computation, defect, P3)

x86
Windows 98
defect

Tracking

()

VERIFIED WONTFIX

People

(Reporter: ian, Assigned: peterl-retired)

References

()

Details

CDO (<!--) and CDC (-->) should only be ignored in *very particular* places of CSS grammar. Examples: .xa <!-- { color: yellow; background: red none; } The <!-- should not be parsed as CDO, it should be parsed as a part of the selector. Since it is invalid in a selector, then the entire rule should be ignored. .xb { color: yellow -->; background: red none <!--; } Since those characters are not valid in those properties' values, both properties should be ignored. .xc { <!-- color: yellow; --> background: red none; } Here the they should be parsed as part of the property name, and so both properties should be ignored. IT IS INCORRECT to pass CDO/CDC as whitespace. They are separate entities, which IN CERTAIN PLACES can be ignored by the CSS parser, to facilitate inserting CSS into HTML. See the spec.
Status: NEW → RESOLVED
Closed: 26 years ago
Resolution: --- → FIXED
BTW, according to the HTML spec, whitespace is allowed between the "--" and the ">" of the CDC. While the CSS2 spec doesn't live up to that, you may want to test for it anyway...
Cannot verify this bug until #2946 is fixed.
QA Contact: 3847
Status: RESOLVED → REOPENED
You still have an error on this page. The following: --> <!-- --> <!-- -- > .xf { color: yellow; background: red none; } ...should be ignored, but instead it is not: the space in "-- >" is, I think, being ignored. See also the closely related bug #3261.
Resolution: FIXED → ---
Status: REOPENED → RESOLVED
Closed: 26 years ago26 years ago
Resolution: --- → WONTFIX
Whitespace between the "--" and the ">" is explicitly allowed by the HTML4.0 spec. So we allow it in CSS too.
Status: RESOLVED → VERIFIED
O...k... I have followed this up in www-style. This means that you effectively pass this test. Verifying wontfixed.
You need to log in before you can comment on or make changes to this bug.