Re: Opera's Proposal for :context Selector

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 
public-webapi.

http://lists.w3.org/Archives/Public/public-webapi/2008May/0057.html
http://lists.w3.org/Archives/Public/public-webapi/2008May/0058.html

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.

http://www.w3.org/Bugs/Public/show_bug.cgi?id=5860

-- 
Lachlan Hunt - Opera Software
http://lachy.id.au/
http://www.opera.com/

Received on Sunday, 13 July 2008 21:42:37 UTC