Bug 675405 part 2. Add some events that we implement that aren't in the spec to the event list, and convert the long lists of event stuff in classinfo to using the canonical event list. r=smaug
authorBoris Zbarsky <bzbarsky@mit.edu>
Sun, 07 Aug 2011 22:27:01 -0400
changeset 73984 28a12583603ba6b8d6dc65662b98c19f7201095c
parent 73983 e2f2476215cd7b5780d66a74d93a57241300b9e8
child 73985 840e9e5c5059b55d70e034d8024f0e493cc705f8
push id20936
push userkhuey@mozilla.com
push dateMon, 08 Aug 2011 12:19:50 +0000
treeherdermozilla-central@9c7ab0a15292 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs675405
milestone8.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 675405 part 2. Add some events that we implement that aren't in the spec to the event list, and convert the long lists of event stuff in classinfo to using the canonical event list. r=smaug
content/events/public/nsEventNameList.h
dom/base/nsDOMClassInfo.cpp
dom/base/nsDOMClassInfo.h
--- a/content/events/public/nsEventNameList.h
+++ b/content/events/public/nsEventNameList.h
@@ -47,41 +47,67 @@
  * no forwarding behavior should be enclosed in the EVENT macro.
  *
  * Event names that are exposed as content attributes on HTML elements
  * and as IDL attributes on Elements, Documents and Windows and are
  * forwarded from <body> and <frameset> to the Window should be
  * enclosed in the FORWARDED_EVENT macro.  If this macro is not
  * defined, it will be defined to be equivalent to EVENT.
  *
+ * Event names that are exposed as IDL attributes on Windows only
+ * should be enclosed in the WINDOW_ONLY_EVENT macro.  If this macro
+ * is not defined, it will be defined to the empty string.
+ *
  * Event names that are exposed as content and IDL attributes on
  * <body> and <frameset>, which forward them to the Window, and are
  * exposed as IDL attributes on the Window should be enclosed in the
  * WINDOW_EVENT macro.  If this macro is not defined, it will be
- * defined to the empty string.
+ * defined to be equivalent to WINDOW_ONLY_EVENT.
+ *
+ * Touch-specific event names should be enclosed in TOUCH_EVENT.  They
+ * are otherwise equivalent to those enclosed in EVENT.  If
+ * TOUCH_EVENT is not defined, it will be defined to the empty string.
  */
 
 #ifdef DEFINED_FORWARDED_EVENT
 #error "Don't define DEFINED_FORWARDED_EVENT"
 #endif /* DEFINED_FORWARDED_EVENT */
 
 #ifndef FORWARDED_EVENT
 #define FORWARDED_EVENT(_name) EVENT(_name)
 #define DEFINED_FORWARDED_EVENT
 #endif /* FORWARDED_EVENT */
 
+#ifdef DEFINED_WINDOW_ONLY_EVENT
+#error "Don't define DEFINED_WINDOW_ONLY_EVENT"
+#endif /* DEFINED_WINDOW_ONLY_EVENT */
+
+#ifndef WINDOW_ONLY_EVENT
+#define WINDOW_ONLY_EVENT(_name)
+#define DEFINED_WINDOW_ONLY_EVENT
+#endif /* WINDOW_ONLY_EVENT */
+
 #ifdef DEFINED_WINDOW_EVENT
 #error "Don't define DEFINED_WINDOW_EVENT"
 #endif /* DEFINED_WINDOW_EVENT */
 
 #ifndef WINDOW_EVENT
-#define WINDOW_EVENT(_name)
+#define WINDOW_EVENT(_name) WINDOW_ONLY_EVENT(_name)
 #define DEFINED_WINDOW_EVENT
 #endif /* WINDOW_EVENT */
 
+#ifdef DEFINED_TOUCH_EVENT
+#error "Don't define DEFINED_TOUCH_EVENT"
+#endif /* DEFINED_TOUCH_EVENT */
+
+#ifndef TOUCH_EVENT
+#define TOUCH_EVENT(_name)
+#define DEFINED_TOUCH_EVENT
+#endif /* TOUCH_EVENT */
+
 EVENT(abort)
 EVENT(canplay)
 EVENT(canplaythrough)
 EVENT(change)
 EVENT(click)
 EVENT(contextmenu)
 EVENT(cuechange)
 EVENT(dblclick)
@@ -121,16 +147,22 @@ EVENT(seeking)
 EVENT(select)
 EVENT(show)
 EVENT(stalled)
 EVENT(submit)
 EVENT(suspend)
 EVENT(timeupdate)
 EVENT(volumechange)
 EVENT(waiting)
+// Gecko-specific extensions that apply to elements
+EVENT(copy)
+EVENT(cut)
+EVENT(paste)
+EVENT(beforescriptexecute)
+EVENT(afterscriptexecute)
 
 FORWARDED_EVENT(blur)
 FORWARDED_EVENT(error)
 FORWARDED_EVENT(focus)
 FORWARDED_EVENT(load)
 FORWARDED_EVENT(scroll)
 
 WINDOW_EVENT(afterprint)
