Re: [SelectorsAPI] Thoughts on querySelectorAll

> 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 UTC