W3C home > Mailing lists > Public > public-webapi@w3.org > May 2007

ECMAScript binding for EventListener

From: Cameron McCormack <cam@mcc.id.au>
Date: Thu, 3 May 2007 13:35:01 +1000
To: public-webapi@w3.org
Message-ID: <20070503033501.GG25602@arc.mcc.id.au>

Hi.

The SVG WG wants to ensure that the ECMAScript binding for the
EventListener interface (as used by EventTarget.addEventListener) in SVG
Tiny 1.2 is consistent with DOM 3 Events.

Currently DOM 3 Events says:

  Objects that implement the EventTarget interface:
    Functions of objects that implement the EventTarget interface:
      addEventListener(type, listener, useCapture)
        This function has no return value.
	The type parameter is a String.
	The listener parameter is an object that implements the
	EventListener interface.
	The useCapture parameter is a Boolean.
  …
  EventListener function:
    This function has no return value. The parameter is an object that
    implements the Event interface.
   — http://www.w3.org/TR/DOM-Level-3-Events/ecma-script-binding.html

I’m not sure exactly what this means.  There is no description of
“objects that implement the EventListener interface”.

SVG Tiny 1.2’s ES binding appendix currently says:

  Object EventTarget
    The EventTarget object has the following methods:
      addEventListener(type, listener, useCapture)
        This method has no return value. The type parameter is of type
	String. The listener parameter is of type EventListener. The
	useCapture parameter is of type Boolean.
  …
  Function EventListener
    In Ecmascript, EventListener is bound such that it is an Ecmascript
    Function with an additional property handleEvent that points back to
    the EventListener object itself.

    The EventListener object has the following methods:
      handleEvent(evt)
        This method has no return value. The evt parameter is of type
	Event.
  — http://www.w3.org/TR/SVGMobile12/ecmascript-binding.html

Different, and a bit weird.

Could I get a clarification on what the current DOM 3 Events binding is?

Implementations typically support two ways of representing an
EventTarget: either a function with a single argument, or an object with
a 'handleEvent' property that is a function with a single argument.  If
that isn’t what DOM 3 Events currently says, I suggest it be made so.

Thanks,

Cameron

-- 
Cameron McCormack, http://mcc.id.au/
	xmpp:heycam@jabber.org  ▪  ICQ 26955922  ▪  MSN cam@mcc.id.au
Received on Thursday, 3 May 2007 03:35:06 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 8 January 2008 14:18:57 GMT