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

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

-Boris

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