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

Re: [css3-selectors] Grouping

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Thu, 25 Feb 2010 17:58:20 -0500
Message-ID: <4B87008C.4040601@mit.edu>
To: www-style@w3.org
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.

-Boris
Received on Thursday, 25 February 2010 22:58:55 GMT

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