@@ -144,17 +176,38 @@ WINDOW_EVENT(pagehide)
 WINDOW_EVENT(pageshow)
 WINDOW_EVENT(popstate)
 WINDOW_EVENT(redo)
 WINDOW_EVENT(resize)
 WINDOW_EVENT(storage)
 WINDOW_EVENT(undo)
 WINDOW_EVENT(unload)
 
+WINDOW_ONLY_EVENT(devicemotion)
+WINDOW_ONLY_EVENT(deviceorientation)
+
+TOUCH_EVENT(touchstart)
+TOUCH_EVENT(touchend)
+TOUCH_EVENT(touchmove)
+TOUCH_EVENT(touchenter)
+TOUCH_EVENT(touchleave)
+TOUCH_EVENT(touchcancel)
+
 #ifdef DEFINED_FORWARDED_EVENT
 #undef DEFINED_FORWARDED_EVENT
 #undef FORWARDED_EVENT
 #endif /* DEFINED_FORWARDED_EVENT */
 
 #ifdef DEFINED_WINDOW_EVENT
 #undef DEFINED_WINDOW_EVENT
 #undef WINDOW_EVENT
 #endif /* DEFINED_WINDOW_EVENT */
+
+#ifdef DEFINED_WINDOW_ONLY_EVENT
+#undef DEFINED_WINDOW_ONLY_EVENT
+#undef WINDOW_ONLY_EVENT
+#endif /* DEFINED_WINDOW_ONLY_EVENT */
+
+#ifdef DEFINED_TOUCH_EVENT
+#undef DEFINED_TOUCH_EVENT
+#undef TOUCH_EVENT
+#endif /* DEFINED_TOUCH_EVENT */
+
--- a/dom/base/nsDOMClassInfo.cpp
+++ b/dom/base/nsDOMClassInfo.cpp
@@ -1589,55 +1589,16 @@ jsid nsDOMClassInfo::sLength_id         
 jsid nsDOMClassInfo::sInnerHeight_id     = JSID_VOID;
 jsid nsDOMClassInfo::sInnerWidth_id      = JSID_VOID;
 jsid nsDOMClassInfo::sOuterHeight_id     = JSID_VOID;
 jsid nsDOMClassInfo::sOuterWidth_id      = JSID_VOID;
 jsid nsDOMClassInfo::sScreenX_id         = JSID_VOID;
 jsid nsDOMClassInfo::sScreenY_id         = JSID_VOID;
 jsid nsDOMClassInfo::sStatus_id          = JSID_VOID;
 jsid nsDOMClassInfo::sName_id            = JSID_VOID;
-jsid nsDOMClassInfo::sOnmousedown_id     = JSID_VOID;
-jsid nsDOMClassInfo::sOnmouseup_id       = JSID_VOID;
-jsid nsDOMClassInfo::sOnclick_id         = JSID_VOID;
-jsid nsDOMClassInfo::sOndblclick_id      = JSID_VOID;
-jsid nsDOMClassInfo::sOncontextmenu_id   = JSID_VOID;
-jsid nsDOMClassInfo::sOnmouseover_id     = JSID_VOID;
-jsid nsDOMClassInfo::sOnmouseout_id      = JSID_VOID;
-jsid nsDOMClassInfo::sOnkeydown_id       = JSID_VOID;
-jsid nsDOMClassInfo::sOnkeyup_id         = JSID_VOID;
-jsid nsDOMClassInfo::sOnkeypress_id      = JSID_VOID;
-jsid nsDOMClassInfo::sOnmousemove_id     = JSID_VOID;
-jsid nsDOMClassInfo::sOnfocus_id         = JSID_VOID;
-jsid nsDOMClassInfo::sOnblur_id          = JSID_VOID;
-jsid nsDOMClassInfo::sOnsubmit_id        = JSID_VOID;
-jsid nsDOMClassInfo::sOnreset_id         = JSID_VOID;
-jsid nsDOMClassInfo::sOnchange_id        = JSID_VOID;
-jsid nsDOMClassInfo::sOninput_id         = JSID_VOID;
-jsid nsDOMClassInfo::sOninvalid_id       = JSID_VOID;
-jsid nsDOMClassInfo::sOnselect_id        = JSID_VOID;
-jsid nsDOMClassInfo::sOnload_id          = JSID_VOID;
-jsid nsDOMClassInfo::sOnpopstate_id      = JSID_VOID;
-jsid nsDOMClassInfo::sOnbeforeunload_id  = JSID_VOID;
-jsid nsDOMClassInfo::sOnunload_id        = JSID_VOID;
-jsid nsDOMClassInfo::sOnhashchange_id    = JSID_VOID;
-jsid nsDOMClassInfo::sOnreadystatechange_id = JSID_VOID;
-jsid nsDOMClassInfo::sOnpageshow_id      = JSID_VOID;
-jsid nsDOMClassInfo::sOnpagehide_id      = JSID_VOID;
-jsid nsDOMClassInfo::sOnabort_id         = JSID_VOID;
-jsid nsDOMClassInfo::sOnerror_id         = JSID_VOID;
-jsid nsDOMClassInfo::sOnpaint_id         = JSID_VOID;
-jsid nsDOMClassInfo::sOnresize_id        = JSID_VOID;
-jsid nsDOMClassInfo::sOnscroll_id        = JSID_VOID;
-jsid nsDOMClassInfo::sOndrag_id          = JSID_VOID;
-jsid nsDOMClassInfo::sOndragend_id       = JSID_VOID;
-jsid nsDOMClassInfo::sOndragenter_id     = JSID_VOID;
-jsid nsDOMClassInfo::sOndragleave_id     = JSID_VOID;
-jsid nsDOMClassInfo::sOndragover_id      = JSID_VOID;
-jsid nsDOMClassInfo::sOndragstart_id     = JSID_VOID;
-jsid nsDOMClassInfo::sOndrop_id          = JSID_VOID;
 jsid nsDOMClassInfo::sScrollX_id         = JSID_VOID;
 jsid nsDOMClassInfo::sScrollY_id         = JSID_VOID;
 jsid nsDOMClassInfo::sScrollMaxX_id      = JSID_VOID;
 jsid nsDOMClassInfo::sScrollMaxY_id      = JSID_VOID;
 jsid nsDOMClassInfo::sItem_id            = JSID_VOID;
 jsid nsDOMClassInfo::sNamedItem_id       = JSID_VOID;
 jsid nsDOMClassInfo::sEnumerate_id       = JSID_VOID;
 jsid nsDOMClassInfo::sNavigator_id       = JSID_VOID;
