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

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

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Thu, 20 Oct 2011 17:43:00 -0400
Message-ID: <4EA095E4.9090403@mit.edu>
To: "Tab Atkins Jr." <jackalmage@gmail.com>
CC: Ojan Vafai <ojan@chromium.org>, Jonas Sicking <jonas@sicking.cc>, Alex Russell <slightlyoff@google.com>, Webapps WG <public-webapps@w3.org>, Yehuda Katz <wycats@gmail.com>, John Resig <jeresig@gmail.com>, Paul Irish <paulirish@google.com>, Lachlan Hunt <lachlan.hunt@lachy.id.au>
On 10/20/11 5:15 PM, Tab Atkins Jr. wrote:
> If they *all* carry :scope, then you can just run them all over the
> whole tree and get the ordered set in the normal fashion.

You can just prepend :scope to the ones missing it and run them over the 
whole tree too.

But that means that now you're doing work proportional to the size of 
your whole DOM, not the subtree rooted at the context element, which is 
a pretty big difference.

>> And worse yet, the current :scope proposals allow an arbitrary nodeset to be
>> specified as matching :scope, at which point this whole thing is out the
>> window.
> QSA allows that (or plans to?).  Alex's find() proposal does not.  The
> scoping element is solely the 'this' in .find.

I was assuming we were discussing find() in preference to the QSA 
extensions.  Maybe I was confused?

> It was good enough for jQuery in the pre-QSA days, and it's still good
> enough for jQuery now when it can't use QSA, I don't see why it's not
> good enough for the rest of us.

jQuery takes some shortcuts we can't take (note the getElementById 
comments elsewhere in this thread).

Maybe it'll be ok.  Maybe not.  I'd rather not paint ourselves into the 
"not" corner if we can avoid it....

Received on Thursday, 20 October 2011 21:43:43 UTC

This archive was generated by hypermail 2.3.1 : Friday, 27 October 2017 07:26:36 UTC