CSS2.1 Conformance Test Suite

Chapter 4 - Syntax and basic data types (263 tests)

Test Flags
4 Syntax and basic data types
Parsing counter functions with just the identifier
Counters can be referred to using only the identifier.
Parsing invalid counter functions - Too many arguments invalid
A counter is invalid if it has too many arguments.
Attribute selectors and underscores
Attribute selectors can begin with underscores.
Attribute selectors with hyphens and underscores
Attribute selectors are valid if they begin with hyphens and then underscores.
Attribute selection with digits invalid
Attribute selectors cannot begin with digits.
Attribute selectors starting with hyphens and digits invalid
Attribute selectors cannot begin with hyphens then digits.
Selector attributes and hyphens
Selector attributes can begin with hyphens.
4.1 Syntax
4.1.1 Tokenization
4.1.2 Keywords
Parsing single quoted property keywords invalid
Rules with property keywords which are surrounded by single quotes are ignored.
Parsing double quoted value keywords invalid
Rules with value keywords which are surrounded by double quotes are ignored.
Keywords v. Strings (background)
Keywords v. Strings (width)
4.1.2.1 Vendor-specific extensions
4.1.2.2 Informative Historical Notes
4.1.3 Characters and case
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 invalid
Browsers should be able to ignore the keyword
Unicode-escaped Braces invalid
Unicode escapes cannot substitute for '{' or '}' in CSS syntax.
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.1.4 Statements
4.1.5 At-rules
At-rules
At-rules
At-rules
At-rules
At-rules
At-rules
At-rules
At-rules
At-rules
At-rules
4.1.6 Blocks
Parsing nested blocks and strings in style blocks invalid
Blocks and strings are parsed with matching terminating pairs.
Empty declaration block
Declaration blocks that are empty have no effect on later declarations.
Parsing square bracket blocks invalid
Blocks and strings are parsed with matching terminating pairs of square brackets.
Parsing curly bracket blocks invalid
Blocks and strings are parsed with matching terminating pairs of curly brackets.
Parsing parentheses blocks invalid
Blocks and strings are parsed with matching terminating pairs of parentheses.
Parsing blocks and strings in style blocks invalid
Nested blocks and strings are parsed accordingly.
4.1.7 Rule sets, declaration blocks, and selectors
4.1.8 Declarations and properties
Parsing white space in style declaration
Various white space are allowed anywhere within the declaration and are ignored.
Parsing invalid rules that precede good rules invalid
Bad rules are ignored while good rules are applied.
Parsing invalid rules that follow good rules invalid
Bad rules are ignored while good rules are applied.
Parsing invalid values invalid
Invalid values are ignored while valid values are applied.
Parsing invalid values with spaces invalid
Invalid values are ignored while valid values are applied.
Parsing invalid values that start with a valid value name invalid
Invalid values are ignored while valid values are applied.
Parsing invalid values with slashes invalid
Invalid values are ignored while valid values are applied.
Parsing invalid values that are functions invalid
Invalid values are ignored while valid values are applied.
4.1.9 Comments
Parsing comments within style tag
Comments are allowed anywhere within a style tag declaration and are ignored.
Nested comments invalid
Comments cannot be nested.
HTML comments and CSS comments invalid
SGML comment delimiters do not delimit CSS comments.
Parsing of invalid nested comments invalid
Comments cannot be nested.
Parsing of escaped "/" within a valid comment invalid
A slash '/' escaped with a backslash will remove its special meaning.
Parsing of escaped "*" within a valid comment invalid
A star '*' escaped with a backslash will remove its special meaning.
Parsing of valid comment that is empty invalid
Empty comments do not affect parsing of rule.
Parsing of escaped opening comment invalid
Escaping a slash '/' for an opening comment makes the comment invalid.
Parsing of invalid escaped "*" in open comment invalid
Escaping a star '*' for an opening comment makes the comment invalid.
Parsing HTML comments
HTML comment tokens are parsed and ignored.
SGML comments
UAs must ignore SGML comment delimiters between statements.
Basic Containment
Comments
Comments
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.3 Values
4.3.1 Integers and real numbers
4.3.2 Lengths
text-indent
padding-top
padding-left AG
padding AG
Length Units AG
Length Units
Length Units
4.3.3 Percentages
Percentage Units AG
4.3.4 URLs and URIs
Basic Containment
URLs G
4.3.5 Counters
dynamic changes to 'counter-increment' O
dynamic changes to 'counter-increment' O
dynamic changes to 'counter-increment' O
dynamic changes to 'counter-increment' O
content: counter(c)
content: counter(c, none)
content: counter(c, disc)
content: counter(c, circle)
content: counter(c, square)
content: counter(c, decimal)
content: counter(c, decimal-leading-zero)
content: counter(c, lower-roman)
content: counter(c, upper-roman)
content: counter(c, georgian)
content: counter(c, armenian)
content: counter(c, lower-latin)
content: counter(c, lower-alpha)
content: counter(c, upper-latin)
content: counter(c, upper-alpha)
content: counter(c, lower-greek)
content: counter() error cases invalid
content: counters(c, ".")
content: counters(c, ".", none)
content: counters(c, ".", disc)
content: counters(c, ".", circle)
content: counters(c, ".", square)
content: counters(c, ".", decimal)
content: counters(c, ".", decimal-leading-zero)
content: counters(c, ".", lower-roman)
content: counters(c, ".", upper-roman)
content: counters(c, ".", georgian)
content: counters(c, ".", armenian)
content: counters(c, ".", lower-latin)
content: counters(c, ".", lower-alpha)
content: counters(c, ".", upper-latin)
content: counters(c, ".", upper-alpha)
content: counters(c, ".", lower-greek)
content: counters() string argument
content: counters() string argument
content: counters() error cases invalid
dynamic changes to 'counter-increment' O
dynamic changes to 'counter-increment' O
Counter properties on 'content: none' pseudo-elements
Counter properties on 'display: none' elements
Counter properties on 'visibility: hidden' elements
Multiple resets for same counter
Multiple increments and resets
Order of 'counter-reset', 'counter-increment', and counter use, including pseudo-elements
Order of counters in out-of-flow content
counters on the root element
Counter scope
Counter scope and nesting on elements
Counter scope and nesting on :before
Counter scope and nesting on :after
Counter scope and nesting
Implied counter scopes with no 'counter-increment' or 'counter-reset'
Implied counter scopes by counter use
Implied counter scopes by 'counter-increment'
4.3.6 Colors
Parsing rgb color values with white space
White space is allowed in the color rgb declaration.
Parsing invalid hexadecimal RGB units - white space in hexadecimal values invalid
White space is not allowed in a hexadecimal color assignment.
Parsing invalid RGB functional notation - two values invalid
A RGB value is invalid if it has only two values.
Parsing invalid RGB functional notation - Percentages and Numbers invalid
An RGB value is invalid if it has both percentages and number assignments.
Clipping of RGB color values
Values outside the device gamut are clipped: the red, green, and blue values are changed to fall within the range supported by the device.
Comparing color keywords and hex values
Color matching of keywords and hex values.
RGB color syntax error handling invalid
Color Units AG
4.3.7 Strings
Parsing strings with escaped newlines
Strings with escaped newlines are treated as a single whole string.
Parsing of escaped single quotes
Escaped single quotes are allowed in strings and are parsed correctly.
Parsing of escaped double quotes
Escaped double quotes are allowed in strings and are parsed correctly.
Parsing of escaped quotes (single within single)
Single quotes cannot occur inside single quotes unless escaped.
Newlines in strings
4.3.8 Unsupported Values
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.
4.4.1 Referring to characters not represented in a character encoding