- From: Brad Kemper <brkemper@comcast.net>
- Date: Sun, 13 Jul 2008 22:31:42 -0700
- To: Lachlan Hunt <lachlan.hunt@lachy.id.au>
- Cc: Andrew Fedoniouk <news@terrainformatica.com>, www-style <www-style@w3.org>
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