W3C home > Mailing lists > Public > www-style@w3.org > November 2010

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

From: Peter Beverloo <peter@lvp-media.com>
Date: Mon, 15 Nov 2010 11:02:01 +0100
Message-ID: <AANLkTin8yCFF+Cgsu2WXQx+yzg1oOKvvyZPFExm6dhDN@mail.gmail.com>
To: www-style@w3.org
Cc: daniel.glazman@disruptive-innovations.com, annevk@opera.com
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 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:34 GMT