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

On Thu, Oct 20, 2011 at 3:39 AM, Alex Russell <slightlyoff@google.com> wrote:
> There's a corner case I haven't formed an opinion on though:
>
>   el.find("div span :scope .whatevs");
>
> ...does what? I think it's an error. ":scope" will need to occur in
> the first term or not at all for .find().

Disagree.  If :scope appears in the selector, just match across the
whole document.  It's simple and useful.  (It's equivalent to
document.querySelector("div span :scope .whatevs", el), except shorter
and amenable to chaining.)

~TJ

Received on Thursday, 20 October 2011 11:41:09 UTC