W3C home > Mailing lists > Public > public-webapi@w3.org > May 2008

Re: [SelectorsAPI] Thoughts on querySelectorAll

From: Lachlan Hunt <lachlan.hunt@lachy.id.au>
Date: Thu, 01 May 2008 02:12:55 +0200
Message-ID: <48190B07.6020703@lachy.id.au>
To: John Resig <jresig@mozilla.com>
Cc: public-webapi@w3.org

I'll address the rest of the issues in this thread later this week, but 
I just wanted to clarify this one issue now.

John Resig wrote:
> * Combinator-rooted Queries
> 
> I read about some prior discussion concerning this (especially in 
> relation to DOMElement.querySelectorAll-style queries). This is an
> important part of most libraries, as it stands. Maciej's proposed 
> solution of using :root to allow for front-leading combinators is 
> perfectly acceptable to me (where :root is made equivalent to the 
> element, not the document element).
> 
> // jQuery $("#foo").find("> span");
> 
> // DOM document.getElementById("foo").querySelectorAll(":root >
> span")
> 
> This is something that a library can easily detect and inject.

The current plan is to eventually try and introduce a :scope 
pseudo-class for that purpose.  The Selectors spec clearly defines :root 
as matching "the root of the document", and redefining :root for use in 
these APIs alone doesn't seem like a good idea.

-- 
Lachlan Hunt - Opera Software
http://lachy.id.au/
http://www.opera.com/
Received on Thursday, 1 May 2008 00:13:36 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Thursday, 1 May 2008 00:13:37 GMT