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: Sun, 13 Jul 2008 14:32:11 -0700
Message-ID: <487A745B.30900@terrainformatica.com>
To: fantasai <fantasai.lists@inkedblade.net>
CC: Lachlan Hunt <lachlan.hunt@lachy.id.au>, www-style <www-style@w3.org>

fantasai wrote:
>>
>> The proposal can be found here:
>>
>> http://lists.w3.org/Archives/Public/www-archive/2008Jul/att-0019/Overview.html 
> 
> 
> Hi Lachlan,
> 
> Have you considered handling these queries by passing an option
> to querySelector that scopes the selector to the context node?
> (Or in the case of HTML5 scoped style, defining a syntax for the
> style element that does the same.) What are the advantages of
> doing this with a pseudo-class instead of that approach?
> 
> ~fantasai
> 

Could elaborate more on what you mean?

Say you want to select immediate child of the scope root element.

<div>
   <div id=scopeRoot>
     <div>
        <div></div>
     </div>
   </div>
</div>

Then you would write is as:

   scopeRoot.selectChild(" > div", scopedLookup = true );

or

   scopeRoot.selectChild(":root > div", scopedLookup = true );

Is this what you mean?


-- 
Andrew Fedoniouk.

http://terrainformatica.com
Received on Sunday, 13 July 2008 21:33:08 GMT

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