I've been testing CSS for quite a lot during these years, giving significant tests to the W3C test suite. My conclusions are summarized in this sentence: nowadays CSS is too loose. Here are some critical issues that need to be solved:
- there are no rules to detect the CSS version you're using. CSS3 introduced the '::' syntax to tokenize a pseudo-element. Browsers that support the CSS3 syntax follow both grammars (CSS 2.1 and 3), even if a stylesheet contains mixed rules.
I proposed the
@profilemedia rule to help browsers with choosing a grammar to follow, but my proposal was rejected.
- CSS quotes are still a mistery. Some browsers apply a rule even when there's an occurrence of multiple nested quotes, such as in
url("'foo.gif'")and in other CSS functions.
- CSS generated counters are still buggy in some particular cases of nested scopes and conflict between pseudo-elements in a given scope (see this test in Opera for example).
- cascading, specificity and DOM scripting: this is another area for testing, but the current view of many implementors is that this kind of tests should be avoided.
- the ';' is optional when a rule contains only a declaration. Better if it was always mandatory, just like some programming languages.
In my opinion, CSS should be more restrictive in their form. By doing so, we actually reduce the likelihood of inconsistencies.