ECMAScript binding for EventListener

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 UTC