Ok, since you apparently don't trust my expertise on this, and I care
too much about this project to just let you figure this out when
things start breaking, an analysis of the current solution and why I
think 'goog.events' is superior:

The current solution is actually 3 solutions: the one in
'HTMLElementWrapper', the one in 'EventDispatcher' and finally
'IE8Utils'. The first wraps DOM events, the second is a custom
solution to manage non-DOM events, number 3 combines both approaches.
What if someone want to write a component that extends
HTMLElementWrapper but wants to use a non-DOM event? Wait, that is
what already happens in 'Application'. There you have to override
'addEventListener' (without the JSDoc indicating you did), basically
creating a fourth implementation.

'removeEventListener' is only implemented on instances of
'HTMLElementWrapper' meaning there is no way to remove event listeners
added through the other 3 implementations.

'createEvent' uses 'document.createEvent' and 'document.initEvent',
both which are deprecated by Mozilla [1], not exactly improving the
future-proofness of the current solution. All events are created with
both 'canBubble' and 'cancelable' set to false, without the ability to
change this. The IE8 implementation - using
'document.createEventObject' - is not separated out like other IE8
specific implementations.

The 'IE8Utils.EventMap' is by no means complete. It also uses the 'on'
prefix that is never added to the event type specification anywhere in
the framework. This means all IE8 events fail the 'EventMap' test and
are handled as custom events...

I could go on (trust me?), but I think the above is enough to make my
case and I don't feel like spending a lot of time on this anymore.

TL;DR: there are currently 4 (!) possibly conflicting and certainly
confusing partial implementations of an event handling system. I
suggest we replace this with one thoroughly tested and real world
proofed solution, which I already implemented and is ready to go.

EdB

1: https://developer.mozilla.org/en-US/docs/DOM/document.createEvent



--
Ix Multimedia Software

Jan Luykenstraat 27
3521 VB Utrecht

T. 06-51952295
I. www.ixsoftware.nl

Reply via email to