@@ -1646,61 +1607,32 @@ jsid nsDOMClassInfo::sFrames_id         
 jsid nsDOMClassInfo::sSelf_id            = JSID_VOID;
 jsid nsDOMClassInfo::sOpener_id          = JSID_VOID;
 jsid nsDOMClassInfo::sAll_id             = JSID_VOID;
 jsid nsDOMClassInfo::sTags_id            = JSID_VOID;
 jsid nsDOMClassInfo::sAddEventListener_id= JSID_VOID;
 jsid nsDOMClassInfo::sBaseURIObject_id   = JSID_VOID;
 jsid nsDOMClassInfo::sNodePrincipal_id   = JSID_VOID;
 jsid nsDOMClassInfo::sDocumentURIObject_id=JSID_VOID;
-jsid nsDOMClassInfo::sOncopy_id          = JSID_VOID;
-jsid nsDOMClassInfo::sOncut_id           = JSID_VOID;
-jsid nsDOMClassInfo::sOnpaste_id         = JSID_VOID;
 jsid nsDOMClassInfo::sJava_id            = JSID_VOID;
 jsid nsDOMClassInfo::sPackages_id        = JSID_VOID;
-jsid nsDOMClassInfo::sOnloadstart_id     = JSID_VOID;
-jsid nsDOMClassInfo::sOnprogress_id      = JSID_VOID;
-jsid nsDOMClassInfo::sOnsuspend_id       = JSID_VOID;
-jsid nsDOMClassInfo::sOnemptied_id       = JSID_VOID;
-jsid nsDOMClassInfo::sOnstalled_id       = JSID_VOID;
-jsid nsDOMClassInfo::sOnplay_id          = JSID_VOID;
-jsid nsDOMClassInfo::sOnpause_id         = JSID_VOID;
-jsid nsDOMClassInfo::sOnloadedmetadata_id= JSID_VOID;
-jsid nsDOMClassInfo::sOnloadeddata_id    = JSID_VOID;
-jsid nsDOMClassInfo::sOnwaiting_id       = JSID_VOID;
-jsid nsDOMClassInfo::sOnplaying_id       = JSID_VOID;
-jsid nsDOMClassInfo::sOncanplay_id       = JSID_VOID;
-jsid nsDOMClassInfo::sOncanplaythrough_id= JSID_VOID;
-jsid nsDOMClassInfo::sOnseeking_id       = JSID_VOID;
-jsid nsDOMClassInfo::sOnseeked_id        = JSID_VOID;
-jsid nsDOMClassInfo::sOntimeupdate_id    = JSID_VOID;
-jsid nsDOMClassInfo::sOnended_id         = JSID_VOID;
-jsid nsDOMClassInfo::sOnratechange_id    = JSID_VOID;
-jsid nsDOMClassInfo::sOndurationchange_id= JSID_VOID;
-jsid nsDOMClassInfo::sOnvolumechange_id  = JSID_VOID;
-jsid nsDOMClassInfo::sOnmessage_id       = JSID_VOID;
-jsid nsDOMClassInfo::sOnbeforescriptexecute_id = JSID_VOID;
-jsid nsDOMClassInfo::sOnafterscriptexecute_id = JSID_VOID;
 jsid nsDOMClassInfo::sWrappedJSObject_id = JSID_VOID;
 jsid nsDOMClassInfo::sURL_id             = JSID_VOID;
 jsid nsDOMClassInfo::sKeyPath_id         = JSID_VOID;
 jsid nsDOMClassInfo::sAutoIncrement_id   = JSID_VOID;
 jsid nsDOMClassInfo::sUnique_id          = JSID_VOID;
 
