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

Re: Opera's Proposal for :context Selector

From: Anne van Kesteren <annevk@opera.com>
Date: Mon, 14 Jul 2008 20:28:41 +0200
To: "Lachlan Hunt" <lachlan.hunt@lachy.id.au>
Cc: www-style <www-style@w3.org>
Message-ID: <op.uean93in64w2qv@annevk-t60.oslo.opera.com>

On Mon, 14 Jul 2008 19:06:51 +0200, Lachlan Hunt  
<lachlan.hunt@lachy.id.au> wrote:
> [...]

FWIW, reading the various arguments here I think re-using :root does make  
some sense. It would be a simple change to the Selectors specification at  
somewhat lower cost than introducing a new pseudo-class. Working together  
with "scoped style sheets" might actually have been a goal with :root, but  
I only recall that from informal conversation and don't have actual  
pointers.

However, re-using :root would mean that you can't select descendants of  
the context element based on specifics of the root element. That is, with  
Lachlan's proposal you can do

   svg:root > g:context > :link

to only select :link children of SVG <g> elements that are directly a  
child of the root SVG <svg> element rather than SVG <g> elements that are  
child of any SVG <svg> element. (SVG documents can contain several <svg>  
elements, one of them being the root element.)

With the proposal from various other people here that would no longer be  
possible, as in that case

   svg:root > g:root > :link

would match nothing, because the context element can't be two elements at  
the same time.

Given the potential that basing Selectors on the root element might become  
more significant in the future, I think Lachlan's proposal is slightly  
better, but I would probably be ok either way.


-- 
Anne van Kesteren
<http://annevankesteren.nl/>
<http://www.opera.com/>
Received on Monday, 14 July 2008 18:29:15 GMT

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