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: Wed, 26 Oct 2011 13:51:41 -0700
Message-ID: <CAAWBYDCTkyXNkB+mFHtxKhcmQnEjSiJ91Z-BXP5X2vzZ++ysyA@mail.gmail.com>
To: Jonas Sicking <jonas@sicking.cc>
Cc: Yehuda Katz <wycats@gmail.com>, Lachlan Hunt <lachlan.hunt@lachy.id.au>, Boris Zbarsky <bzbarsky@mit.edu>, Ojan Vafai <ojan@chromium.org>, Alex Russell <slightlyoff@google.com>, Webapps WG <public-webapps@w3.org>, John Resig <jeresig@gmail.com>, Paul Irish <paulirish@google.com>
On Wed, Oct 26, 2011 at 1:47 PM, Jonas Sicking <jonas@sicking.cc> wrote:
> On Tue, Oct 25, 2011 at 10:43 AM, Yehuda Katz <wycats@gmail.com> wrote:
>> e.findAll("div, :scope") // 0,context,1,2,3,4,5,6
> Huh, why 0 and 6? What's the logic there? I would have expected it to
> be a sorted union of the results returned from the individual parts.
> I.e. something like:
> sortedUnion(e.findAll("div"), e.findAll(":scope"))
> Which would yield [context, 1, 2, 3, 4]

Agreed.  Any behavior switch based on the contents of a complex
selector should be limited to that complex selector, rather than
polluting the entire selector list.

>> e.findAll(":not(:scope)") // all elements except context
> What do you mean by "all elements"? All elements in the whole document
> (except the context node). Including the <body> and any siblings it
> might have (and their descendants)?

Yes to both.  It would be identical to giving the context element a
unique id, and then just doing a normal full-document query for

Received on Wednesday, 26 October 2011 20:52:28 UTC

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