CSS is too loose

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:

  1. 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 @profile media rule to help browsers with choosing a grammar to follow, but my proposal was rejected.
  2. 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.
  3. 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).
  4. 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.
  5. 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.

This entry was posted in by Gabriele Romanato. Bookmark the permalink.

One thought on “CSS is too loose”

Leave a Reply

Note: Only a member of this blog may post a comment.