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: Sun, 13 Jul 2008 23:41:54 +0200
Message-ID: <487A76A2.2090501@lachy.id.au>
To: fantasai <fantasai.lists@inkedblade.net>
Cc: www-style <www-style@w3.org>

fantasai wrote:
> 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?

I did a full analysis of that and other possible solutions previously on 


The solution discussed in that second email is being considered for 
Selectors API 2, where a new method would be introduced that performs a 
pre-parse on the group of selectors, appends :context to the beginning 
of each selector and then parses as normal.  This will provide implicit 
scoping and basically standardise the defacto standard of many JS 
libraries, but the explicit :context gives a little more flexibility. 
So both would be useful.

This is the feature request bug I have for tracking that proposal.


Lachlan Hunt - Opera Software
Received on Sunday, 13 July 2008 21:42:37 UTC

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