W3C home > Mailing lists > Public > www-svg@w3.org > January 2005

Re: DOM Level 3 events

From: Peter Sorotokin <psorotok@adobe.com>
Date: Tue, 18 Jan 2005 11:29:27 -0800
To: Boris Zbarsky <bzbarsky@MIT.EDU>, Jon Ferraiolo <jon.ferraiolo@adobe.com>
Cc: Cameron McCormack <cam-www-svg@aka.mcc.id.au>, www-svg@w3.org
Message-id: <5.2.0.9.2.20050118110934.04d3d480@mailsj-v1.corp.adobe.com>

At 10:58 AM 1/18/2005 -0600, Boris Zbarsky wrote:

>Jon Ferraiolo wrote:
>>However, you can register an event listener using either name. Your 
>>handler will get invoked no matter whether you listen to the "error" 
>>event or the "SVGError" event. I would assume that, when your handler 
>>receives the event object, the event name would match the name of the 
>>event to which your event listener was listening. Thus, if you listened 
>>for "SVGError", the event type on the event object would be "SVGError".
>
>I'm not quite sure how this works...  It seems we're trying to maintain 
>the following invariants here:
>
>1)  The sme event object is passed to all the listeners involved
>2)  The "type" is a property of the event object
>3)  Different listeners see different types
>
>So is the type supposed to by changed during event dispatch, then changed 
>back?  This suggestion makes it impossible to simply alias the two event 
>types to each other in the event implementation in the UA,

Surely it is possible. Implementation can temporarily override "public" 
event type to the type before calling the listeners of that type. The only 
drawback is that is if a listener holds an event beyond the duration of the 
handleEvent call, it might see aliased type; but such listener is already 
asking for trouble.

Peter

>  which would be the most natural way of implementing two different names 
> for the same event...
>
>-Boris
Received on Tuesday, 18 January 2005 19:29:36 GMT

This archive was generated by hypermail 2.3.1 : Friday, 8 March 2013 15:54:29 GMT