Bug 1250746 - Add InitMouseEvent back to nsIDOMMouseEvent. r=khuey
authorAbdelrhman Ahmed <ab@abahmed.com>
Fri, 26 Feb 2016 10:04:00 +0100
changeset 322316 df83e1d23721981cb6229dbc3c51afab8f276027
parent 322315 3374f3adff0d3ededd3bdec631046bfe937afc71
child 322317 23566cc859df754ebb0b63bc0a2cb498c2f2d9b6
push id5913
push userjlund@mozilla.com
push dateMon, 25 Apr 2016 16:57:49 +0000
treeherdermozilla-beta@dcaf0a6fa115 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskhuey
bugs1250746
milestone47.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 1250746 - Add InitMouseEvent back to nsIDOMMouseEvent. r=khuey
dom/events/MouseEvent.cpp
dom/interfaces/events/nsIDOMMouseEvent.idl
--- a/dom/events/MouseEvent.cpp
+++ b/dom/events/MouseEvent.cpp
@@ -54,17 +54,17 @@ void
 MouseEvent::InitMouseEvent(const nsAString& aType,
                            bool aCanBubble,
                            bool aCancelable,
                            nsGlobalWindow* aView,
                            int32_t aDetail,
                            int32_t aScreenX,
                            int32_t aScreenY,
                            int32_t aClientX,
-                           int32_t aClientY, 
+                           int32_t aClientY,
                            bool aCtrlKey,
                            bool aAltKey,
                            bool aShiftKey,
                            bool aMetaKey,
                            uint16_t aButton,
                            EventTarget* aRelatedTarget)
 {
   UIEvent::InitUIEvent(aType, aCanBubble, aCancelable, aView, aDetail);
@@ -89,17 +89,45 @@ MouseEvent::InitMouseEvent(const nsAStri
       if (mouseEvent) {
         mouseEvent->clickCount = aDetail;
       }
       break;
     }
     default:
        break;
   }
-}   
+}
+
+NS_IMETHODIMP
+MouseEvent::InitMouseEvent(const nsAString& aType,
+                           bool aCanBubble,
+                           bool aCancelable,
+                           mozIDOMWindow* aView,
+                           int32_t aDetail,
+                           int32_t aScreenX,
+                           int32_t aScreenY,
+                           int32_t aClientX,
+                           int32_t aClientY,
+                           bool aCtrlKey,
+                           bool aAltKey,
+                           bool aShiftKey,
+                           bool aMetaKey,
+                           uint16_t aButton,
+                           nsIDOMEventTarget* aRelatedTarget)
+{
+  MouseEvent::InitMouseEvent(aType, aCanBubble, aCancelable,
+                             nsGlobalWindow::Cast(aView), aDetail,
+                             aScreenX, aScreenY,
+                             aClientX, aClientY,
+                             aCtrlKey, aAltKey, aShiftKey,
+                             aMetaKey, aButton,
+                             static_cast<EventTarget *>(aRelatedTarget));
+
+  return NS_OK;
+}
 
 void
 MouseEvent::InitMouseEvent(const nsAString& aType,
                            bool aCanBubble,
                            bool aCancelable,
                            nsGlobalWindow* aView,
                            int32_t aDetail,
                            int32_t aScreenX,
--- a/dom/interfaces/events/nsIDOMMouseEvent.idl
+++ b/dom/interfaces/events/nsIDOMMouseEvent.idl
@@ -8,17 +8,17 @@
 /**
  * The nsIDOMMouseEvent interface is the datatype for all mouse events
  * in the Document Object Model.
  *
  * For more information on this interface please see
  * http://www.w3.org/TR/DOM-Level-2-Events/
  */
 
-[builtinclass, uuid(7e9a1eff-2007-45f9-8f28-cc47a7b80bd5)]
+[builtinclass, uuid(5bdab8d8-7933-4c5c-b6d1-ab34481237f7)]
 interface nsIDOMMouseEvent : nsIDOMUIEvent
 {
   readonly attribute long               screenX;
   readonly attribute long               screenY;
 
   readonly attribute long               mozMovementX;
   readonly attribute long               mozMovementY;
 
@@ -29,16 +29,33 @@ interface nsIDOMMouseEvent : nsIDOMUIEve
   readonly attribute boolean            shiftKey;
   readonly attribute boolean            altKey;
   readonly attribute boolean            metaKey;
 
   readonly attribute short              button;
   readonly attribute unsigned short     buttons;
   readonly attribute nsIDOMEventTarget  relatedTarget;
 
+  void                      initMouseEvent(in DOMString typeArg,
+                                           in boolean canBubbleArg,
+                                           in boolean cancelableArg,
+                                           in mozIDOMWindow viewArg,
+                                           in long detailArg,
+                                           in long screenXArg,
+                                           in long screenYArg,
+                                           in long clientXArg,
+                                           in long clientYArg,
+                                           in boolean ctrlKeyArg,
+                                           in boolean altKeyArg,
+                                           in boolean shiftKeyArg,
+                                           in boolean metaKeyArg,
+                                           in unsigned short buttonArg,
+                                           in nsIDOMEventTarget relatedTargetArg);
+
+
   // Finger or touch pressure event value
   // ranges between 0.0 and 1.0
   readonly attribute float mozPressure;
 
   const unsigned short    MOZ_SOURCE_UNKNOWN    = 0;
   const unsigned short    MOZ_SOURCE_MOUSE      = 1;
   const unsigned short    MOZ_SOURCE_PEN        = 2;
   const unsigned short    MOZ_SOURCE_ERASER     = 3;