-jsid nsDOMClassInfo::sOntouchstart_id    = JSID_VOID;
-jsid nsDOMClassInfo::sOntouchend_id      = JSID_VOID;
-jsid nsDOMClassInfo::sOntouchmove_id     = JSID_VOID;
-jsid nsDOMClassInfo::sOntouchenter_id    = JSID_VOID;
-jsid nsDOMClassInfo::sOntouchleave_id    = JSID_VOID;
-jsid nsDOMClassInfo::sOntouchcancel_id   = JSID_VOID;
-jsid nsDOMClassInfo::sOnbeforeprint_id   = JSID_VOID;
-jsid nsDOMClassInfo::sOnafterprint_id    = JSID_VOID;
-
-jsid nsDOMClassInfo::sOndevicemotion_id       = JSID_VOID;
-jsid nsDOMClassInfo::sOndeviceorientation_id  = JSID_VOID;
+#define EVENT(name_) \
+jsid nsDOMClassInfo::sOn##name_##_id     = JSID_VOID;
+#define WINDOW_ONLY_EVENT(name_) EVENT(name_)
+#define TOUCH_EVENT(name_) EVENT(name_)
+#include "nsEventNameList.h"
+#undef TOUCH_EVENT
+#undef WINDOW_ONLY_EVENT
+#undef EVENT
 
 static const JSClass *sObjectClass = nsnull;
 
 /**
  * Set our JSClass pointer for the Object class
  */
 static void
 FindObjectClass(JSObject* aGlobalObject)
