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

Re: Opera's Proposal for :context Selector

From: Brad Kemper <brkemper@comcast.net>
Date: Sun, 13 Jul 2008 22:31:42 -0700
Cc: Andrew Fedoniouk <news@terrainformatica.com>, www-style <www-style@w3.org>
Message-Id: <8ED91AF4-6A39-456D-B102-2F1BEE30DA32@comcast.net>
To: Lachlan Hunt <lachlan.hunt@lachy.id.au>


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 GMT

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