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: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Mon, 21 Nov 2011 22:02:17 -0500
Message-ID: <4ECB10B9.80902@mit.edu>
To: Aryeh Gregor <ayg@aryeh.name>
CC: public-webapps@w3.org
On 11/21/11 8:31 PM, Aryeh Gregor wrote:
> The lookup chain is first document
> then window, with no elements anywhere, right?

The lookup order is the element the on* attribute is on, then the 
element's form if it's a form control (more or less; details are in the 
spec), then the document, then the window.  There are also some 
additional complications in terms of time-invariance of the lookup 
chain, etc, which most browsers agree on but a few do not.

> If this is a recurring problem

It is.

> 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."?

We could consider it; it would require that what goes on the scope chain 
of on* even handlers is some sort of proxy instead of the actual 
element/form/document/etc, I think...  That might work, though.  Would 
somewhat hurt performance for whatever code is inside the on* attribute 
itself (not including functions it calls), but that's usually not that 
much code, and already has a certain amount of overhead for the C++ to 
JS transition.  Maybe this is the way to go.

Received on Tuesday, 22 November 2011 03:02:50 UTC

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