Chapter 4 - Syntax and basic data types - 4.2 Rules for handling parsing errors
Go to the relevant page of the specification.
- at-rule-001 (invalid)
-
Parser error handling with invalid at-rules: @ invalid selector
At-Rules start with an at-keyword (@ followed immediately by an identifier). - at-rule-002 (invalid)
-
Parsing of invalid @rules
An at-rule consists of everything up to and including the next semi-colon or the next block. - at-rule-003 (invalid)
-
Parsing of invalid @rules with blocks
An at-rule consists of everything up to and including the next semi-colon or the next block. - at-rule-004 (invalid)
-
@import inside block
@import is ignored if inside a block. - at-rule-005 (invalid)
-
@import following @charset
@import is ignored if inside a block or after any valid statement except @charset. - at-rule-006 (invalid)
-
@import following valid statements
@import is ignored if after any valid statement except @charset. - at-rule-007 (invalid)
-
@import following an invalid statement
@import is ignored if inside a block or after any valid statement except @charset. - at-rule-008 (invalid)
-
@import following a bad @rule
@import is ignored after invalid @rule. - at-rule-009 (invalid)
-
@import after a bad selector and rule block
@import is not ignored if after bad selector. - at-rule-010
-
@rules and white space
White space does not affect the validity of @rules. - at-rule-011 (invalid)
-
Parser error handling with invalid at-rules: @ invalid selector with a number
At-Rules are ignored if they start with an at-keyword (@ followed immediately by an identifier). - at-rule-012 (invalid)
-
Parser error handling with invalid at-rules: @ invalid selector with a hyphen
At-Rules are ignored it they start with an at-keyword (@ followed immediately by an identifier). - at-rule-013 (invalid)
-
Ignoring at-rules inside @media blocks
At-rules inside @media blocks are ignored up to up to the end of the block that contains the invalid at-keyword, or up to and including the next semicolon (;) or up to and including the next block ({...}), whichever comes first. - background-image-005 (invalid)
-
Parsing 'background-image'
- blocks-003
-
Rule blocks and white space
White space around rule blocks do not affect the validity of the rule block. - c71-fwd-parsing-000 (invalid)
-
Forward-Compatible Parsing
- c71-fwd-parsing-001 (invalid)
-
Forward-Compatible Parsing
- c71-fwd-parsing-002 (invalid)
-
Forward-Compatible Parsing
- c71-fwd-parsing-003 (invalid)
-
Forward-Compatible Parsing
- c71-fwd-parsing-004 (invalid)
-
Forward-Compatible Parsing
- core-syntax-001
-
Nested blocks in unexpected places
- core-syntax-002
-
Nested blocks in unexpected places
- core-syntax-003
-
Nested blocks in unexpected places (with no whitespace)
- core-syntax-004
-
Nested blocks in unexpected places (with no whitespace)
- core-syntax-006
-
Parsing invalid '!' declarations
- core-syntax-007
-
Parsing invalid '!' declarations
- core-syntax-008
-
Parsing invalid '!' declarations
- counters-003
-
Parsing counter() function with no white space
The counter function can be parsed with no white space separating the function values. - counters-004
-
Parsing counters() function with no white space and two function values
The counters function can be parsed with no white space separating the two function values. - counters-005
-
Parsing counters() function with no white space and three function values
The counters function can be parsed with no white space separating the three function values. - counters-006
-
Parsing counter() function with white space
The counter function can be parsed with white space separating the function value. - counters-007
-
Parsing counter() function with white space and two function values
The counter function can be parsed with white space separating the two function values. - counters-008
-
Parsing counters() function with white space and two function values
The counters function can be parsed with white space separating the two function values. - counters-009
-
Parsing counters() function with white space and three function values
The counters function can be parsed with white space separating the three function values. - counters-010
-
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)'. - cursor-022 (interact, invalid)
-
cursor - set to an invalid value
The property 'cursor', when set to an invalid value or an illegal value, must be ignored. Then, instead, the cursor to display should be based on the current context. - declaration-001 (invalid)
-
malformed declaration missing ':', value, part 1
- declaration-002 (invalid)
-
malformed declaration missing ':', value, part 2
- declaration-003 (invalid)
-
malformed declaration missing value, part 1
- declaration-004 (invalid)
-
malformed declaration missing value, part 2
- declaration-005 (invalid)
-
malformed declaration: unexpected tokens { }, part 1
- declaration-006 (invalid)
-
malformed declaration: unexpected tokens { }, part 2
- declarations-009 (invalid)
-
Ignoring at-rules inside declaration blocks
At-rules inside declaration blocks are parsed as malformed declarations. - eof-001 (invalid)
-
Parsing unexpected end of declaration block
The parser implicitly terminates the block and applies the styles if the declaration block is not terminated. - eof-002 (invalid)
-
Parsing unexpected end of function
User agents close all open parentheses at the end of the style sheet. - eof-003 (invalid)
-
Parsing unexpected end of string
Close all open strings at the end of the style sheet. - eof-004 (invalid)
-
Parsing unexpected end of @media block
User agents close all open blocks at the end of the style sheet. - eof-005 (invalid)
-
Parsing unexpected end of @import
User agents close all open rules at the end of the style sheet. - eof-006 (invalid)
-
Parsing unexpected end of @import with closed quote
User agents close all open quotes at the end of the style sheet. - eof-007 (invalid)
-
Parsing unexpected end of shorthand rule
User agents close all open rules at the end of the style sheet. - font-family-invalid-characters-001 (ahem, invalid)
-
Invalid characters in font-family values
Invalid characters in font family names invalidate entire declaration. - font-family-invalid-characters-002 (ahem, invalid)
-
Invalid parenthesis and pair matching
Invalid characters in font family names. - font-family-invalid-characters-003 (ahem, invalid)
-
Invalid curly brackets and pair matching
Invalid characters in font family names. - font-family-invalid-characters-004 (ahem, invalid)
-
Invalid square brackets and pair matching
Invalid characters in font family names. - font-family-invalid-characters-005 (ahem, invalid)
-
Invalid quotes and pair matching
Invalid characters in font family names. - font-family-invalid-characters-006 (ahem, invalid)
-
Invalid single quotes and pair matching
Invalid characters in font family names. - invalid-at-rule-001 (invalid)
-
Parser error handling with invalid at-rules: @ invalid selector invalidates entire block
The entire block of an invalid at-rule is ignored. - invalid-decl-at-rule-001 (invalid)
-
Parsing invalid declarations in at-rules where valid declaration precedes an invalid rule
Invalid declarations at the end of at-rules are ignored while the remaining preceding valid declarations are applied. - invalid-decl-at-rule-002 (invalid)
-
Parsing invalid declarations in at-rules where valid declaration follows invalid rule
Invalid declarations at the beginning of at-rules are ignored while the remaining following valid declarations are applied. - malformed-decl-001 (invalid)
-
Parsing malformed rules: Property with no value and no ending semicolon
Malformed rules (property with no value and no ending semicolon) are ignored while valid rules are applied. - malformed-decl-002 (invalid)
-
Parsing malformed rules: Property with no value assigned
Malformed rules (property with no value) are ignored while valid ones are applied. - malformed-decl-003 (invalid)
-
Parsing malformed rules: No value and no semi-colon
Malformed rules with no value or semi-colon are ignored while valid rules are applied. - malformed-decl-004 (invalid)
-
Parsing malformed rules: No value with property
Malformed rules with no value are ignored while valid rules are applied. - malformed-decl-005 (invalid)
-
Parsing malformed rules: Semi-colon before property
Malformed rules with semi-colon before property are ignored while valid rules are applied. - malformed-decl-006 (invalid)
-
Parsing malformed rules: Valid rule after malformed rule
Malformed rules are ignored while valid rules are applied. - malformed-decl-007 (invalid)
-
Parsing malformed rules: Double colon separating property and value
Malformed rules with double colons between property and value are ignored while valid rules are applied. - malformed-decl-008 (invalid)
-
Parsing malformed rules: Missing property
Malformed rules with missing property names are ignored while valid rules are applied. - matching-brackets-001 (invalid)
-
Matching brackets and quotes for @rules
User agents must handle unexpected tokens encountered while parsing an at-rule by reading until the end of the statement, while observing the rules for matching pairs of brackets and quotes, and correctly handling escapes. - matching-brackets-002 (invalid)
-
Matching brackets and quotes for declarations
User agents must handle unexpected tokens encountered while parsing a declaration by reading until the end of the statement, while observing the rules for matching pairs of brackets and quotes, and correctly handling escapes. - matching-brackets-003 (invalid)
-
Matching brackets and quotes for selectors
User agents must handle unexpected tokens encountered while parsing a declaration by reading until the end of the statement, while observing the rules for matching pairs of brackets and quotes, and correctly handling escapes. - position-006
-
Parsing 'position'
- selectors-parsing-001
-
CSS: Selector Parsing and Invalid Pseudo-Elements
- unterminated-string-001 (font, invalid)
-
Error handling of unterminated strings
When the parser encounters an unterminated string, the parser drops everything up to the next ';'. - uri-013 (invalid)
-
handling of invalid url() functions
- uri-017 (image, invalid)
-
Unclosed URI Token at EOF (in declaration)
User agents must close open URI constructs and style rules at the end of the style sheet. - uri-018 (image, invalid)
-
Unclosed URI Token at EOF (in @import)
User agents must close open URI constructs and statements at the end of the style sheet. - z-index-015 (invalid)
-
z-index - integer value
Besides 'auto' and 'inherit' keyword values, z-index property can only accept an integer value. An integer consists of one or more digits '0' to '9'. - z-index-016 (invalid)
-
z-index - integer value
Besides 'auto' and 'inherit' keyword values, z-index property can only accept an integer value. An integer consists of one or more digits '0' to '9'. - z-index-017 (invalid)
-
z-index - integer value
Besides 'auto' and 'inherit' keyword values, z-index property can only accept an integer value. An integer consists of one or more digits '0' to '9'.