Bug 477323 - WHATWG HTML5 drag and drop event handlers could not be set dynamically, r=smaug
authorHonza Bambas <honzab.moz@firemni.cz>
Wed, 18 Feb 2009 14:31:31 +0100
changeset 25136 5ed3158a1d9cf076f971b1c1a43d82837f927a9b
parent 25135 fc19648c0f72fe8dd48a25b2985cd740d8f03ebd
child 25137 9ad175f8b25fe32a5e9641ff59e6439a7ad71b04
push idunknown
push userunknown
push dateunknown
reviewerssmaug
bugs477323
milestone1.9.2a1pre
Bug 477323 - WHATWG HTML5 drag and drop event handlers could not be set dynamically, r=smaug
dom/src/base/nsDOMClassInfo.cpp
dom/src/base/nsDOMClassInfo.h
--- a/dom/src/base/nsDOMClassInfo.cpp
+++ b/dom/src/base/nsDOMClassInfo.cpp
@@ -1411,16 +1411,23 @@ jsval nsDOMClassInfo::sOnbeforeunload_id
 jsval nsDOMClassInfo::sOnunload_id        = JSVAL_VOID;
 jsval nsDOMClassInfo::sOnpageshow_id      = JSVAL_VOID;
 jsval nsDOMClassInfo::sOnpagehide_id      = JSVAL_VOID;
 jsval nsDOMClassInfo::sOnabort_id         = JSVAL_VOID;
 jsval nsDOMClassInfo::sOnerror_id         = JSVAL_VOID;
 jsval nsDOMClassInfo::sOnpaint_id         = JSVAL_VOID;
 jsval nsDOMClassInfo::sOnresize_id        = JSVAL_VOID;
 jsval nsDOMClassInfo::sOnscroll_id        = JSVAL_VOID;
+jsval nsDOMClassInfo::sOndrag_id          = JSVAL_VOID;
+jsval nsDOMClassInfo::sOndragend_id       = JSVAL_VOID;
+jsval nsDOMClassInfo::sOndragenter_id     = JSVAL_VOID;
+jsval nsDOMClassInfo::sOndragleave_id     = JSVAL_VOID;
+jsval nsDOMClassInfo::sOndragover_id      = JSVAL_VOID;
+jsval nsDOMClassInfo::sOndragstart_id     = JSVAL_VOID;
+jsval nsDOMClassInfo::sOndrop_id          = JSVAL_VOID;
 jsval nsDOMClassInfo::sScrollIntoView_id  = JSVAL_VOID;
 jsval nsDOMClassInfo::sScrollX_id         = JSVAL_VOID;
 jsval nsDOMClassInfo::sScrollY_id         = JSVAL_VOID;
 jsval nsDOMClassInfo::sScrollMaxX_id      = JSVAL_VOID;
 jsval nsDOMClassInfo::sScrollMaxY_id      = JSVAL_VOID;
 jsval nsDOMClassInfo::sOpen_id            = JSVAL_VOID;
 jsval nsDOMClassInfo::sItem_id            = JSVAL_VOID;
 jsval nsDOMClassInfo::sNamedItem_id       = JSVAL_VOID;
