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

Re: Remaining Problems with Explicit :scope Switching in find/findAll (was: Re: [Selectors API 2] Is matchesSelector stable enough to unprefix in implementations?)

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Thu, 24 Nov 2011 18:58:27 -0800
Message-ID: <CAAWBYDChWcQKq52-yKAqac5ahy8MpG5hBe-oNjg-1V9+XdagrQ@mail.gmail.com>
To: Yehuda Katz <wycats@gmail.com>
Cc: Lachlan Hunt <lachlan.hunt@lachy.id.au>, Sean Hogan <shogun70@westnet.com.au>, Boris Zbarsky <bzbarsky@mit.edu>, public-webapps@w3.org
On Thu, Nov 24, 2011 at 10:53 AM, Yehuda Katz <wycats@gmail.com> wrote:
>> > * Is :scope always implied if it begins with an explicit combinator
>> > other
>> > than descendant, even if :scope is used elsewhere?
>> >  find(">div :scope");
>> >  find("+div :scope");
>> >  find("~div :scope");
>> Yes.
> I think I would be ok with this case throwing, because all of the cases are
> nonsense queries.

*Those* cases are nonsense.  Use the reference combinator, though, and
it suddenly becomes possibly reasonable.

Alternately, assume that :matches() is eventually changed to allow
complex selectors.  Using :scope there is completely fine.

Rather than trying to carve out some ways that are okay and other ways
that throw, I think it's better to just use the simplest possible
rule: prepend :scope to them and evaluate them as normal.  The
selectors above just won't match anything, is all.

Received on Friday, 25 November 2011 02:59:22 UTC

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