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

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

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Thu, 20 Oct 2011 04:40:11 -0700
Message-ID: <CAAWBYDAW3Oxxay-HxAK4fk0LbDR3ELXhGe3pgnvNvPehUzHkXQ@mail.gmail.com>
To: Alex Russell <slightlyoff@google.com>
Cc: Lachlan Hunt <lachlan.hunt@lachy.id.au>, Webapps WG <public-webapps@w3.org>, Yehuda Katz <wycats@gmail.com>, John Resig <jeresig@gmail.com>, Paul Irish <paulirish@google.com>
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 GMT

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