[css-selectors] Invalid selectors should not cause the entire group to be dropped

The Selectors (Level 3) module defines[1] that a single invalid selector in
a group is enough to drop the entire rule. While this was fine before, I
believe this behavior should be revised: invalid selectors should not
invalidate the entire selector-group anymore. Instead, they could be changed
to ":not(*)", similarly to Media Queries[2] which changes invalid queries to
"not all".

My two primary rationales are both related to vendor-prefixed
pseudo-elements and pseudo-classes:

   1) In May, Daniel Glazman pleaded for[3] Microsoft, Opera and
Apple/Google to add a vendor prefix to the ::selection pseudo-element. Anne
van Kesteren pointed out[4] the exact problem I'd like to address: a
separate rule would be needed for each of the selectors.

   2) While this became clear with ::selection, it's becoming more evident
with element-specific styling with, for example, <progress>, <meter> and the
controls of <video> elements. WebKit currently defines 51 of such
pseudo-elements[5]. While they allow more flexible styling of complex
elements, dropping entire rules due to a single invalid selector seriously
stands in the way for any kind of (steps towards) interoperability on this
subject.

Having to include multiple, identical rules for supporting several browsers
makes CSS code harder to maintain, mostly due to duplicated code.
Since Selectors L3 is already a Proposed Recommendation, it seems sane to
discuss this in scope of the Level 4 module.

Kind regards,
Peter Beverloo

[1] http://www.w3.org/TR/css3-selectors/#grouping
[2] http://www.w3.org/TR/css3-mediaqueries/#error-handling
[3] http://lists.w3.org/Archives/Public/www-style/2010May/0250.html
[4] http://lists.w3.org/Archives/Public/www-style/2010May/0313.html
[5] http://peter.sh/files/webkit-vp-selectors.txt

Received on Monday, 15 November 2010 10:02:36 UTC