Re: Opera's Proposal for :context Selector

Lachlan Hunt wrote:
>
> Bert Bos wrote:
>> (It seems to me you shouldn't need it at all. The problem seems to be 
>> that x.querySelector(":root") doesn't return x. That looks strange to 
>> me: you pass a tree and a pattern, and you get something outside the 
>> tree!? But I'm not an expert on that spec...)
>
> The API doesn't change the way in which an element is evaluated 
> against a selector; it's still evaluated in the context of the entire 
> document.  All it does is limit the collection of elements that are 
> evaluated against it.
>
Lachlan, do you have any particular use cases for such a behavior? At 
last: who requested such querySelector(), where that demand came from?

In the way you define this function it should be a method of the only 
document object:

   document.querySelector(selector [, scopeElement ])

That at least would be fair.
Anyway I've never seen this was requested anywhere but that's only me.

--
Andrew Fedoniouk.

http://terrainformatica.com

Received on Wednesday, 16 July 2008 22:18:13 UTC