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

Re: [Selectors API 2] Is matchesSelector stable enough to unprefix in implementations?

From: Yehuda Katz <wycats@gmail.com>
Date: Thu, 24 Nov 2011 13:50:19 -0800
Message-ID: <CAMFeDTUR6Lu-54GcRW98OTCS3=iwg8F9EdY5sGb_Le2tNfDVpA@mail.gmail.com>
To: Boris Zbarsky <bzbarsky@mit.edu>
Cc: Sean Hogan <shogun70@westnet.com.au>, Lachlan Hunt <lachlan.hunt@lachy.id.au>, public-webapps@w3.org
Yehuda Katz
(ph) 718.877.1325

On Thu, Nov 24, 2011 at 9:47 AM, Boris Zbarsky <bzbarsky@mit.edu> wrote:

> On 11/23/11 5:38 PM, Sean Hogan wrote:
>> - If you want to use selectors with :scope implied at the start of each
>> selector in the selector list (as most js libs currently do) then you
>> use find / findAll / matches.
> I'm not sure that for matches() the :scope thing is all that relevant.
> :matches() just returns a boolean for whether the |this| it's invoked on
> matches the selector.  The only reason one would ever use :scope in there
> at all is if one provides an explicit list of reference nodes, right?  In
> particular, the assumption is that the selector passed in would obviously
> be allowed to match ancestor nodes of |this| for parts of it, since
> otherwise there is no point, right?  No one would expect
>  foo.matches("div *");
> to always return false; you would expect it to return true if |foo| has an
> _ancestor_ matching "div".
> Similarly, no one would expect this:
>  foo.matchs(" > div");
> to do much of anything, I would think.  Or am I wrong on that?

To my ignorant eyes, you seem correct.

> Am I just missing something here?
> -Boris
Received on Thursday, 24 November 2011 21:51:16 UTC

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