W3C home > Mailing lists > Public > www-style@w3.org > October 2008

Re: Selectors in jQuery

From: fantasai <fantasai.lists@inkedblade.net>
Date: Thu, 09 Oct 2008 11:51:35 -0700
Message-ID: <48EE52B7.2080803@inkedblade.net>
To: John Resig <jresig@mozilla.com>
CC: Daniel Glazman <daniel.glazman@disruptive-innovations.com>, www-style@w3.org

John Resig wrote:
> 
> :not(a#id) - Complex selectors in :not().
> 
> :not(div > p) - Full selectors in :not().
> 
> :not(div, p, a) - Multiple selectors in :not(). In all of these cases they could be treated as a simple set operation. Take the current set of match elements, find the set of elements located within the :not(...) expression, and subtract the two from each other.
> 
> I don't remember if it's made explicitly clear in the CSS spec but we allow :not(:nth-child(2)) (parentheses within parentheses).
> 
> Right now we're looking at making two additions to the selector engine:
> 
>   div > (a, p)
> 
> Allowing for grouping of queries together (the above would be equivalent to: div > a, div > p). It's possible that this might have another syntax, for example :and() as a complement to :not().
> 
>   div > :not(a, p)
>   div > :and(a, p)

This functionality was proposed a long time ago as :matches(),
where :matches() takes a selector and is true if the element
matches that selector.

~fantasai
Received on Thursday, 9 October 2008 18:52:31 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:55:15 GMT