The DOM.eventGet methods can return "undefined" or "NaN" if the event property
is not defined for the given event.  For example, the DOM.eventGetKeyCode
method returns an "undefined" value for mouse events.

I updated all of the DOMImpl.eventGet methods (including the browser specific
subclasses) to return a default value if the event property is undefined.  For
boolean attributes (such as altKey), the default value is "false".  For integer
attributes (such as keyCode) the default value is "-1".  I also created a
static int " Event.UNDEFINED = -1" to abstract the actual return value.

This fix will prevent JavaScript errors when the event property is undefined,
but the return value of the DOM.eventGet methods is still not well defined if
the event property doesn't apply to the event.  For example, IE actually
returns a keyCode with mouse events (the keyCode is the button pressed),
whereas the other browsers return "-1". 

Testing: I manually verified the return value of all DOM.eventGet methods
across all browsers to verify that they return a value if it is defined in the
event, or return '-1' or 'false' if not.

Issue: 1392
Patch by: jlabanca
Review by: jgw



git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@1251 8db76d5a-ed1c-0410-87a9-c151d255dfc7
6 files changed