Re: Opera's Proposal for :context Selector

On Jul 13, 2008, at 3:59 PM, Lachlan Hunt wrote:

> foo.querySelector("div div");
>
> That is not the same as either
>
> foo.querySelector(":context div div")

But wouldn't (or couldn't) that second one be the same as this:

foo.querySelector(":root div div")

Then the first one would include divs that were ancestors and/or  
descendants of the "foo" fragment. If you wanted to capture a pattern  
that included one ancestor of "foo"  div and one descendant  of "foo"   
div, you could write it like this:

foo.querySelector("div :root div")

It seems like a simple and elegant solution to me.

Received on Monday, 14 July 2008 05:32:27 UTC