W3C home > Mailing lists > Public > www-dom@w3.org > April to June 2011

Re: Functions that Implement the EventListener Interface (DOM Level 3 Events)

From: Cameron McCormack <cam@mcc.id.au>
Date: Tue, 14 Jun 2011 12:41:24 +1200
To: Rob Brackett <rbrackett@apple.com>
Cc: www-dom@w3.org
Message-ID: <20110614004123.GE8392@wok.mcc.id.au>
Hi Rob.

Rob Brackett:
> For what it's worth, I think WebKit's current behavior is preferable
> (in my case, myConstructor.handleEvent() would have been called
> instead of myConstructor()), though it is different from how Firefox,
> Opera, and Chrome behave (myConstructor() would be called instead of
> myConstructor.handleEvent()). At the very least, it would be nice the
> get the wording here more clear.

Web IDL defines that for interfaces with [Callback] on them, such as
EventListener [1][2], that the function itself takes precedence over the
property [3].

[1] http://www.w3.org/TR/DOM-Level-3-Events/#webidl-events-EventListener
[2] http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#eventlistener
[3] http://dev.w3.org/2006/webapi/WebIDL/#native-objects

Cameron McCormack ≝ http://mcc.id.au/
Received on Tuesday, 14 June 2011 00:41:52 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 20 October 2015 10:46:17 UTC