@@ -1927,55 +1859,16 @@ nsDOMClassInfo::DefineStaticJSVals(JSCon
   SET_JSID_TO_STRING(sInnerHeight_id,     cx, "innerHeight");
   SET_JSID_TO_STRING(sInnerWidth_id,      cx, "innerWidth");
   SET_JSID_TO_STRING(sOuterHeight_id,     cx, "outerHeight");
   SET_JSID_TO_STRING(sOuterWidth_id,      cx, "outerWidth");
   SET_JSID_TO_STRING(sScreenX_id,         cx, "screenX");
   SET_JSID_TO_STRING(sScreenY_id,         cx, "screenY");
   SET_JSID_TO_STRING(sStatus_id,          cx, "status");
   SET_JSID_TO_STRING(sName_id,            cx, "name");
-  SET_JSID_TO_STRING(sOnmousedown_id,     cx, "onmousedown");
-  SET_JSID_TO_STRING(sOnmouseup_id,       cx, "onmouseup");
-  SET_JSID_TO_STRING(sOnclick_id,         cx, "onclick");
-  SET_JSID_TO_STRING(sOndblclick_id,      cx, "ondblclick");
-  SET_JSID_TO_STRING(sOncontextmenu_id,   cx, "oncontextmenu");
-  SET_JSID_TO_STRING(sOnmouseover_id,     cx, "onmouseover");
-  SET_JSID_TO_STRING(sOnmouseout_id,      cx, "onmouseout");
-  SET_JSID_TO_STRING(sOnkeydown_id,       cx, "onkeydown");
-  SET_JSID_TO_STRING(sOnkeyup_id,         cx, "onkeyup");
-  SET_JSID_TO_STRING(sOnkeypress_id,      cx, "onkeypress");
-  SET_JSID_TO_STRING(sOnmousemove_id,     cx, "onmousemove");
-  SET_JSID_TO_STRING(sOnfocus_id,         cx, "onfocus");
-  SET_JSID_TO_STRING(sOnblur_id,          cx, "onblur");
-  SET_JSID_TO_STRING(sOnsubmit_id,        cx, "onsubmit");
-  SET_JSID_TO_STRING(sOnreset_id,         cx, "onreset");
-  SET_JSID_TO_STRING(sOnchange_id,        cx, "onchange");
-  SET_JSID_TO_STRING(sOninput_id,         cx, "oninput");
-  SET_JSID_TO_STRING(sOninvalid_id,       cx, "oninvalid");
-  SET_JSID_TO_STRING(sOnselect_id,        cx, "onselect");
-  SET_JSID_TO_STRING(sOnload_id,          cx, "onload");
-  SET_JSID_TO_STRING(sOnpopstate_id,      cx, "onpopstate");
-  SET_JSID_TO_STRING(sOnbeforeunload_id,  cx, "onbeforeunload");
-  SET_JSID_TO_STRING(sOnunload_id,        cx, "onunload");
-  SET_JSID_TO_STRING(sOnhashchange_id,    cx, "onhashchange");
-  SET_JSID_TO_STRING(sOnreadystatechange_id, cx, "onreadystatechange");
-  SET_JSID_TO_STRING(sOnpageshow_id,      cx, "onpageshow");
-  SET_JSID_TO_STRING(sOnpagehide_id,      cx, "onpagehide");
-  SET_JSID_TO_STRING(sOnabort_id,         cx, "onabort");
-  SET_JSID_TO_STRING(sOnerror_id,         cx, "onerror");
-  SET_JSID_TO_STRING(sOnpaint_id,         cx, "onpaint");
-  SET_JSID_TO_STRING(sOnresize_id,        cx, "onresize");
-  SET_JSID_TO_STRING(sOnscroll_id,        cx, "onscroll");
-  SET_JSID_TO_STRING(sOndrag_id,          cx, "ondrag");
-  SET_JSID_TO_STRING(sOndragend_id,       cx, "ondragend");
-  SET_JSID_TO_STRING(sOndragenter_id,     cx, "ondragenter");
-  SET_JSID_TO_STRING(sOndragleave_id,     cx, "ondragleave");
-  SET_JSID_TO_STRING(sOndragover_id,      cx, "ondragover");
-  SET_JSID_TO_STRING(sOndragstart_id,     cx, "ondragstart");
-  SET_JSID_TO_STRING(sOndrop_id,          cx, "ondrop");
   SET_JSID_TO_STRING(sScrollX_id,         cx, "scrollX");
   SET_JSID_TO_STRING(sScrollY_id,         cx, "scrollY");
   SET_JSID_TO_STRING(sScrollMaxX_id,      cx, "scrollMaxX");
   SET_JSID_TO_STRING(sScrollMaxY_id,      cx, "scrollMaxY");
   SET_JSID_TO_STRING(sItem_id,            cx, "item");
   SET_JSID_TO_STRING(sNamedItem_id,       cx, "namedItem");
   SET_JSID_TO_STRING(sEnumerate_id,       cx, "enumerateProperties");
   SET_JSID_TO_STRING(sNavigator_id,       cx, "navigator");
@@ -1984,63 +1877,32 @@ nsDOMClassInfo::DefineStaticJSVals(JSCon
   SET_JSID_TO_STRING(sSelf_id,            cx, "self");
   SET_JSID_TO_STRING(sOpener_id,          cx, "opener");
   SET_JSID_TO_STRING(sAll_id,             cx, "all");
   SET_JSID_TO_STRING(sTags_id,            cx, "tags");
   SET_JSID_TO_STRING(sAddEventListener_id,cx, "addEventListener");
   SET_JSID_TO_STRING(sBaseURIObject_id,   cx, "baseURIObject");
   SET_JSID_TO_STRING(sNodePrincipal_id,   cx, "nodePrincipal");
   SET_JSID_TO_STRING(sDocumentURIObject_id,cx,"documentURIObject");
-  SET_JSID_TO_STRING(sOncopy_id,          cx, "oncopy");
-  SET_JSID_TO_STRING(sOncut_id,           cx, "oncut");
-  SET_JSID_TO_STRING(sOnpaste_id,         cx, "onpaste");
   SET_JSID_TO_STRING(sJava_id,            cx, "java");
   SET_JSID_TO_STRING(sPackages_id,        cx, "Packages");
-#ifdef MOZ_MEDIA
-  SET_JSID_TO_STRING(sOnloadstart_id,     cx, "onloadstart");
-  SET_JSID_TO_STRING(sOnprogress_id,      cx, "onprogress");
-  SET_JSID_TO_STRING(sOnsuspend_id,       cx, "onsuspend");
-  SET_JSID_TO_STRING(sOnemptied_id,       cx, "onemptied");
-  SET_JSID_TO_STRING(sOnstalled_id,       cx, "onstalled");
-  SET_JSID_TO_STRING(sOnplay_id,          cx, "onplay");
-  SET_JSID_TO_STRING(sOnpause_id,         cx, "onpause");
-  SET_JSID_TO_STRING(sOnloadedmetadata_id,cx, "onloadedmetadata");
-  SET_JSID_TO_STRING(sOnloadeddata_id,    cx, "onloadeddata");
-  SET_JSID_TO_STRING(sOnwaiting_id,       cx, "onwaiting");
-  SET_JSID_TO_STRING(sOnplaying_id,       cx, "onplaying");
-  SET_JSID_TO_STRING(sOncanplay_id,       cx, "oncanplay");
-  SET_JSID_TO_STRING(sOncanplaythrough_id,cx, "oncanplaythrough");
-  SET_JSID_TO_STRING(sOnseeking_id,       cx, "onseeking");
-  SET_JSID_TO_STRING(sOnseeked_id,        cx, "onseeked");
-  SET_JSID_TO_STRING(sOntimeupdate_id,    cx, "ontimeupdate");
-  SET_JSID_TO_STRING(sOnended_id,         cx, "onended");
-  SET_JSID_TO_STRING(sOnratechange_id,    cx, "onratechange");
-  SET_JSID_TO_STRING(sOndurationchange_id,cx, "ondurationchange");
-  SET_JSID_TO_STRING(sOnvolumechange_id,  cx, "onvolumechange");
-  SET_JSID_TO_STRING(sOnmessage_id,       cx, "onmessage");
-  SET_JSID_TO_STRING(sOnbeforescriptexecute_id, cx, "onbeforescriptexecute");
-  SET_JSID_TO_STRING(sOnafterscriptexecute_id, cx, "onafterscriptexecute");
-#endif // MOZ_MEDIA
   SET_JSID_TO_STRING(sWrappedJSObject_id, cx, "wrappedJSObject");
   SET_JSID_TO_STRING(sURL_id,             cx, "URL");
   SET_JSID_TO_STRING(sKeyPath_id,         cx, "keyPath");
   SET_JSID_TO_STRING(sAutoIncrement_id,   cx, "autoIncrement");
   SET_JSID_TO_STRING(sUnique_id,          cx, "unique");
 
-  SET_JSID_TO_STRING(sOntouchstart_id,    cx, "ontouchstart");
-  SET_JSID_TO_STRING(sOntouchend_id,      cx, "ontouchend");
-  SET_JSID_TO_STRING(sOntouchmove_id,     cx, "ontouchmove");
-  SET_JSID_TO_STRING(sOntouchenter_id,    cx, "ontouchenter");
-  SET_JSID_TO_STRING(sOntouchleave_id,    cx, "ontouchleave");
-  SET_JSID_TO_STRING(sOntouchcancel_id,   cx, "ontouchcancel");
-  SET_JSID_TO_STRING(sOnbeforeprint_id,   cx, "onbeforeprint");
-  SET_JSID_TO_STRING(sOnafterprint_id,   cx, "onafterprint");
-
-  SET_JSID_TO_STRING(sOndevicemotion_id,      cx, "ondevicemotion");
-  SET_JSID_TO_STRING(sOndeviceorientation_id, cx, "ondeviceorientation");
+#define EVENT(name_) \
+  SET_JSID_TO_STRING(sOn##name_##_id, cx, "on" #name_); 
+#define WINDOW_ONLY_EVENT(name_) EVENT(name_)
+#define TOUCH_EVENT(name_) EVENT(name_)
+#include "nsEventNameList.h"
+#undef TOUCH_EVENT
+#undef WINDOW_ONLY_EVENT
+#undef EVENT 
   
   return NS_OK;
 }
 
 static nsresult
 CreateExceptionFromResult(JSContext *cx, nsresult aResult)
 {
   nsCOMPtr<nsIExceptionService> xs =
@@ -5016,54 +4878,16 @@ nsDOMClassInfo::ShutDown()
   sInnerHeight_id     = JSID_VOID;
   sInnerWidth_id      = JSID_VOID;
   sOuterHeight_id     = JSID_VOID;
   sOuterWidth_id      = JSID_VOID;
   sScreenX_id         = JSID_VOID;
   sScreenY_id         = JSID_VOID;
   sStatus_id          = JSID_VOID;
   sName_id            = JSID_VOID;
-  sOnmousedown_id     = JSID_VOID;
-  sOnmouseup_id       = JSID_VOID;
-  sOnclick_id         = JSID_VOID;
-  sOndblclick_id      = JSID_VOID;
-  sOncontextmenu_id   = JSID_VOID;
-  sOnmouseover_id     = JSID_VOID;
-  sOnmouseout_id      = JSID_VOID;
-  sOnkeydown_id       = JSID_VOID;
-  sOnkeyup_id         = JSID_VOID;
-  sOnkeypress_id      = JSID_VOID;
-  sOnmousemove_id     = JSID_VOID;
-  sOnfocus_id         = JSID_VOID;
-  sOnblur_id          = JSID_VOID;
-  sOnsubmit_id        = JSID_VOID;
-  sOnreset_id         = JSID_VOID;
-  sOnchange_id        = JSID_VOID;
-  sOninput_id         = JSID_VOID;
-  sOninvalid_id       = JSID_VOID;
-  sOnselect_id        = JSID_VOID;
-  sOnload_id          = JSID_VOID;
-  sOnbeforeunload_id  = JSID_VOID;
-  sOnunload_id        = JSID_VOID;
-  sOnhashchange_id    = JSID_VOID;
-  sOnreadystatechange_id = JSID_VOID;
-  sOnpageshow_id      = JSID_VOID;
-  sOnpagehide_id      = JSID_VOID;
-  sOnabort_id         = JSID_VOID;
-  sOnerror_id         = JSID_VOID;
-  sOnpaint_id         = JSID_VOID;
-  sOnresize_id        = JSID_VOID;
-  sOnscroll_id        = JSID_VOID;
-  sOndrag_id          = JSID_VOID;
-  sOndragend_id       = JSID_VOID;
-  sOndragenter_id     = JSID_VOID;
-  sOndragleave_id     = JSID_VOID;
-  sOndragover_id      = JSID_VOID;
-  sOndragstart_id     = JSID_VOID;
-  sOndrop_id          = JSID_VOID;
   sScrollX_id         = JSID_VOID;
   sScrollY_id         = JSID_VOID;
   sScrollMaxX_id      = JSID_VOID;
   sScrollMaxY_id      = JSID_VOID;
   sItem_id            = JSID_VOID;
   sEnumerate_id       = JSID_VOID;
   sNavigator_id       = JSID_VOID;
   sDocument_id        = JSID_VOID;
@@ -5071,57 +4895,31 @@ nsDOMClassInfo::ShutDown()
   sSelf_id            = JSID_VOID;
   sOpener_id          = JSID_VOID;
   sAll_id             = JSID_VOID;
   sTags_id            = JSID_VOID;
   sAddEventListener_id= JSID_VOID;
   sBaseURIObject_id   = JSID_VOID;
   sNodePrincipal_id   = JSID_VOID;
   sDocumentURIObject_id=JSID_VOID;
-  sOncopy_id          = JSID_VOID;
-  sOncut_id           = JSID_VOID;
-  sOnpaste_id         = JSID_VOID;
   sJava_id            = JSID_VOID;
   sPackages_id        = JSID_VOID;
-  sOnloadstart_id     = JSID_VOID;
-  sOnprogress_id      = JSID_VOID;
-  sOnsuspend_id       = JSID_VOID;
-  sOnemptied_id       = JSID_VOID;
-  sOnstalled_id       = JSID_VOID;
-  sOnplay_id          = JSID_VOID;
-  sOnpause_id         = JSID_VOID;
-  sOnloadedmetadata_id= JSID_VOID;
-  sOnloadeddata_id    = JSID_VOID;
-  sOnwaiting_id       = JSID_VOID;
-  sOnplaying_id       = JSID_VOID;
-  sOncanplay_id       = JSID_VOID;
-  sOncanplaythrough_id= JSID_VOID;
-  sOnseeking_id       = JSID_VOID;
-  sOnseeked_id        = JSID_VOID;
-  sOntimeupdate_id    = JSID_VOID;
-  sOnended_id         = JSID_VOID;
-  sOnratechange_id    = JSID_VOID;
-  sOndurationchange_id= JSID_VOID;
-  sOnvolumechange_id  = JSID_VOID;
-  sOnmessage_id       = JSID_VOID;
-  sOnbeforescriptexecute_id = JSID_VOID;
-  sOnafterscriptexecute_id = JSID_VOID;
   sWrappedJSObject_id = JSID_VOID;
   sKeyPath_id         = JSID_VOID;
   sAutoIncrement_id   = JSID_VOID;
   sUnique_id          = JSID_VOID;
 
-  sOntouchstart_id    = JSID_VOID;
-  sOntouchend_id      = JSID_VOID;
-  sOntouchmove_id     = JSID_VOID;
-  sOntouchenter_id    = JSID_VOID;
-  sOntouchleave_id    = JSID_VOID;
-  sOntouchcancel_id   = JSID_VOID;
-  sOnbeforeprint_id   = JSID_VOID;
-  sOnafterprint_id    = JSID_VOID;
+#define EVENT(name_) \
+  sOn##name_##_id     = JSID_VOID;
+#define WINDOW_ONLY_EVENT(name_) EVENT(name_)
+#define TOUCH_EVENT(name_) EVENT(name_)
+#include "nsEventNameList.h"
+#undef TOUCH_EVENT
+#undef WINDOW_ONLY_EVENT
+#undef EVENT
 
   NS_IF_RELEASE(sXPConnect);
   NS_IF_RELEASE(sSecMan);
   sIsInitialized = PR_FALSE;
 }
 
 // Window helper
 
@@ -7675,18 +7473,17 @@ nsEventReceiverSH::ReallyIsEventName(jsi
   case 'm' :
     return (id == sOnmousemove_id    ||
             id == sOnmouseout_id     ||
             id == sOnmouseover_id    ||
             id == sOnmouseup_id      ||
             id == sOnmousedown_id    ||
             id == sOnmessage_id);
   case 'p' :
-    return (id == sOnpaint_id        ||
-            id == sOnpageshow_id     ||
+    return (id == sOnpageshow_id     ||
             id == sOnpagehide_id     ||
             id == sOnpaste_id        ||
             id == sOnpopstate_id     ||
             id == sOnpause_id        ||
             id == sOnplay_id         ||
             id == sOnplaying_id      ||
             id == sOnprogress_id);
   case 'r' :
--- a/dom/base/nsDOMClassInfo.h
+++ b/dom/base/nsDOMClassInfo.h
@@ -262,55 +262,16 @@ public:
   static jsid sInnerHeight_id;
   static jsid sInnerWidth_id;
   static jsid sOuterHeight_id;
   static jsid sOuterWidth_id;
   static jsid sScreenX_id;
   static jsid sScreenY_id;
   static jsid sStatus_id;
   static jsid sName_id;
-  static jsid sOnmousedown_id;
-  static jsid sOnmouseup_id;
-  static jsid sOnclick_id;
-  static jsid sOndblclick_id;
-  static jsid sOncontextmenu_id;
-  static jsid sOnmouseover_id;
-  static jsid sOnmouseout_id;
-  static jsid sOnkeydown_id;
-  static jsid sOnkeyup_id;
-  static jsid sOnkeypress_id;
-  static jsid sOnmousemove_id;
-  static jsid sOnfocus_id;
-  static jsid sOnblur_id;
-  static jsid sOnsubmit_id;
-  static jsid sOnreset_id;
-  static jsid sOnchange_id;
-  static jsid sOninput_id;
-  static jsid sOninvalid_id;
-  static jsid sOnselect_id;
-  static jsid sOnload_id;
-  static jsid sOnpopstate_id;
-  static jsid sOnbeforeunload_id;
-  static jsid sOnunload_id;
-  static jsid sOnhashchange_id;
-  static jsid sOnreadystatechange_id;
-  static jsid sOnpageshow_id;
-  static jsid sOnpagehide_id;
-  static jsid sOnabort_id;
-  static jsid sOnerror_id;
-  static jsid sOnpaint_id;
-  static jsid sOnresize_id;
-  static jsid sOnscroll_id;
-  static jsid sOndrag_id;
-  static jsid sOndragend_id;
-  static jsid sOndragenter_id;
-  static jsid sOndragleave_id;
-  static jsid sOndragover_id;
-  static jsid sOndragstart_id;
-  static jsid sOndrop_id;
   static jsid sScrollX_id;
   static jsid sScrollY_id;
   static jsid sScrollMaxX_id;
   static jsid sScrollMaxY_id;
   static jsid sItem_id;
   static jsid sNamedItem_id;
   static jsid sEnumerate_id;
   static jsid sNavigator_id;
@@ -319,62 +280,32 @@ public:
   static jsid sSelf_id;
   static jsid sOpener_id;
   static jsid sAll_id;
   static jsid sTags_id;
   static jsid sAddEventListener_id;
   static jsid sBaseURIObject_id;
   static jsid sNodePrincipal_id;
   static jsid sDocumentURIObject_id;
-  static jsid sOncopy_id;
-  static jsid sOncut_id;
-  static jsid sOnpaste_id;
   static jsid sJava_id;
   static jsid sPackages_id;
-  static jsid sOnloadstart_id;
-  static jsid sOnprogress_id;
-  static jsid sOnsuspend_id;
-  static jsid sOnemptied_id;
-  static jsid sOnstalled_id;
-  static jsid sOnplay_id;
-  static jsid sOnpause_id;
-  static jsid sOnloadedmetadata_id;
-  static jsid sOnloadeddata_id;
-  static jsid sOnwaiting_id;
-  static jsid sOnplaying_id;
-  static jsid sOncanplay_id;
-  static jsid sOncanplaythrough_id;
-  static jsid sOnseeking_id;
-  static jsid sOnseeked_id;
-  static jsid sOntimeupdate_id;
-  static jsid sOnended_id;
-  static jsid sOnratechange_id;
-  static jsid sOndurationchange_id;
-  static jsid sOnvolumechange_id;
-  static jsid sOnmessage_id;
-  static jsid sOnbeforescriptexecute_id;
-  static jsid sOnafterscriptexecute_id;
   static jsid sWrappedJSObject_id;
   static jsid sURL_id;
   static jsid sKeyPath_id;
   static jsid sAutoIncrement_id;
   static jsid sUnique_id;
+
+#define EVENT(name_) static jsid sOn##name_##_id;
+#define WINDOW_ONLY_EVENT(name_) EVENT(name_)
+#define TOUCH_EVENT(name_) EVENT(name_)
+#include "nsEventNameList.h"
+#undef TOUCH_EVENT
+#undef WINDOW_ONLY_EVENT
+#undef EVENT
   
-  static jsid sOntouchstart_id;
-  static jsid sOntouchend_id;
-  static jsid sOntouchmove_id;
-  static jsid sOntouchenter_id;
-  static jsid sOntouchleave_id;
-  static jsid sOntouchcancel_id;
-  static jsid sOnbeforeprint_id;
-  static jsid sOnafterprint_id;
-
-  static jsid sOndevicemotion_id;
-  static jsid sOndeviceorientation_id;
-
 protected:
   static JSPropertyOp sXPCNativeWrapperGetPropertyOp;
   static JSPropertyOp sXrayWrapperPropertyHolderGetPropertyOp;
 };
 
 
 inline
 const nsQueryInterface