4.1.3 Characters and case |
Case insensitivity within selectors, properties and values
- Styles are applied regardless of character case.
|
|
Case sensitive html attributes
- CSS style sheets parts that are not under the control of CSS are case-sensitive.
|
|
Parsing escaped identifiers as selectors, property and value
- Escaped identifiers are parsed and applied.
|
|
Parsing escaped special CSS characters
- Escaped special CSS characters are no longer meaningful.
|
|
Parsing escaped newlines within identifiers
- Newlines cannot be escaped within identifiers.
|
invalid |
Parsing escaped chars in the range of 0-9a-f
- The {unicode} chars are not treated like {escape} chars.
|
invalid |
Parsing escaped characters as selector and property
- Escaped characters are treated as normal characters.
|
|
Parsing escaped identifiers with spaces
- Escaped identifiers are parsed and spaces between them are ignored.
|
|
Termination of escaped character sequences with white space
- Escaped character sequences are terminated by white space.
|
|
Termination of escaped character sequences with six digits
- Escaped character sequences are terminated by exactly six hex digits.
|
|
Termination of escaped character sequences with six digits and white space
- Escaped character sequences are terminated by exactly six hex digits and white space.
|
|
Termination of escaped character sequences with less than 6 digits and white space
- Escaped character sequences are terminated by white space.
|
|
Termination of escaped character sequences with two digits terminated by white space
- Escaped character sequences (two hex digits) are terminated by white space.
|
|
Termination of escaped character sequences with less than six digits terminated by linefeeds and tabs
- Escaped character sequences (less than six hex digits) are terminated by white space, tabs and linefeeds.
|
|
Case-sensitivity of Properties and Keywords (background)
|
|
Case-sensitivity of At-rules (@media)
|
|
Escaped Newline in String
|
|
Escaped Quote Marks in String
|
|
Invalid Punctuation Escapes
|
|
Class and Keyword Letter Escapes
|
|
Unicode Escapes
|
|
Unicode Escapes and Case Insensitivity
|
|
Incorrect Letter Escape (Class Selector)
|
|
Space-terminated Unicode Escapes
|
|
Invalid Space-terminated Character Escapes
|
|
Characters and case: Escaping a character inside a keyword
- Browsers should be able to ignore the keyword
|
invalid |
Unicode-escaped Braces
- Unicode escapes cannot substitute for '{' or '}' in CSS syntax.
|
invalid |
Valid Identifiers (a-z) as Classes and IDs
|
|
Valid Identifiers (-_a-zA-Z0-9) as Classes and IDs
|
|
Valid Identifiers (starting with _) as Classes and IDs
|
|
Valid Identifiers (starting with -) as Classes and IDs
|
|
Valid Identifiers (starting with ideographic) as Classes and IDs
|
|
Valid Identifiers (including ideographic) as Classes and IDs
|
|
Valid Identifiers (starting with escape) as Classes and IDs
|
|
Valid Identifiers (including escape) as Classes and IDs
|
|
Invalid Identifiers (starting with digit) as Classes and IDs
|
invalid |
Valid Identifiers (including digits) as Classes and IDs
|
|
Valid Identifiers (starting with escape) as Classes and IDs
|
|
Valid Identifiers (including escapes) as Classes and IDs
|
|
Valid Identifiers (starting with escaped digits, control codes) as Classes and IDs
|
|
Valid Identifiers (starting with escaped -) as Classes and IDs
|
|
4.2 Rules for handling parsing errors |
Parsing unexpected end of declaration block
- The parser implicitly terminates the block and applies the styles if the declaration block is not terminated.
|
invalid |
Parsing unexpected end of function
- User agents close all open parentheses at the end of the style sheet.
|
invalid |
Parser error handling with invalid at-rules: @ invalid selector
- At-Rules start with an at-keyword (@ followed immediately by an identifier).
|
invalid |
Parsing of invalid @rules
- An at-rule consists of everything up to and including the next semi-colon or the next block.
|
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.
|
invalid |
@import inside block
- @import is ignored if inside a block.
|
invalid |
@import following @charset
- @import is ignored if inside a block or after any valid statement except @charset.
|
invalid |
@import following valid statements
- @import is ignored if after any valid statement except @charset.
|
invalid |
@import following an invalid statement
- @import is ignored if inside a block or after any valid statement except @charset.
|
invalid |
@import following a bad @rule
- @import is ignored after invalid @rule.
|
invalid |
@import after a bad selector and rule block
- @import is not ignored if after bad selector.
|
invalid |
@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
- At-Rules are ignored if they start with an at-keyword (@ followed immediately by an identifier).
|
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).
|
invalid |
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 two 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 three 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 two function values.
|
|
Parsing counters() function with white space and two function values
- The counters function can be parsed with white space separating the two function values.
|
|
Parsing counters() function with white space and three function values
- The counters function can be parsed with white space separating the three 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 string
- Close all open strings at the end of the style sheet.
|
invalid |
Parsing unexpected end of @media block
- User agents close all open blocks at the end of the style sheet.
|
invalid |
Parsing unexpected end of @import
- User agents close all open rules at the end of the style sheet.
|
invalid |
Parsing unexpected end of @import with closed quote
- User agents close all open quotes at the end of the style sheet.
|
invalid |
Parsing unexpected end of shorthand rule
- User agents close all open rules at the end of the style sheet.
|
invalid |
Parser error handling with invalid at-rules: @ invalid selector invalidates entire block
- The entire block of an invalid at-rule is ignored.
|
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 |
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.
|
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.
|
invalid |
Parsing malformed rules: Property with no value assigned
- Malformed rules (property with no value) are ignored while valid ones are applied.
|
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.
|
invalid |
Parsing malformed rules: No value with property
- Malformed rules with no value are ignored while valid rules are applied.
|
invalid |
Parsing malformed rules: Semi-colon before property
- Malformed rules with semi-colon before property are ignored while valid rules are applied.
|
invalid |
Parsing malformed rules: Valid rule after malformed rule
- Malformed rules are ignored while valid rules are applied.
|
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.
|
invalid |
Parsing malformed rules: Missing property
- Malformed rules with missing property names are ignored while valid rules are applied.
|
invalid |
Error handling of unterminated strings
- When the parser encounters an unterminated string, the parser drops everything up to the next ';'.
|
fontinvalid |
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 |
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'.
|
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'.
|
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'.
|
invalid |
4.3.1 Integers and real numbers |
Parsing invalid numbers - alphanumeric characters
- An integer cannot have alphanumeric characters within it.
|
invalid |
Parsing decimal values - decimal with multiple decimal digits
- A number can be zero or more digits followed by a dot (.) followed by multiple digits.
|
|
Parsing invalid decimal values - alphanumeric characters within number
- An alphanumeric character cannot be within the number value.
|
invalid |
Parsing integer numbers with '+'
- Integers can be preceded by '+'.
|
|
Parsing signed integers
- Positively signed integers are treated the same as non-signed integers.
|
|
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'.
|
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'.
|
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'.
|
invalid |
z-index - negative values
- Integers should range from -2,147,483,648 to 2,147,483,647 according to C Language Specification
|
|
z-index - negative values
- Integers should range from -2,147,483,648 to 2,147,483,647 according to C Language Specification
|
|
4.3.2 Lengths |
Optional unit identifier after 0
- After a zero length, the unit identifier is not necessary.
|
|
Unsupported negative values
- If a negative length value is set on a property that does not allow negative length values, the declaration is ignored.
|
invalid |
Em sizes
- The 'em' unit is equal to the computed value of the 'font-size' property (default) of the element on which it is used.
|
A |
Em size with font-size set to x-large
- The 'em' unit is equal to the computed value of the 'font-size' property (x-large) of the element on which it is used.
|
A |
Em size with the font-size set to px size
- The 'em' unit is equal to the computed value of the 'font-size' property (pixels) of the element on which it is used.
|
A |
Em size with font-size set to inch
- The 'em' unit is equal to the computed value of the 'font-size' property (inches) of the element on which it is used.
|
A |
Em size with font-size set to em
- When 'em' is assigned in the value of the 'font-size' property itself, it uses the font size of the parent element.
|
A |
Em size with font-size set to ex
- The 'em' unit is equal to the computed value of the 'font-size' property (ex) of the element on which it is used.
|
A |
Em size with font-size set to percentage
- The 'em' unit is equal to the computed value of the 'font-size' property of the element on which it is used.
|
A |
Em size with font-size set to 'larger'
- The 'em' unit is equal to the computed value of the 'font-size' property, after resolving the value 'larger', of the element on which it is used.
|
A |
Height of EX
- In the cases where it is impossible or impractical to determine the x-height, a value of 0.5em should be used.
|
A |
Specifying em/ex on the root element
- Units 'em' and 'ex' refer to the initial value of the property when specified on the root element of a document.
|
|
First available font defines the 'ex' unit size
- The 'ex' unit size is defined by the element's first available font.
|
A |
Root element and the 'ex' unit size
- The 'ex' unit refers to the property's initial value when specified on the root element.
|
|
Root element and the 'em' unit size
- The 'em' unit refers to the property's initial value when specified on the root element.
|
|
background-position - ex unit
- ex unit is the 'x-height' of the relevant font. 'em' and 'ex' length values when defining 'font-size' property refer to the computed font size of the parent element.
|
AG |
background-position - ex unit
- ex unit is the 'x-height' of the relevant font. 'em' and 'ex' length values when defining 'font-size' property refer to the computed font size of the parent element.
|
AG |
4.3.4 URLs and URIs |
Parsing valid URIs with white space and no quotes
- A url function is valid if it is 'url(', followed by the URI, followed by ')', even with white space between.
|
|
Parsing URL with an invalid space
- URL functions with invalid spaces are ignored.
|
invalid |
URL with missing closing parenthesis
- Url functions with missing closing parenthesis are ignored.
|
Ginvalid |
URL function with URI that has escaped special chars
- URI escapes are allowed in URL functions.
|
G |
URL function with escaped special chars - single quote
- Single quote characters appearing in an unquoted URI need to be escaped with a backslash so that the resulting URI value is a URI token.
|
G |
Invalid character (*) after URL function values
- Special CSS characters following URL strings invalidate the entire url assignment.
|
Ginvalid |
Invalid character (&) after URL functions values
- Invalid characters following URL strings invalidate the entire url assignment.
|
Ginvalid |
Invalid characters (alpha) before URL function values
- Alpha characters preceding URL strings invalidate the entire url assignment.
|
Ginvalid |
Invalid character (/) before URL functions
- A slash character preceding URL string invalidates the entire url assignment.
|
Ginvalid |
Invalid character (_) before URL functions
- An underscore character preceding URL string invalidates the entire url assignment.
|
Ginvalid |
Invalid character (=) before URL functions
- An equal sign character preceding URL string invalidates the entire url assignment.
|
Ginvalid |
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)
- The stylesheet's encoding is determined by the user set referring document's encoding.
|
I |
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.
|
|
Matching BOM and @charset (utf-8)
- The encoding is correctly interpreted from the matched BOM and @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.
|
|