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

Re: Enhancing grouping of selectors

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Fri, 17 Sep 2010 15:18:59 -0700
Message-ID: <AANLkTingAGiQbbve_SVo6D_bahZfsJPsinyYehE2Z5NS@mail.gmail.com>
To: Paul Duffin <pduffin@volantis.com>
Cc: "L. David Baron" <dbaron@dbaron.org>, Matthew Millar <mattmill30@hotmail.com>, www-style@w3.org
On Fri, Sep 17, 2010 at 3:09 PM, Paul Duffin <pduffin@volantis.com> wrote:
> What about the specificity issue?
>
> If it is supposed to behave as the exploded version then that will make it harder to implement efficiently but doing it any other way will mean that it is not exactly equivalent to the exploded version.
>
> e.g.
> :any (e #id .class) :any (e #id .class) :any (e #id .class) {...}
>
> Would explode to 27 rules with specificities ranging from 003 to 300.
>
> So I guess the question is, is this intended as a shorthand for authors or an optimization?

Shorthand for authors, though it can also function as an optimization.
 dbaron just punted on the specificity issue and treated it as an
ordinary pseudoclass, so those 3 rules would generate a selector with
specificity 030.

(Note, though, that you wrote the selector wrong.  :any()'s arguments
are comma-separated, because you can have arbitrary selectors as
arguments.  So it needs to be:

:any(e, #id, .class) :any(e, #id, .class) :any(e, #id, .class) {...}

)

I think the sanest solution is to use the min or max specifity of the
contained argument, so either 003 or 300.  Probably the latter.

~TJ
Received on Friday, 17 September 2010 22:19:52 GMT

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