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

Re: Opera's Proposal for :context Selector

From: Andrew Fedoniouk <news@terrainformatica.com>
Date: Mon, 14 Jul 2008 09:55:53 -0700
Message-ID: <487B8519.2030808@terrainformatica.com>
To: Lachlan Hunt <lachlan.hunt@lachy.id.au>
CC: Brad Kemper <brkemper@comcast.net>, www-style <www-style@w3.org>

Lachlan Hunt wrote:
> 
> Brad Kemper wrote:
>> On Jul 13, 2008, at 3:59 PM, Lachlan Hunt wrote:
>>> 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.
> 
> No.  I already clearly explained several times why :root cannot and will 
> not be redefined.
> 
> http://lists.w3.org/Archives/Public/www-style/2008Jul/0197.html
> http://lists.w3.org/Archives/Public/www-style/2008Jul/0203.html
> http://lists.w3.org/Archives/Public/www-style/2008Jul/0221.html
> 

If your goal to implement scoped lookup then your

:context/:scope elements are *mutually exclusive* with the :root.

Either one shall appear in the selector. Appearance of both will
make selector always invalid. With only one obvious exception.

foo.querySelector(":root :scope div")

will simply not work.


So while defining :scope or whatever you shall mention that
1) :root is disabled in that selectors.
2) You shall explain to people that:
    a) ":scope is such a :root"
    b) in scoped style sheets they shall use only ":scope" but
       in ordinary style sheets they shall use only ":root"

So effectively by introducing :scope you are making two versions/ sets 
of the CSS - one set can use only :root another one can use only :scope.


-- 
Andrew Fedoniouk.

http://terrainformatica.com
Received on Monday, 14 July 2008 16:56:34 GMT

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