2.1.6 [CSS-Level2-2009] Section 4.2, Rules for handling parsing errors

V0004:

The specification states:

 Illegal values:
 User agents must ignore a declaration with an illegal value.

Quirks Mode (All Versions)

Short-hand properties that contain illegal values are not ignored.

IE8 Mode (All Versions)

Invalid characters are allowed in font names.

V0185:

The specification states:

 Malformed declarations. User agents must handle unexpected tokens encountered while 
 parsing a declaration by reading until the end of the declaration, while observing 
 the rules for matching pairs of (), [], {}, "", and '', and correctly handling 
 escapes. For example, a malformed declaration may be missing a property name, colon (:), 
 or property value. The following are all equivalent: 
  
 p { color:green }
 p { color:green; color }  /* malformed declaration missing ':', value */
 p { color:red;   color; color:green }  /* same with expected recovery */
 p { color:green; color: } /* malformed declaration missing value */
 p { color:red;   color:; color:green } /* same with expected recovery */
 p { color:green; color{;color:maroon} } /* unexpected tokens { } */
 p { color:red;   color{;color:maroon}; color:green } /* same with recovery */

Quirks Mode (All Versions)

The following variations apply:

  • Malformed rules with a semicolon before a property are not ignored.

  • Nested malformed declarations are applied, while the correct rules that follow the declaration are ignored.

Quirks Mode and IE7 Mode (All Versions)

Blocks and strings are parsed without matching terminating pairs.

V0186:

The specification states:

 Unexpected end of style sheet
  
 User agents must close all open constructs (for example: blocks, parentheses, 
 brackets, rules, strings, and comments) at the end of the style sheet.

Quirks Mode and IE7 Mode (All Versions)

Open parentheses, open strings, and open rules are not closed at the end of the style sheet.

V0187:

The specification states:

 Unexpected end of string
  
 User agents must close strings upon reaching the end of a line, but then drop the 
 construct (declaration or rule) in which the string was found.

Quirks Mode and IE7 Mode (All Versions)

The parser drops the rule when it encounters an unterminated string and does not continue to the next semicolon (;).