4.2 Rules for handling parsing errors |
Parsing unexpected end of declaration block |
invalid |
The parser implicitly terminates the block and applies the styles if the declaration block is not terminated. |
|
Parser error handling with invalid at-rules: @ invalid selector |
invalid |
At-Rules start with an at-keyword (@ followed immediately by an identifier). |
|
Parsing of invalid @rules |
invalid |
An at-rule consists of everything up to and including the next semi-colon or the next block. |
|
Parsing of invalid @rules with blocks |
invalid |
An at-rule consists of everything up to and including the next semi-colon or the next block. |
|
@import inside block |
invalid |
@import is ignored if inside a block. |
|
@import following @charset |
invalid |
@import is ignored if inside a block or after any valid statement except @charset. |
|
@import following valid statements |
invalid |
@import is ignored if after any valid statement except @charset. |
|
@import following an invalid statement |
invalid |
@import is ignored if inside a block or after any valid statement except @charset. |
|
@import following a bad @rule |
invalid |
@import is ignored after invalid @rule. |
|
@import after a bad selector and rule block |
invalid |
@import is not ignored if after bad selector. |
|
@rules and white space |
|
White-space does not affect the validity of @rules. |
|
Parser error handling with invalid at-rules: @ invalid selector with a number |
invalid |
At-Rules start with an at-keyword (@ followed immediately by an identifier). |
|
Parser error handling with invalid at-rules: @ invalid selector with a hyphen |
invalid |
At-Rules start with an at-keyword (@ followed immediately by an identifier). |
|
Rule blocks and white space |
|
White-space around rule blocks do not affect the validity of the rule block. |
|
Parsing counter() function with no white space |
|
The counter function can be parsed with no white space separating the function values. |
|
Parsing counters() function with no white space and two function values |
|
The counters function can be parsed with no white space separating the function values. |
|
Parsing counters() function with no white space and three function values |
|
The counters function can be parsed with no white space separating the function values. |
|
Parsing counter() function with white space |
|
The counter function can be parsed with white space separating the function value. |
|
Parsing counter() function with white space and two function values |
|
The counter function can be parsed with white space separating the function values. |
|
Parsing counters() function with white space and two function values |
|
The counters function can be parsed with white space separating the function values. |
|
Parsing counters() function with white space and three function values |
|
The counters function can be parsed with white space separating the function values. |
|
Parsing counters() functions |
|
To refer to a sequence of nested counters of the same name, the notation is 'counters(identifier, string)' or 'counters(identifier, string, list-style-type)'. |
|
Parsing unexpected end of function |
invalid |
User agents close all open parentheses at the end of the style sheet. |
|
Parsing unexpected end of string |
invalid |
Close all open strings at the end of the style sheet. |
|
Parsing unexpected end of @media block |
invalid |
User agents close all open blocks at the end of the style sheet. |
|
Parsing unexpected end of @import |
invalid |
User agents close all open rules at the end of the style sheet. |
|
Parsing unexpected end of @import with closed quote |
invalid |
User agents close all open quotes at the end of the style sheet. |
|
Parsing unexpected end of shorthand rule |
invalid |
User agents close all open rules at the end of the style sheet. |
|
Parser error handling with invalid at-rules: @ invalid selector invalidates entire block |
invalid |
The entire block of an invalid at-rule is ignored. |
|
Parsing invalid declarations in at-rules where valid declaration precedes an invalid rule |
invalid |
Invalid declarations within at-rules are ignored while the valid ones are applied. |
|
Parsing invalid declarations in at-rules where valid declaration follows invalid rule |
invalid |
Invalid declarations within at-rules are ignored while the valid ones are applied. |
|
Parsing malformed rules: Property with no value and no ending semicolon |
invalid |
Malformed rules (property with no value and no ending semicolon) are ignored while valid rules are applied. |
|
Parsing malformed rules: Property with no value assigned |
invalid |
Malformed rules (property with no value) are ignored while valid ones are applied. |
|
Parsing malformed rules: No value and no semi-colon |
invalid |
Malformed rules with no value or semi-colon are ignored while valid rules are applied. |
|
Parsing malformed rules: No value with property |
invalid |
Malformed rules with no value are ignored while valid rules are applied. |
|
Parsing malformed rules: Semi-colon before property |
invalid |
Malformed rules with semi-colon before property are ignored while valid rules are applied. |
|
Parsing malformed rules: Valid rule after malformed rule |
invalid |
Malformed rules are ignored while valid rules are applied. |
|
Parsing malformed rules: Double colon separating property and value |
invalid |
Malformed rules with double colons between property and value are ignored while valid rules are applied. |
|
Parsing malformed rules: Missing property |
invalid |
Malformed rules with missing properties are ignored while valid rules are applied. |
|
Error handling of unterminated strings |
fontinvalid |
When the parser encounters an unterminated string, the parser drops everything up to the next ';'. |
|
malformed declaration missing ':', value, part 1 |
invalid |
malformed declaration missing ':', value, part 2 |
invalid |
malformed declaration missing value, part 1 |
invalid |
malformed declaration missing value, part 2 |
invalid |
malformed declaration: unexpected tokens { }, part 1 |
invalid |
malformed declaration: unexpected tokens { }, part 2 |
invalid |
Forward-Compatible Parsing |
|
Forward-Compatible Parsing |
|
Forward-Compatible Parsing |
|
Forward-Compatible Parsing |
|
Forward-Compatible Parsing |
|
4.4 CSS style sheet representation |
HTTP Charset over BOM |
|
The HTTP charset setting overrides the Byte Order Mark in the stylesheet. |
|
HTTP Charset over @charset |
|
The HTTP charset setting overrides the @charset designation in the stylesheet. |
|
HTTP charset over link charset |
|
The HTTP charset setting overrides the charset designation in the link tag. |
|
HTTP charset over set referring code page (UTF-8) |
|
The HTTP charset setting overrides the referring document's code page. |
|
HTTP charset over set referring code page (windows-1252) |
|
The HTTP charset setting overrides the charset designation in the referring document's meta tag. |
|
HTTP charset over referring code page (not set) |
|
The HTTP charset setting overrides the charset of referring document. |
|
@charset over link charset attribute |
|
The @charset setting in the stylesheet overrides the charset attribute of the link element. |
|
@charset over referring document's code page (set) |
|
The @charset setting in the stylesheet overrides the referring document's set code page. |
|
@charset over referring document's code page (unset) |
|
The @charset setting in the stylesheet overrides the referring document's unset code page. |
|
Link charset attribute over referring document's codepage (set) |
|
The stylesheet's encoding is determined by the link element's charset attribute and not the referring document's code page. |
|
Link charset attribute over referring document's codepage (not set) |
|
The stylesheet's encoding is determined by the link element's charset attribute and not the referring document's code page. |
|
Stylesheet encoding via the referring document's encoding (set) |
|
The stylesheet's encoding is determined by the set encoding of the referring document. |
|
Stylesheet encoding via the referring document's encoding (user set) |
I |
The stylesheet's encoding is determined by the user set referring document's encoding. |
|
Matching BOM and @charset (utf-8) |
|
The encoding is correctly interpreted from the matched BOM and @charset. |
|
Matching BOM and @charset (utf-16 LE) |
|
The encoding is correctly interpreted from the matched BOM and @charset. |
|
Matching BOM and @charset (utf-16 BE) |
|
The encoding is correctly interpreted from the matched BOM and @charset. |
|
BOM with no @charset (utf-8) |
|
The stylesheet is correctly interpreted as utf-8. |
|
BOM with no @charset (utf-16LE) |
|
The stylesheet is correctly interpreted as utf-16LE. |
|
BOM with no @charset (utf-16BE) |
|
The stylesheet is correctly interpreted as utf-16BE. |
|
@charset specified (windows-1252) |
|
The stylesheet is correctly interpreted as windows-1252. |
|
@charset specified (Shift-JIS) |
|
The stylesheet is correctly interpreted as Shift-JIS. |
|
@charset specified (ISO-8859-6) |
|
The stylesheet is correctly interpreted as ISO-8859-6. |
|
@charset specified (Big5) |
|
The stylesheet is correctly interpreted as Big5. |
|
@charset specified (UTF-8) |
|
The stylesheet is correctly interpreted as UTF-8. |
|
@charset specified (UTF-16LE) |
|
The stylesheet is correctly interpreted as UTF-16LE. |
|
@charset specified (UTF-16BE) |
|
The stylesheet is correctly interpreted as UTF-16BE. |
|
Non-matching BOM (windows-1252 with UTF-8 BOM) |
|
The stylesheet is thrown out due to the BOM not matching the actual encoding. |
|
Non-matching BOM (UTF-8 with UTF-16LE BOM) |
|
The stylesheet is thrown out due to the BOM not matching the actual encoding. |
|
Non-matching BOM (UTF-16LE with UTF-8 BOM) |
|
The stylesheet is thrown out due to the BOM not matching the actual encoding. |
|
Non-matching BOM (UTF-32BE with UTF-16LE BOM) |
|
The stylesheet is thrown out due to the BOM not matching the actual encoding. |
|
Non-matching @charset (Shift-JIS with 1252 @charset) |
|
The selector does not match due to the mismatched @charset. |
|
Non-matching @charset (Big5 with Shift-JIS @charset) |
|
The selector does not match due to the mismatched @charset. |
|
Non-matching @charset (UTF-8 with Big5 @charset) |
|
The stylesheet is thrown out due to the mismatched @charset. |
|
Non-matching @charset (UTF-16BE with UTF-8 @charset) |
|
The stylesheet is thrown out due to the mismatched @charset. |
|
Non-matching @charset (UTF-32LE with UTF-16BE @charset) |
|
The stylesheet is thrown out due to the mismatched @charset. |
|
@charset does not match BOM (UTF8 encoding and BOM with UTF-16BE @charset) |
|
The stylesheet is thrown out due to the mismatched @charset. |
|
@charset does not match BOM (UTF-16LE encoding and BOM with UTF-8 @charset) |
|
The stylesheet is thrown out due to the mismatched @charset. |
|
@charset does not match BOM (UTF-32BE encoding and BOM with UTF-16BE @charset) |
|
The stylesheet is thrown out due to the mismatched @charset. |
|
Mismatched endianness in @charset (UTF-16LE encoding and BOM with UTF-16BE @charset) |
|
The stylesheet is thrown out due to the mismatched @charset. |
|
Mismatched endianness in @charset (UTF-16BE encoding and BOM with UTF-16LE @charset) |
|
The stylesheet is thrown out due to the mismatched @charset. |
|
Endianness not specified (UTF-16LE encoding with UTF-16 @charset) |
|
The stylesheet is interpreted in the correct encoding. |
|
Endianness not specified (UTF-16BE encoding with UTF-16 @charset) |
|
The stylesheet is interpreted in the correct encoding. |
|
@charset preceded by a newline |
|
The selector does not match due to the @charset being ignored. |
|
@charset preceded by a space |
|
The selector does not match due to the @charset being ignored. |
|
@charset preceded by a declaration |
|
The selector does not match due to the @charset being ignored. |
|
@charset preceded by another @charset |
|
The selector does not match due to the second @charset being ignored. |
|
@charset immediately followed by a declaration block |
|
The declaration block is interpreted and applied correctly. |
|
@charset in uppercase |
|
The selector does not match due to the @charset being ignored. |
|
@charset without quotes |
|
The selector does not match due to the @charset being ignored. |
|
@charset missing a space |
|
The selector does not match due to the @charset being ignored. |
|
@charset escaped numerically |
|
The selector does not match due to the @charset being ignored. |
|
@charset escaped char |
|
The selector does not match due to the @charset being ignored. |
|
@charset missing semi-colon |
|
The selector does not match due to the @charset being ignored. |
|
@charset with bogus name |
|
The selector does not match due to the @charset being ignored. |
|
@charset within style block |
|
The selector does not match due to the @charset being ignored. |
|