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

Re: [css3-selectors] Grouping

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Thu, 25 Feb 2010 17:04:20 -0600
Message-ID: <dd0fbad1002251504m4f2a94d1l962784514664dabb@mail.gmail.com>
To: Boris Zbarsky <bzbarsky@mit.edu>
Cc: www-style@w3.org
On Thu, Feb 25, 2010 at 4:58 PM, Boris Zbarsky <bzbarsky@mit.edu> wrote:
> Tab Atkins Jr. <jackalmage@gmail.com> wrote:
>> I've asked for this before, under the :any() pseudoclass.  It works
>> just as you have it - that last rule would be written as ".add
>> :any(#authors,#publications) :any(input,select,textarea)".  It's
>> really a necessity for many cases where you end up with a
>> combinatorial explosion of selectors - this one selector replaces six
>> nearly identical ones.
>>
>> Implementors have agreed that it's basically just syntax sugar, and
>> wouldn't require any special mechanics or cause performance
>> regressions.  It's just not in a draft yet, is all.
>
> At least in Gecko's case, what you wrote above would indeed be more or less
> just syntax sugar.  But this:
>
>  :any(#authors, #publications) div
>
> would probably be faster to match than:
>
>  #authors div, #publications div
>
> In fact, we're looking into implementing this right now (as :-moz-any()) to
> more efficiently deal with the numerous rules of this form that appear in
> our UA stylesheet.

Awesome.  Selectors Level 4, here we come!  ^_^

~TJ
Received on Thursday, 25 February 2010 23:05:13 GMT

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