W3C home > Mailing lists > Public > public-webapps@w3.org > October to December 2011

Re: QSA, the problem with ":scope", and naming

From: Lachlan Hunt <lachlan.hunt@lachy.id.au>
Date: Thu, 20 Oct 2011 17:01:00 +0200
Message-ID: <4EA037AC.40509@lachy.id.au>
To: Boris Zbarsky <bzbarsky@MIT.EDU>
CC: "Tab Atkins Jr." <jackalmage@gmail.com>, Webapps WG <public-webapps@w3.org>
On 2011-10-20 16:23, Boris Zbarsky wrote:
> On 10/20/11 1:08 AM, Tab Atkins Jr. wrote:
>> I disagree. It's extremely useful and natural for .find(":scope +
>> div") to match sibling of the context node.
>
> I really don't think it is. If you want that, use document.find(":scope
> + div", context).
>
>> Basically, the presence of :scope would turn off *all* the limitations
>
> That's a _really_ bizarre behavior. So in this case:
>
> foo.find(":scope + div, div")
>
> what all divs in the document would be found? Or is the "oh, ignore the
> reference node except for matching :scope" meant to only apply on a
> per-selector basis inside the selector list? That has its own issues,
> especially with performance (e.g. merging nodesets while preserving DOM
> order).

As it was specified in the old draft of queryScopedSelector (which is 
the definition I start with if find/findAll get introduced), it was done 
on a per selector basis, so the above would be equivalent to:

document.querySelector(":scope + div, :scope div", foo);

-- 
Lachlan Hunt - Opera Software
http://lachy.id.au/
http://www.opera.com/
Received on Thursday, 20 October 2011 15:01:34 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:48 GMT