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

Re: [SelectorsAPI] Thoughts on querySelectorAll

From: John Resig <jresig@mozilla.com>
Date: Wed, 30 Apr 2008 15:46:29 -0700 (PDT)
To: Jonas Sicking <jonas@sicking.cc>
Cc: "L. David Baron" <dbaron@dbaron.org>, public-webapi@w3.org
Message-ID: <25281610.18061209595589822.JavaMail.root@cm-mail02.mozilla.org>


> There are two contrary statements in your proposal.
> 
> ":root" matches the root element (i.e. the "test" element in your
> example)
> 
> All simple selectors has to match a descendant of the element on which
> 
> .querySelectorAll was called.
> 
> Clearly the "test" node isn't a descendant of itself, so the ":root" 
> part couldn't match anything.

That is correct - :root would be overloaded in this case (or simply called something else - like :scope). Isn't this how the combinator-leading selectors were proposed to work?

  // Finding all child, div, elements
  .querySelectorAll(":scope > div")

Looking through the archives it appears as if that's what Maciej proposed. If that's not the case - and the :root/:scope points back to the document root (?) then please disregard all of this, as it's no longer useful.

--John
Received on Wednesday, 30 April 2008 22:47:09 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 30 April 2008 22:47:12 GMT