Accesskey n skips to in-page navigation. Skip to the content start.

s_gotoW3cHome Internationalization
 

Test results: Selector normalization

These tests check whether user agents normalize away the differences between selector names and class names, and multiple selector names in the same CSS file.

Note that although normalization makes sense, current CSS specifications do NOT require selectors and class names to be normalized prior to matching.

Normalization is important for many languages, where users using different tools can produce the same text but with different mixtures of precomposed, decomposed and partially composed characters. It is particularly an issue if different people author the CSS and the document content. For example, some Vietnamese input methods produce NFC output, but Microsoft keyboards under XP produce unnormalized output where tone marks are separate combining characters but diacritics that differentiate letters are composed with their base character.

In what follows, 'HTML' means HTML4.01, HTML5 or XHTML 1.0 served as text/html. XML means XHTML 1.0, XHTML5 or XHTML 1.1 served as application/xhtml+xml.

Summary & conclusions

See the results below for user agents tested. This section summarizes the results of those tests.

No user agents tested support any of the following:

  1. matching of selector names with class names when the names are not normalized to the same strings
  2. matching of selector names with other selector names in the same CSS file when the names are not normalized to the same strings
  3. normalization of class names during conversion of legacy encodings.

This is likely to pose significant problems for people using CSS internationally if content is not produced in normalized form. This is likely to pose special problems for people who don't know about normalization forms (and shouldn't have to know). As mentioned above, this is most likely problematic when different people are responsible for creating the CSS and the markup.

Latest results

These are results for the latest versions of each user agent tested. A green background (yes) means that the assertion associated with the test held true; red (no) means that it did not; orange (partially) means that it was only partially true.

For most browsers, fives types of document format were tested: H4 (HTML 4.01), H5 (HTML5), XH (XHTML 1.0 served as text/html), X (XHTML 1.0 served as XML), X5 (XHTML5), and X11 (XHTML 1.1, served as XML), but since all results were the same for the browsers tested, a single cell is used to represent all five test instances. The exception is Internet Explorer, which doesn't handle XML files, so only the HTML formats were tested.

Tests 1 and 2 are really just control tests. They are expected to always match, because the bytes sequences are identical in selector and class names. The real test begins with test 3.

Control tests

UA IE IE Firefox Opera Safari Chrome
version 8 7 3.6.3 10.53 4.0.5 4.1.249.1064
OS XP XP XP XP XP XP
date 20100512 20100512 20100512 20100512 20100512 20100512
markup precomposed, CSS precomposedA fully precomposed class name will match a fully precomposed CSS selector name. yes yes yes yes yes yes
markup decomposed, CSS decomposedA fully decomposed class name will match a fully decomposed CSS selector name. yes yes yes yes yes yes

Assertion:  

Matching selector to class name

UA IE IE Firefox Opera Safari Chrome
version 8 7 3.6.3 10.53 4.0.5 4.1.249.1064
OS XP XP XP XP XP XP
date 20100512 20100512 20100512 20100512 20100512 20100512
markup decomposed, CSS precomposedA fully decomposed class name will NOT match a fully precomposed CSS selector name. yes yes yes yes yes yes
markup precomposed, CSS decomposedA fully precomposed class name will NOT match a fully decomposed CSS selector name. yes yes yes yes yes yes
markup partially decomposed, CSS precomposedA partially decomposed class name will NOT match a fully precomposed CSS selector name. yes yes yes yes yes yes
markup partially decomposed, CSS decomposedA partially decomposed class name will NOT match a fully decomposed CSS selector name. yes yes yes yes yes yes
markup precomposed, CSS partially decomposedA partially decomposed CSS selector name will NOT match a fully precomposed class name. yes yes yes yes yes yes
markup decomposed, CSS partially decomposedA partially decomposed CSS selector name will NOT match a fully decomposed class name. yes yes yes yes yes yes

Assertion:  

Matching selector to selector

UA IE IE Firefox Opera Safari Chrome
version 8 7 3.6.3 10.53 4.0.5 4.1.249.1064
OS XP XP XP XP XP XP
date 20100512 20100512 20100512 20100512 20100512 20100512
selectors with different normalizationSelectors that only differ due to normalization should be treated as different. yes yes yes yes yes yes

Assertion:  

Normalization during transcoding

UA IE IE Firefox Opera Safari Chrome
version 8 7 3.6.3 10.53 4.0.5 4.1.249.1064
OS XP XP XP XP XP XP
date 20100512 20100512 20100512 20100512 20100512 20100512
normalization during transcoding[Exploratory test] Text is not normalized during transcoding when the style sheet is in another encoding. n/a1 n/a1 n/a1 yes yes yes

Assertion:  

Notes:

  1. No box was highlighted. It's not clear why.

Tell us what you think (English).

Subscribe to an RSS feed.

New resources

Home page news

Twitter (Home page news)

@webi18n

Further reading

Author: Richard Ishida, W3C.

Valid XHTML 1.0!
Valid CSS!
Encoded in UTF-8!

Content first published 2009-01-29. Last substantive update 2010-05-13 13:27 GMT. This version 2010-05-13 13:27 GMT

For the history of document changes, search for results-selector-normalization in the i18n blog.