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

Re: Opera's Proposal for :context Selector

From: Lachlan Hunt <lachlan.hunt@lachy.id.au>
Date: Fri, 11 Jul 2008 18:24:46 +0200
Message-ID: <4877894E.1080409@lachy.id.au>
To: Brad Kemper <brkemper@comcast.net>
Cc: www-style <www-style@w3.org>

Brad Kemper wrote:
> Since querySelector() is still experimental, it can still be changed. 
> Could the CSS WG say that in the case of selectors that are used in 
> fragments such as this, that :root refers to the root of the fragment, 
> in this case the element represented by "foo"? So in that case the 
> following should do what you want:
> foo.querySelector(":root div");

I do not understand the where desire to reuse :root for this is coming 
from, nor why introducing a new pseudo-class to address the problem 
instead is in any way bad?

Another problem with redefining :root is that if some browsers ship 
support querySelector with the new handilng of :root, and others with 
the current meaning, then that will create interoperability issues 
because :root will match entirely different elements.

consider this case:

     <div id="foo">


In browsers with support for the redefined :root, that will match the 2 
child div elements.  In browsers with support for :root as currently 
defined, it will not match any of the div elements.

At least with the new pseudo-class, shipping without support means that 
a SYNTAX_ERR will be thrown, which can then be caught and scripts can 
compensate with their own backup processing.

Lachlan Hunt - Opera Software
Received on Friday, 11 July 2008 16:25:24 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:27:38 UTC