@@ -1603,16 +1610,23 @@ nsDOMClassInfo::DefineStaticJSVals(JSCon
   SET_JSVAL_TO_STRING(sOnunload_id,        cx, "onunload");
   SET_JSVAL_TO_STRING(sOnpageshow_id,      cx, "onpageshow");
   SET_JSVAL_TO_STRING(sOnpagehide_id,      cx, "onpagehide");
   SET_JSVAL_TO_STRING(sOnabort_id,         cx, "onabort");
   SET_JSVAL_TO_STRING(sOnerror_id,         cx, "onerror");
   SET_JSVAL_TO_STRING(sOnpaint_id,         cx, "onpaint");
   SET_JSVAL_TO_STRING(sOnresize_id,        cx, "onresize");
   SET_JSVAL_TO_STRING(sOnscroll_id,        cx, "onscroll");
+  SET_JSVAL_TO_STRING(sOndrag_id,          cx, "ondrag");
+  SET_JSVAL_TO_STRING(sOndragend_id,       cx, "ondragend");
+  SET_JSVAL_TO_STRING(sOndragenter_id,     cx, "ondragenter");
+  SET_JSVAL_TO_STRING(sOndragleave_id,     cx, "ondragleave");
+  SET_JSVAL_TO_STRING(sOndragover_id,      cx, "ondragover");
+  SET_JSVAL_TO_STRING(sOndragstart_id,     cx, "ondragstart");
+  SET_JSVAL_TO_STRING(sOndrop_id,          cx, "ondrop");
   SET_JSVAL_TO_STRING(sScrollIntoView_id,  cx, "scrollIntoView");
   SET_JSVAL_TO_STRING(sScrollX_id,         cx, "scrollX");
   SET_JSVAL_TO_STRING(sScrollY_id,         cx, "scrollY");
   SET_JSVAL_TO_STRING(sScrollMaxX_id,      cx, "scrollMaxX");
   SET_JSVAL_TO_STRING(sScrollMaxY_id,      cx, "scrollMaxY");
   SET_JSVAL_TO_STRING(sOpen_id,            cx, "open");
   SET_JSVAL_TO_STRING(sItem_id,            cx, "item");
   SET_JSVAL_TO_STRING(sNamedItem_id,       cx, "namedItem");
@@ -4311,16 +4325,23 @@ nsDOMClassInfo::ShutDown()
   sOnunload_id        = JSVAL_VOID;
   sOnpageshow_id      = JSVAL_VOID;
   sOnpagehide_id      = JSVAL_VOID;
   sOnabort_id         = JSVAL_VOID;
   sOnerror_id         = JSVAL_VOID;
   sOnpaint_id         = JSVAL_VOID;
   sOnresize_id        = JSVAL_VOID;
   sOnscroll_id        = JSVAL_VOID;
+  sOndrag_id          = JSVAL_VOID;
+  sOndragend_id       = JSVAL_VOID;
+  sOndragenter_id     = JSVAL_VOID;
+  sOndragleave_id     = JSVAL_VOID;
+  sOndragover_id      = JSVAL_VOID;
+  sOndragstart_id     = JSVAL_VOID;
+  sOndrop_id          = JSVAL_VOID;
   sScrollIntoView_id  = JSVAL_VOID;
   sScrollX_id         = JSVAL_VOID;
   sScrollY_id         = JSVAL_VOID;
   sScrollMaxX_id      = JSVAL_VOID;
   sScrollMaxY_id      = JSVAL_VOID;
   sOpen_id            = JSVAL_VOID;
   sItem_id            = JSVAL_VOID;
   sEnumerate_id       = JSVAL_VOID;
@@ -7098,17 +7119,24 @@ nsEventReceiverSH::ReallyIsEventName(jsv
     return id == sOnfocus_id;
   case 'c' :
     return (id == sOnchange_id       ||
             id == sOnclick_id        ||
             id == sOncontextmenu_id  ||
             id == sOncopy_id         ||
             id == sOncut_id);
   case 'd' :
-    return id == sOndblclick_id;
+    return (id == sOndblclick_id     || 
+            id == sOndrag_id         ||
+            id == sOndragend_id      ||
+            id == sOndragenter_id    ||
+            id == sOndragleave_id    ||
+            id == sOndragover_id     ||
+            id == sOndragstart_id    ||
+            id == sOndrop_id);
   case 'l' :
     return id == sOnload_id;
   case 'p' :
     return (id == sOnpaint_id        ||
             id == sOnpageshow_id     ||
             id == sOnpagehide_id     ||
             id == sOnpaste_id);
   case 'k' :
--- a/dom/src/base/nsDOMClassInfo.h
+++ b/dom/src/base/nsDOMClassInfo.h
@@ -297,16 +297,23 @@ protected:
   static jsval sOnunload_id;
   static jsval sOnpageshow_id;
   static jsval sOnpagehide_id;
   static jsval sOnabort_id;
   static jsval sOnerror_id;
   static jsval sOnpaint_id;
   static jsval sOnresize_id;
   static jsval sOnscroll_id;
+  static jsval sOndrag_id;
+  static jsval sOndragend_id;
+  static jsval sOndragenter_id;
+  static jsval sOndragleave_id;
+  static jsval sOndragover_id;
+  static jsval sOndragstart_id;
+  static jsval sOndrop_id;
   static jsval sScrollIntoView_id;
   static jsval sScrollX_id;
   static jsval sScrollY_id;
   static jsval sScrollMaxX_id;
   static jsval sScrollMaxY_id;
   static jsval sOpen_id;
   static jsval sItem_id;
   static jsval sNamedItem_id;