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

On Mon, Nov 21, 2011 at 11:34 AM, Boris Zbarsky <bzbarsky@mit.edu> wrote:
> The sticking point here is obviously item #2.  Data needed on use of
> "matches" and "is" as barewords in on* attributes, specifically.

I don't follow.  matchesSelector is on Element, not Node, right?  Why
is it relevant to on* attributes?  The lookup chain is first document
then window, with no elements anywhere, right?  Or am I
misunderstanding you?  I see why new proposed methods on Node like
.prepend could be an issue (although we could leave most of those off
Document too, as noted).

If this is a recurring problem, could we consider implementing magic
so that new methods on Document (or Node) that might cause problems
are ignored in on* unless you prefix with "document."?  So generally a
bare name will check for variables on the document first and then the
window, but for the magic blacklist ("matches", "is", whatever causes
problems) it will only check the window.  Obviously this is not a
great solution -- but I'd really hate us to lose out on the ideal
names for common methods just because of a tiny number of sites using
on*.

It's possible that I'm just completely not understanding what you mean
here, though.

Received on Tuesday, 22 November 2011 01:32:31 UTC