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: Aryeh Gregor <ayg@aryeh.name>
Date: Mon, 21 Nov 2011 21:00:47 -0500
Message-ID: <CAKA+AxnqmqU9pPKnjT2Y-zT+j1hDhbhU8LK-i+m0=bnwKc9=Eg@mail.gmail.com>
To: "Tab Atkins Jr." <jackalmage@gmail.com>
Cc: Boris Zbarsky <bzbarsky@mit.edu>, public-webapps@w3.org
On Mon, Nov 21, 2011 at 8:54 PM, Tab Atkins Jr. <jackalmage@gmail.com> wrote:
> You're not misunderstanding, but you're wrong.  ^_^  The element
> itself is put in the lookup chain before document.  See this testcase:
>
> <!DOCTYPE html>
> <button onclick="alert(namespaceURI)">foo</button>
>
> (namespaceURI was the first property I could think of that's on
> Element but not Document.)

Awesome.  It seems on* is even more pathological than I realized.  So
definitely, I don't think we want to avoid adding short names to Node
or Element or Document forever just because of this.  If the cost is
making bare name lookup in on* slightly more pathological than it
already is, I don't think that's a big deal.  Authors who want to
preserve their sanity should already be prefixing everything with
"window." or "document." or whatever is appropriate.  Let's add
.matches() and just make it not triggered as a bare name from on*.
Received on Tuesday, 22 November 2011 02:01:46 GMT

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