Bug 920377 part.26 Get rid of nsInputEvent r=roc
authorMasayuki Nakano <masayuki@d-toybox.com>
Tue, 01 Oct 2013 16:23:02 +0900
changeset 149435 e88b33939f5058ba29b2ccad47d8cecfa3a4a549
parent 149434 5f1f90c96c91c478a376f5103916b382ba0fb299
child 149436 d3a3d276eb33e8c8311270ba6d65039367c07e26
push id25389
push userryanvm@gmail.com
push dateTue, 01 Oct 2013 20:35:30 +0000
treeherdermozilla-central@4364824a4cab [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs920377
milestone27.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 920377 part.26 Get rid of nsInputEvent r=roc
content/base/public/Element.h
content/base/src/Element.cpp
content/events/src/nsDOMDragEvent.cpp
content/events/src/nsDOMDragEvent.h
content/events/src/nsDOMEvent.cpp
content/events/src/nsDOMKeyboardEvent.h
content/events/src/nsDOMMouseEvent.cpp
content/events/src/nsDOMMouseEvent.h
content/events/src/nsDOMMouseScrollEvent.cpp
content/events/src/nsDOMMouseScrollEvent.h
content/events/src/nsDOMTouchEvent.cpp
content/events/src/nsDOMTouchEvent.h
content/events/src/nsDOMUIEvent.cpp
content/events/src/nsDOMXULCommandEvent.cpp
content/events/src/nsDOMXULCommandEvent.h
content/events/src/nsEventDispatcher.cpp
content/events/src/nsEventStateManager.cpp
content/html/content/src/HTMLInputElement.cpp
content/html/content/src/HTMLLabelElement.cpp
content/xbl/src/nsXBLPrototypeHandler.cpp
content/xul/content/src/nsXULElement.cpp
dom/interfaces/events/nsIDOMEvent.idl
dom/ipc/TabParent.cpp
dom/ipc/TabParent.h
dom/plugins/base/nsPluginInstanceOwner.cpp
gfx/layers/composite/APZCTreeManager.cpp
gfx/layers/composite/APZCTreeManager.h
layout/base/nsPresShell.h
layout/generic/nsFrame.cpp
layout/ipc/RenderFrameParent.cpp
layout/ipc/RenderFrameParent.h
layout/xul/base/src/nsButtonBoxFrame.cpp
layout/xul/base/src/nsMenuBarListener.cpp
layout/xul/base/src/nsMenuFrame.cpp
layout/xul/base/src/nsXULPopupManager.cpp
widget/BasicEvents.h
widget/EventForwards.h
widget/InputData.h
widget/android/nsWindow.cpp
widget/android/nsWindow.h
widget/cocoa/TextInputHandler.mm
widget/cocoa/nsChildView.mm
widget/cocoa/nsCocoaUtils.h
widget/cocoa/nsCocoaUtils.mm
widget/gtk/nsGtkKeyUtils.cpp
widget/gtk/nsGtkKeyUtils.h
widget/nsGUIEventIPC.h
widget/windows/KeyboardLayout.cpp
widget/windows/KeyboardLayout.h
widget/windows/winrt/MetroInput.cpp
widget/windows/winrt/MetroInput.h
widget/windows/winrt/MetroWidget.cpp
widget/windows/winrt/MetroWidget.h
--- a/content/base/public/Element.h
+++ b/content/base/public/Element.h
@@ -756,17 +756,17 @@ public:
    * through the full dispatching of the presshell of the aPresContext; if it's
    * false the event will be dispatched only as a DOM event.
    * If aPresContext is nullptr, this does nothing.
    *
    * @param aFlags      Extra flags for the dispatching event.  The true flags
    *                    will be respected.
    */
   static nsresult DispatchClickEvent(nsPresContext* aPresContext,
-                                     nsInputEvent* aSourceEvent,
+                                     WidgetInputEvent* aSourceEvent,
                                      nsIContent* aTarget,
                                      bool aFullDispatch,
                                      const EventFlags* aFlags,
                                      nsEventStatus* aStatus);
 
   /**
    * Method to dispatch aEvent to aTarget. If aFullDispatch is true, the event
    * will be dispatched through the full dispatching of the presshell of the
--- a/content/base/src/Element.cpp
+++ b/content/base/src/Element.cpp
@@ -1400,17 +1400,17 @@ Element::DispatchEvent(nsPresContext* aP
   }
 
   return shell->HandleDOMEventWithTarget(aTarget, aEvent, aStatus);
 }
 
 /* static */
 nsresult
 Element::DispatchClickEvent(nsPresContext* aPresContext,
-                            nsInputEvent* aSourceEvent,
+                            WidgetInputEvent* aSourceEvent,
                             nsIContent* aTarget,
                             bool aFullDispatch,
                             const EventFlags* aExtraEventFlags,
                             nsEventStatus* aStatus)
 {
   NS_PRECONDITION(aTarget, "Must have target");
   NS_PRECONDITION(aSourceEvent, "Must have source event");
   NS_PRECONDITION(aStatus, "Null out param?");
@@ -2212,17 +2212,18 @@ Element::PostHandleEventForLinks(nsEvent
             aVisitor.mPresContext->EventStateManager(), this);
         }
       }
     }
     break;
 
   case NS_MOUSE_CLICK:
     if (aVisitor.mEvent->IsLeftClickEvent()) {
-      nsInputEvent* inputEvent = static_cast<nsInputEvent*>(aVisitor.mEvent);
+      WidgetInputEvent* inputEvent =
+        static_cast<WidgetInputEvent*>(aVisitor.mEvent);
       if (inputEvent->IsControl() || inputEvent->IsMeta() ||
           inputEvent->IsAlt() ||inputEvent->IsShift()) {
         break;
       }
 
       // The default action is simply to dispatch DOMActivate
       nsCOMPtr<nsIPresShell> shell = aVisitor.mPresContext->GetPresShell();
       if (shell) {
--- a/content/events/src/nsDOMDragEvent.cpp
+++ b/content/events/src/nsDOMDragEvent.cpp
@@ -4,19 +4,21 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsDOMDragEvent.h"
 #include "nsContentUtils.h"
 #include "nsIDOMDataTransfer.h"
 #include "prtime.h"
 #include "mozilla/MouseEvents.h"
 
+using namespace mozilla;
+
 nsDOMDragEvent::nsDOMDragEvent(mozilla::dom::EventTarget* aOwner,
                                nsPresContext* aPresContext,
-                               nsInputEvent* aEvent)
+                               WidgetInputEvent* aEvent)
   : nsDOMMouseEvent(aOwner, aPresContext, aEvent ? aEvent :
                     new nsDragEvent(false, 0, nullptr))
 {
   if (aEvent) {
     mEventIsInternal = false;
   }
   else {
     mEventIsInternal = true;
--- a/content/events/src/nsDOMDragEvent.h
+++ b/content/events/src/nsDOMDragEvent.h
@@ -11,17 +11,18 @@
 #include "mozilla/dom/DragEventBinding.h"
 #include "mozilla/EventForwards.h"
 
 class nsDOMDragEvent : public nsDOMMouseEvent,
                        public nsIDOMDragEvent
 {
 public:
   nsDOMDragEvent(mozilla::dom::EventTarget* aOwner,
-                 nsPresContext* aPresContext, nsInputEvent* aEvent);
+                 nsPresContext* aPresContext,
+                 mozilla::WidgetInputEvent* aEvent);
   virtual ~nsDOMDragEvent();
 
   NS_DECL_ISUPPORTS_INHERITED
 
   NS_DECL_NSIDOMDRAGEVENT
   
   NS_FORWARD_TO_NSDOMMOUSEEVENT
 
--- a/content/events/src/nsDOMEvent.cpp
+++ b/content/events/src/nsDOMEvent.cpp
@@ -525,18 +525,18 @@ nsDOMEvent::DuplicatePrivateData()
       // Not copying widget, it is a weak reference.
       nsGUIEvent* guiEvent = new nsGUIEvent(false, msg, nullptr);
       guiEvent->AssignGUIEventData(*oldGUIEvent, true);
       newEvent = guiEvent;
       break;
     }
     case NS_INPUT_EVENT:
     {
-      nsInputEvent* oldInputEvent = static_cast<nsInputEvent*>(mEvent);
-      nsInputEvent* inputEvent = new nsInputEvent(false, msg, nullptr);
+      WidgetInputEvent* oldInputEvent = static_cast<WidgetInputEvent*>(mEvent);
+      WidgetInputEvent* inputEvent = new WidgetInputEvent(false, msg, nullptr);
       inputEvent->AssignInputEventData(*oldInputEvent, true);
       newEvent = inputEvent;
       break;
     }
     case NS_KEY_EVENT:
     {
       WidgetKeyboardEvent* oldKeyEvent =
         static_cast<WidgetKeyboardEvent*>(mEvent);
--- a/content/events/src/nsDOMKeyboardEvent.h
+++ b/content/events/src/nsDOMKeyboardEvent.h
@@ -32,32 +32,32 @@ public:
   virtual JSObject* WrapObject(JSContext* aCx,
                                JS::Handle<JSObject*> aScope) MOZ_OVERRIDE
   {
     return mozilla::dom::KeyboardEventBinding::Wrap(aCx, aScope, this);
   }
 
   bool AltKey()
   {
-    return static_cast<nsInputEvent*>(mEvent)->IsAlt();
+    return static_cast<mozilla::WidgetInputEvent*>(mEvent)->IsAlt();
   }
 
   bool CtrlKey()
   {
-    return static_cast<nsInputEvent*>(mEvent)->IsControl();
+    return static_cast<mozilla::WidgetInputEvent*>(mEvent)->IsControl();
   }
 
   bool ShiftKey()
   {
-    return static_cast<nsInputEvent*>(mEvent)->IsShift();
+    return static_cast<mozilla::WidgetInputEvent*>(mEvent)->IsShift();
   }
 
   bool MetaKey()
   {
-    return static_cast<nsInputEvent*>(mEvent)->IsMeta();
+    return static_cast<mozilla::WidgetInputEvent*>(mEvent)->IsMeta();
   }
 
   bool GetModifierState(const nsAString& aKey)
   {
     return GetModifierStateInternal(aKey);
   }
 
   uint32_t CharCode();
--- a/content/events/src/nsDOMMouseEvent.cpp
+++ b/content/events/src/nsDOMMouseEvent.cpp
@@ -8,17 +8,17 @@
 #include "nsContentUtils.h"
 #include "prtime.h"
 #include "mozilla/MouseEvents.h"
 
 using namespace mozilla;
 
 nsDOMMouseEvent::nsDOMMouseEvent(mozilla::dom::EventTarget* aOwner,
                                  nsPresContext* aPresContext,
-                                 nsInputEvent* aEvent)
+                                 WidgetInputEvent* aEvent)
   : nsDOMUIEvent(aOwner, aPresContext, aEvent ? aEvent :
                  new nsMouseEvent(false, 0, nullptr,
                                   nsMouseEvent::eReal))
 {
   // There's no way to make this class' ctor allocate an nsMouseScrollEvent.
   // It's not that important, though, since a scroll event is not a real
   // DOM event.
   
@@ -83,17 +83,17 @@ nsDOMMouseEvent::InitMouseEvent(const ns
     case NS_MOUSE_EVENT:
     case NS_MOUSE_SCROLL_EVENT:
     case NS_WHEEL_EVENT:
     case NS_DRAG_EVENT:
     case NS_SIMPLE_GESTURE_EVENT:
     {
        static_cast<nsMouseEvent_base*>(mEvent)->relatedTarget = aRelatedTarget;
        static_cast<nsMouseEvent_base*>(mEvent)->button = aButton;
-       nsInputEvent* inputEvent = static_cast<nsInputEvent*>(mEvent);
+       WidgetInputEvent* inputEvent = static_cast<WidgetInputEvent*>(mEvent);
        inputEvent->InitBasicModifiers(aCtrlKey, aAltKey, aShiftKey, aMetaKey);
        mClientPoint.x = aClientX;
        mClientPoint.y = aClientY;
        inputEvent->refPoint.x = aScreenX;
        inputEvent->refPoint.y = aScreenY;
 
        if (mEvent->eventStructType == NS_MOUSE_EVENT) {
          nsMouseEvent* mouseEvent = static_cast<nsMouseEvent*>(mEvent);
@@ -134,17 +134,17 @@ nsDOMMouseEvent::InitMouseEvent(const ns
   NS_ENSURE_SUCCESS(rv, rv);
 
   switch(mEvent->eventStructType) {
     case NS_MOUSE_EVENT:
     case NS_MOUSE_SCROLL_EVENT:
     case NS_WHEEL_EVENT:
     case NS_DRAG_EVENT:
     case NS_SIMPLE_GESTURE_EVENT:
-      static_cast<nsInputEvent*>(mEvent)->modifiers = modifiers;
+      static_cast<WidgetInputEvent*>(mEvent)->modifiers = modifiers;
       return NS_OK;
     default:
       MOZ_CRASH("There is no space to store the modifiers");
   }
 }
 
 already_AddRefed<nsDOMMouseEvent>
 nsDOMMouseEvent::Constructor(const mozilla::dom::GlobalObject& aGlobal,
@@ -425,13 +425,13 @@ nsDOMMouseEvent::GetMozInputSource(uint1
   NS_ENSURE_ARG_POINTER(aInputSource);
   *aInputSource = MozInputSource();
   return NS_OK;
 }
 
 nsresult NS_NewDOMMouseEvent(nsIDOMEvent** aInstancePtrResult,
                              mozilla::dom::EventTarget* aOwner,
                              nsPresContext* aPresContext,
-                             nsInputEvent *aEvent)
+                             WidgetInputEvent* aEvent)
 {
   nsDOMMouseEvent* it = new nsDOMMouseEvent(aOwner, aPresContext, aEvent);
   return CallQueryInterface(it, aInstancePtrResult);
 }
--- a/content/events/src/nsDOMMouseEvent.h
+++ b/content/events/src/nsDOMMouseEvent.h
@@ -11,17 +11,18 @@
 #include "mozilla/dom/MouseEventBinding.h"
 #include "mozilla/MouseEvents.h"
 
 class nsDOMMouseEvent : public nsDOMUIEvent,
                         public nsIDOMMouseEvent
 {
 public:
   nsDOMMouseEvent(mozilla::dom::EventTarget* aOwner,
-                  nsPresContext* aPresContext, nsInputEvent* aEvent);
+                  nsPresContext* aPresContext,
+                  mozilla::WidgetInputEvent* aEvent);
   virtual ~nsDOMMouseEvent();
 
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIDOMMouseEvent Interface
   NS_DECL_NSIDOMMOUSEEVENT
 
   // Forward to base class
@@ -40,29 +41,29 @@ public:
   }
 
   int32_t ScreenX();
   int32_t ScreenY();
   int32_t ClientX();
   int32_t ClientY();
   bool CtrlKey()
   {
-    return static_cast<nsInputEvent*>(mEvent)->IsControl();
+    return static_cast<mozilla::WidgetInputEvent*>(mEvent)->IsControl();
   }
   bool ShiftKey()
   {
-    return static_cast<nsInputEvent*>(mEvent)->IsShift();
+    return static_cast<mozilla::WidgetInputEvent*>(mEvent)->IsShift();
   }
   bool AltKey()
   {
-    return static_cast<nsInputEvent*>(mEvent)->IsAlt();
+    return static_cast<mozilla::WidgetInputEvent*>(mEvent)->IsAlt();
   }
   bool MetaKey()
   {
-    return static_cast<nsInputEvent*>(mEvent)->IsMeta();
+    return static_cast<mozilla::WidgetInputEvent*>(mEvent)->IsMeta();
   }
   uint16_t Button();
   uint16_t Buttons();
   already_AddRefed<mozilla::dom::EventTarget> GetRelatedTarget();
   void InitMouseEvent(const nsAString & aType, bool aCanBubble, bool aCancelable,
                       nsIDOMWindow* aView, int32_t aDetail, int32_t aScreenX,
                       int32_t aScreenY, int32_t aClientX, int32_t aClientY,
                       bool aCtrlKey, bool aAltKey, bool aShiftKey,
--- a/content/events/src/nsDOMMouseScrollEvent.cpp
+++ b/content/events/src/nsDOMMouseScrollEvent.cpp
@@ -2,19 +2,21 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsDOMMouseScrollEvent.h"
 #include "prtime.h"
 #include "mozilla/MouseEvents.h"
 
+using namespace mozilla;
+
 nsDOMMouseScrollEvent::nsDOMMouseScrollEvent(mozilla::dom::EventTarget* aOwner,
                                              nsPresContext* aPresContext,
-                                             nsInputEvent* aEvent)
+                                             WidgetInputEvent* aEvent)
   : nsDOMMouseEvent(aOwner, aPresContext,
                     aEvent ? aEvent : new nsMouseScrollEvent(false, 0, nullptr))
 {
   if (aEvent) {
     mEventIsInternal = false;
   } else {
     mEventIsInternal = true;
     mEvent->time = PR_Now();
@@ -89,14 +91,14 @@ nsDOMMouseScrollEvent::Axis()
              static_cast<int32_t>(VERTICAL_AXIS);
   }
   return 0;
 }
 
 nsresult NS_NewDOMMouseScrollEvent(nsIDOMEvent** aInstancePtrResult,
                                    mozilla::dom::EventTarget* aOwner,
                                    nsPresContext* aPresContext,
-                                   nsInputEvent *aEvent) 
+                                   WidgetInputEvent* aEvent) 
 {
   nsDOMMouseScrollEvent* it =
     new nsDOMMouseScrollEvent(aOwner, aPresContext, aEvent);
   return CallQueryInterface(it, aInstancePtrResult);
 }
--- a/content/events/src/nsDOMMouseScrollEvent.h
+++ b/content/events/src/nsDOMMouseScrollEvent.h
@@ -10,17 +10,18 @@
 #include "nsDOMMouseEvent.h"
 #include "mozilla/dom/MouseScrollEventBinding.h"
 
 class nsDOMMouseScrollEvent : public nsDOMMouseEvent,
                               public nsIDOMMouseScrollEvent
 {
 public:
   nsDOMMouseScrollEvent(mozilla::dom::EventTarget* aOwner,
-                        nsPresContext* aPresContext, nsInputEvent* aEvent);
+                        nsPresContext* aPresContext,
+                        mozilla::WidgetInputEvent* aEvent);
   virtual ~nsDOMMouseScrollEvent();
 
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIDOMMouseScrollEvent Interface
   NS_DECL_NSIDOMMOUSESCROLLEVENT
   
   // Forward to base class
--- a/content/events/src/nsDOMTouchEvent.cpp
+++ b/content/events/src/nsDOMTouchEvent.cpp
@@ -110,18 +110,18 @@ nsDOMTouchEvent::InitTouchEvent(const ns
                                   aCanBubble,
                                   aCancelable,
                                   aView,
                                   aDetail);
   if (aRv.Failed()) {
     return;
   }
 
-  static_cast<nsInputEvent*>(mEvent)->InitBasicModifiers(aCtrlKey, aAltKey,
-                                                         aShiftKey, aMetaKey);
+  static_cast<WidgetInputEvent*>(mEvent)->
+    InitBasicModifiers(aCtrlKey, aAltKey, aShiftKey, aMetaKey);
   mTouches = aTouches;
   mTargetTouches = aTargetTouches;
   mChangedTouches = aChangedTouches;
 }
 
 nsDOMTouchList*
 nsDOMTouchEvent::Touches()
 {
--- a/content/events/src/nsDOMTouchEvent.h
+++ b/content/events/src/nsDOMTouchEvent.h
@@ -96,32 +96,32 @@ public:
   }
 
   nsDOMTouchList* Touches();
   nsDOMTouchList* TargetTouches();
   nsDOMTouchList* ChangedTouches();
 
   bool AltKey()
   {
-    return static_cast<nsInputEvent*>(mEvent)->IsAlt();
+    return static_cast<mozilla::WidgetInputEvent*>(mEvent)->IsAlt();
   }
 
   bool MetaKey()
   {
-    return static_cast<nsInputEvent*>(mEvent)->IsMeta();
+    return static_cast<mozilla::WidgetInputEvent*>(mEvent)->IsMeta();
   }
 
   bool CtrlKey()
   {
-    return static_cast<nsInputEvent*>(mEvent)->IsControl();
+    return static_cast<mozilla::WidgetInputEvent*>(mEvent)->IsControl();
   }
 
   bool ShiftKey()
   {
-    return static_cast<nsInputEvent*>(mEvent)->IsShift();
+    return static_cast<mozilla::WidgetInputEvent*>(mEvent)->IsShift();
   }
 
   void InitTouchEvent(const nsAString& aType,
                       bool aCanBubble,
                       bool aCancelable,
                       nsIDOMWindow* aView,
                       int32_t aDetail,
                       bool aCtrlKey,
--- a/content/events/src/nsDOMUIEvent.cpp
+++ b/content/events/src/nsDOMUIEvent.cpp
@@ -458,19 +458,19 @@ nsDOMUIEvent::ComputeModifierState(const
 
   return modifiers;
 }
 
 bool
 nsDOMUIEvent::GetModifierStateInternal(const nsAString& aKey)
 {
   if (!mEvent->IsInputDerivedEvent()) {
-    MOZ_CRASH("mEvent must be nsInputEvent or derived class");
+    MOZ_CRASH("mEvent must be WidgetInputEvent or derived class");
   }
-  nsInputEvent* inputEvent = static_cast<nsInputEvent*>(mEvent);
+  WidgetInputEvent* inputEvent = static_cast<WidgetInputEvent*>(mEvent);
   if (aKey.EqualsLiteral(NS_DOM_KEYNAME_SHIFT)) {
     return inputEvent->IsShift();
   }
   if (aKey.EqualsLiteral(NS_DOM_KEYNAME_CONTROL)) {
     return inputEvent->IsControl();
   }
   if (aKey.EqualsLiteral(NS_DOM_KEYNAME_META)) {
     return inputEvent->IsMeta();
--- a/content/events/src/nsDOMXULCommandEvent.cpp
+++ b/content/events/src/nsDOMXULCommandEvent.cpp
@@ -2,21 +2,23 @@
 /* vim:set ts=2 sw=2 sts=2 et cindent: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsDOMXULCommandEvent.h"
 #include "prtime.h"
 
+using namespace mozilla;
+
 nsDOMXULCommandEvent::nsDOMXULCommandEvent(mozilla::dom::EventTarget* aOwner,
                                            nsPresContext* aPresContext,
-                                           nsInputEvent* aEvent)
+                                           WidgetInputEvent* aEvent)
   : nsDOMUIEvent(aOwner, aPresContext,
-                 aEvent ? aEvent : new nsInputEvent(false, 0, nullptr))
+                 aEvent ? aEvent : new WidgetInputEvent(false, 0, nullptr))
 {
   if (aEvent) {
     mEventIsInternal = false;
   }
   else {
     mEventIsInternal = true;
     mEvent->time = PR_Now();
   }
@@ -90,14 +92,14 @@ nsDOMXULCommandEvent::InitCommandEvent(c
 
   return NS_OK;
 }
 
 
 nsresult NS_NewDOMXULCommandEvent(nsIDOMEvent** aInstancePtrResult,
                                   mozilla::dom::EventTarget* aOwner,
                                   nsPresContext* aPresContext,
-                                  nsInputEvent *aEvent) 
+                                  WidgetInputEvent* aEvent) 
 {
   nsDOMXULCommandEvent* it =
     new nsDOMXULCommandEvent(aOwner, aPresContext, aEvent);
   return CallQueryInterface(it, aInstancePtrResult);
 }
--- a/content/events/src/nsDOMXULCommandEvent.h
+++ b/content/events/src/nsDOMXULCommandEvent.h
@@ -13,17 +13,18 @@
 #include "nsIDOMXULCommandEvent.h"
 #include "mozilla/dom/XULCommandEventBinding.h"
 
 class nsDOMXULCommandEvent : public nsDOMUIEvent,
                              public nsIDOMXULCommandEvent
 {
 public:
   nsDOMXULCommandEvent(mozilla::dom::EventTarget* aOwner,
-                       nsPresContext* aPresContext, nsInputEvent* aEvent);
+                       nsPresContext* aPresContext,
+                       mozilla::WidgetInputEvent* aEvent);
 
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(nsDOMXULCommandEvent, nsDOMUIEvent)
   NS_DECL_NSIDOMXULCOMMANDEVENT
 
   // Forward our inherited virtual methods to the base class
   NS_FORWARD_TO_NSDOMUIEVENT
 
@@ -71,16 +72,16 @@ public:
   {
     aRv = InitCommandEvent(aType, aCanBubble, aCancelable, aView, aDetail,
                            aCtrlKey, aAltKey, aShiftKey, aMetaKey,
                            aSourceEvent);
   }
 
 protected:
   // Convenience accessor for the event
-  nsInputEvent* Event() {
-    return static_cast<nsInputEvent*>(mEvent);
+  mozilla::WidgetInputEvent* Event() {
+    return static_cast<mozilla::WidgetInputEvent*>(mEvent);
   }
 
   nsCOMPtr<nsIDOMEvent> mSourceEvent;
 };
 
 #endif  // nsDOMXULCommandEvent_h_
--- a/content/events/src/nsEventDispatcher.cpp
+++ b/content/events/src/nsEventDispatcher.cpp
@@ -705,23 +705,23 @@ nsEventDispatcher::CreateEvent(mozilla::
       return NS_NewDOMKeyboardEvent(aDOMEvent, aOwner, aPresContext,
                                     static_cast<WidgetKeyboardEvent*>(aEvent));
     case NS_COMPOSITION_EVENT:
       return NS_NewDOMCompositionEvent(
         aDOMEvent, aOwner,
         aPresContext, static_cast<WidgetCompositionEvent*>(aEvent));
     case NS_MOUSE_EVENT:
       return NS_NewDOMMouseEvent(aDOMEvent, aOwner, aPresContext,
-                                 static_cast<nsInputEvent*>(aEvent));
+                                 static_cast<WidgetInputEvent*>(aEvent));
     case NS_FOCUS_EVENT:
       return NS_NewDOMFocusEvent(aDOMEvent, aOwner, aPresContext,
                                  static_cast<InternalFocusEvent*>(aEvent));
     case NS_MOUSE_SCROLL_EVENT:
       return NS_NewDOMMouseScrollEvent(aDOMEvent, aOwner, aPresContext,
-                                 static_cast<nsInputEvent*>(aEvent));
+                                       static_cast<WidgetInputEvent*>(aEvent));
     case NS_WHEEL_EVENT:
       return NS_NewDOMWheelEvent(aDOMEvent, aOwner, aPresContext,
                                  static_cast<WheelEvent*>(aEvent));
     case NS_DRAG_EVENT:
       return NS_NewDOMDragEvent(aDOMEvent, aOwner, aPresContext,
                                  static_cast<nsDragEvent*>(aEvent));
     case NS_TEXT_EVENT:
       return NS_NewDOMTextEvent(aDOMEvent, aOwner, aPresContext,
--- a/content/events/src/nsEventStateManager.cpp
+++ b/content/events/src/nsEventStateManager.cpp
@@ -3395,20 +3395,19 @@ nsEventStateManager::PostHandleEvent(nsP
             // in chrome, instead of handling it in content.
             if (dispatchedToContentProcess)
               break;
 
             EnsureDocument(mPresContext);
             nsIFocusManager* fm = nsFocusManager::GetFocusManager();
             if (fm && mDocument) {
               // Shift focus forward or back depending on shift key
-              bool isDocMove = ((nsInputEvent*)aEvent)->IsControl() ||
-                                 (keyEvent->keyCode == NS_VK_F6);
-              uint32_t dir =
-                static_cast<nsInputEvent*>(aEvent)->IsShift() ?
+              bool isDocMove =
+                keyEvent->IsControl() || keyEvent->keyCode == NS_VK_F6;
+              uint32_t dir = keyEvent->IsShift() ?
                   (isDocMove ? static_cast<uint32_t>(nsIFocusManager::MOVEFOCUS_BACKWARDDOC) :
                                static_cast<uint32_t>(nsIFocusManager::MOVEFOCUS_BACKWARD)) :
                   (isDocMove ? static_cast<uint32_t>(nsIFocusManager::MOVEFOCUS_FORWARDDOC) :
                                static_cast<uint32_t>(nsIFocusManager::MOVEFOCUS_FORWARD));
               nsCOMPtr<nsIDOMElement> result;
               fm->MoveFocus(mDocument->GetWindow(), nullptr, dir,
                             nsIFocusManager::FLAG_BYKEY,
                             getter_AddRefs(result));
--- a/content/html/content/src/HTMLInputElement.cpp
+++ b/content/html/content/src/HTMLInputElement.cpp
@@ -3691,17 +3691,18 @@ HTMLInputElement::PostHandleEventForRang
     case NS_MOUSE_BUTTON_DOWN:
     case NS_TOUCH_START: {
       if (mIsDraggingRange) {
         break;
       }
       if (nsIPresShell::GetCapturingContent()) {
         break; // don't start drag if someone else is already capturing
       }
-      nsInputEvent* inputEvent = static_cast<nsInputEvent*>(aVisitor.mEvent);
+      WidgetInputEvent* inputEvent =
+        static_cast<WidgetInputEvent*>(aVisitor.mEvent);
       if (inputEvent->IsShift() || inputEvent->IsControl() ||
           inputEvent->IsAlt() || inputEvent->IsMeta() ||
           inputEvent->IsAltGraph() || inputEvent->IsFn() ||
           inputEvent->IsOS()) {
         break; // ignore
       }
       if (aVisitor.mEvent->message == NS_MOUSE_BUTTON_DOWN) {
         nsMouseEvent* mouseEvent = static_cast<nsMouseEvent*>(aVisitor.mEvent);
@@ -3727,31 +3728,32 @@ HTMLInputElement::PostHandleEventForRang
       if (!mIsDraggingRange) {
         break;
       }
       if (nsIPresShell::GetCapturingContent() != this) {
         // Someone else grabbed capture.
         CancelRangeThumbDrag();
         break;
       }
-      SetValueOfRangeForUserEvent(rangeFrame->GetValueAtEventPoint(
-                                    static_cast<nsInputEvent*>(aVisitor.mEvent)));
+      SetValueOfRangeForUserEvent(
+        rangeFrame->GetValueAtEventPoint(
+          static_cast<WidgetInputEvent*>(aVisitor.mEvent)));
       aVisitor.mEvent->mFlags.mMultipleActionsPrevented = true;
       break;
 
     case NS_MOUSE_BUTTON_UP:
     case NS_TOUCH_END:
       if (!mIsDraggingRange) {
         break;
       }
       // We don't check to see whether we are the capturing content here and
       // call CancelRangeThumbDrag() if that is the case. We just finish off
       // the drag and set our final value (unless someone has called
       // preventDefault() and prevents us getting here).
-      FinishRangeThumbDrag(static_cast<nsInputEvent*>(aVisitor.mEvent));
+      FinishRangeThumbDrag(static_cast<WidgetInputEvent*>(aVisitor.mEvent));
       aVisitor.mEvent->mFlags.mMultipleActionsPrevented = true;
       break;
 
     case NS_KEY_PRESS:
       if (mIsDraggingRange &&
           static_cast<WidgetKeyboardEvent*>(aVisitor.mEvent)->keyCode ==
             NS_VK_ESCAPE) {
         CancelRangeThumbDrag();
--- a/content/html/content/src/HTMLLabelElement.cpp
+++ b/content/html/content/src/HTMLLabelElement.cpp
@@ -192,17 +192,17 @@ HTMLLabelElement::PostHandleEvent(nsEven
           //    sensible, we might send more events through like
           //    this.)  See bug 7554, bug 49897, and bug 96813.
           nsEventStatus status = aVisitor.mEventStatus;
           // Ok to use aVisitor.mEvent as parameter because DispatchClickEvent
           // will actually create a new event.
           EventFlags eventFlags;
           eventFlags.mMultipleActionsPrevented = true;
           DispatchClickEvent(aVisitor.mPresContext,
-                             static_cast<nsInputEvent*>(aVisitor.mEvent),
+                             static_cast<WidgetInputEvent*>(aVisitor.mEvent),
                              content, false, &eventFlags, &status);
           // Do we care about the status this returned?  I don't think we do...
           // Don't run another <label> off of this click
           aVisitor.mEvent->mFlags.mMultipleActionsPrevented = true;
         }
         break;
     }
     mHandlingEvent = false;
--- a/content/xbl/src/nsXBLPrototypeHandler.cpp
+++ b/content/xbl/src/nsXBLPrototypeHandler.cpp
@@ -907,17 +907,17 @@ nsXBLPrototypeHandler::ReportKeyConflict
 }
 
 bool
 nsXBLPrototypeHandler::ModifiersMatchMask(nsIDOMUIEvent* aEvent,
                                           bool aIgnoreShiftKey)
 {
   nsEvent* event = aEvent->GetInternalNSEvent();
   NS_ENSURE_TRUE(event && event->IsInputDerivedEvent(), false);
-  nsInputEvent* inputEvent = static_cast<nsInputEvent*>(event);
+  WidgetInputEvent* inputEvent = static_cast<WidgetInputEvent*>(event);
 
   if (mKeyMask & cMetaMask) {
     if (inputEvent->IsMeta() != ((mKeyMask & cMeta) != 0)) {
       return false;
     }
   }
 
   if (mKeyMask & cOSMask) {
--- a/content/xul/content/src/nsXULElement.cpp
+++ b/content/xul/content/src/nsXULElement.cpp
@@ -1185,18 +1185,18 @@ nsXULElement::PreHandleEvent(nsEventChai
                         do_QueryInterface(domEvent);
                     if (commandEvent) {
                         commandEvent->GetSourceEvent(getter_AddRefs(domEvent));
                     } else {
                         domEvent = nullptr;
                     }
                 }
 
-                nsInputEvent* orig =
-                    static_cast<nsInputEvent*>(aVisitor.mEvent);
+                WidgetInputEvent* orig =
+                    static_cast<WidgetInputEvent*>(aVisitor.mEvent);
                 nsContentUtils::DispatchXULCommand(
                   commandContent,
                   aVisitor.mEvent->mFlags.mIsTrusted,
                   aVisitor.mDOMEvent,
                   nullptr,
                   orig->IsControl(),
                   orig->IsAlt(),
                   orig->IsShift(),
--- a/dom/interfaces/events/nsIDOMEvent.idl
+++ b/dom/interfaces/events/nsIDOMEvent.idl
@@ -237,27 +237,27 @@ nsresult
 NS_NewDOMUIEvent(nsIDOMEvent** aInstancePtrResult,
                  mozilla::dom::EventTarget* aOwner,
                  nsPresContext* aPresContext,
                  nsGUIEvent* aEvent);
 nsresult
 NS_NewDOMMouseEvent(nsIDOMEvent** aInstancePtrResult,
                     mozilla::dom::EventTarget* aOwner,
                     nsPresContext* aPresContext,
-                    nsInputEvent* aEvent);
+                    mozilla::WidgetInputEvent* aEvent);
 nsresult
 NS_NewDOMFocusEvent(nsIDOMEvent** aInstancePtrResult,
                     mozilla::dom::EventTarget* aOwner,
                     nsPresContext* aPresContext,
                     mozilla::InternalFocusEvent* aEvent);
 nsresult
 NS_NewDOMMouseScrollEvent(nsIDOMEvent** aInstancePtrResult,
                           mozilla::dom::EventTarget* aOwner,
                           nsPresContext* aPresContext,
-                          nsInputEvent* aEvent);
+                          mozilla::WidgetInputEvent* aEvent);
 nsresult
 NS_NewDOMWheelEvent(nsIDOMEvent** aInstancePtrResult,
                     mozilla::dom::EventTarget* aOwner,
                     nsPresContext* aPresContext,
                     mozilla::WheelEvent* aEvent);
 nsresult
 NS_NewDOMDragEvent(nsIDOMEvent** aInstancePtrResult,
                    mozilla::dom::EventTarget* aOwner,
@@ -313,17 +313,17 @@ nsresult
 NS_NewDOMTimeEvent(nsIDOMEvent** aResult,
                    mozilla::dom::EventTarget* aOwner,
                    nsPresContext* aPresContext,
                    nsEvent* aEvent);
 nsresult
 NS_NewDOMXULCommandEvent(nsIDOMEvent** aResult,
                          mozilla::dom::EventTarget* aOwner,
                          nsPresContext* aPresContext,
-                         nsInputEvent* aEvent);
+                         mozilla::WidgetInputEvent* aEvent);
 nsresult
 NS_NewDOMCommandEvent(nsIDOMEvent** aInstancePtrResult,
                       mozilla::dom::EventTarget* aOwner,
                       nsPresContext* aPresContext,
                       mozilla::WidgetCommandEvent* aEvent);
 nsresult
 NS_NewDOMMessageEvent(nsIDOMEvent** aInstancePtrResult,
                       mozilla::dom::EventTarget* aOwner,
--- a/dom/ipc/TabParent.cpp
+++ b/dom/ipc/TabParent.cpp
@@ -1527,18 +1527,18 @@ TabParent::UseAsyncPanZoom()
   bool usingOffMainThreadCompositing = !!CompositorParent::CompositorLoop();
   bool asyncPanZoomEnabled =
     Preferences::GetBool("layers.async-pan-zoom.enabled", false);
   return (usingOffMainThreadCompositing && asyncPanZoomEnabled &&
           GetScrollingBehavior() == ASYNC_PAN_ZOOM);
 }
 
 void
-TabParent::MaybeForwardEventToRenderFrame(const nsInputEvent& aEvent,
-                                          nsInputEvent* aOutEvent)
+TabParent::MaybeForwardEventToRenderFrame(const WidgetInputEvent& aEvent,
+                                          WidgetInputEvent* aOutEvent)
 {
   if (RenderFrameParent* rfp = GetRenderFrame()) {
     rfp->NotifyInputEvent(aEvent, aOutEvent);
   }
 }
 
 bool
 TabParent::RecvBrowserFrameOpenWindow(PBrowserParent* aOpener,
--- a/dom/ipc/TabParent.h
+++ b/dom/ipc/TabParent.h
@@ -319,18 +319,18 @@ private:
 
     // When true, we create a pan/zoom controller for our frame and
     // notify it of input events targeting us.
     bool UseAsyncPanZoom();
     // If we have a render frame currently, notify it that we're about
     // to dispatch |aEvent| to our child.  If there's a relevant
     // transform in place, |aOutEvent| is the transformed |aEvent| to
     // dispatch to content.
-    void MaybeForwardEventToRenderFrame(const nsInputEvent& aEvent,
-                                        nsInputEvent* aOutEvent);
+    void MaybeForwardEventToRenderFrame(const WidgetInputEvent& aEvent,
+                                        WidgetInputEvent* aOutEvent);
     // The offset for the child process which is sampled at touch start. This
     // means that the touch events are relative to where the frame was at the
     // start of the touch. We need to look for a better solution to this
     // problem see bug 872911.
     LayoutDeviceIntPoint mChildProcessOffsetAtTouchStart;
     // When true, we've initiated normal shutdown and notified our
     // managing PContent.
     bool mMarkedDestroying;
--- a/dom/plugins/base/nsPluginInstanceOwner.cpp
+++ b/dom/plugins/base/nsPluginInstanceOwner.cpp
@@ -1958,17 +1958,17 @@ nsPluginInstanceOwner::HandleEvent(nsIDO
 
     // Let the plugin handle drag events.
     aEvent->StopPropagation();
   }
   return NS_OK;
 }
 
 #ifdef MOZ_X11
-static unsigned int XInputEventState(const nsInputEvent& anEvent)
+static unsigned int XInputEventState(const WidgetInputEvent& anEvent)
 {
   unsigned int state = 0;
   if (anEvent.IsShift()) state |= ShiftMask;
   if (anEvent.IsControl()) state |= ControlMask;
   if (anEvent.IsAlt()) state |= Mod1Mask;
   if (anEvent.IsMeta()) state |= Mod4Mask;
   return state;
 }
--- a/gfx/layers/composite/APZCTreeManager.cpp
+++ b/gfx/layers/composite/APZCTreeManager.cpp
@@ -373,36 +373,36 @@ APZCTreeManager::ProcessMouseEvent(const
   MultiTouchInput inputForApzc(aEvent);
   ApplyTransform(&(inputForApzc.mTouches[0].mScreenPoint), transformToApzc);
   gfx3DMatrix outTransform = transformToApzc * transformToScreen;
   ApplyTransform(&(static_cast<nsMouseEvent*>(aOutEvent)->refPoint), outTransform);
   return apzc->ReceiveInputEvent(inputForApzc);
 }
 
 nsEventStatus
-APZCTreeManager::ProcessEvent(const nsInputEvent& aEvent,
-                              nsInputEvent* aOutEvent)
+APZCTreeManager::ProcessEvent(const WidgetInputEvent& aEvent,
+                              WidgetInputEvent* aOutEvent)
 {
   // Transform the refPoint
   nsRefPtr<AsyncPanZoomController> apzc = GetTargetAPZC(ScreenPoint(aEvent.refPoint.x, aEvent.refPoint.y));
   if (!apzc) {
     return nsEventStatus_eIgnore;
   }
   gfx3DMatrix transformToApzc;
   gfx3DMatrix transformToScreen;
   GetInputTransforms(apzc, transformToApzc, transformToScreen);
   ApplyTransform(&(aOutEvent->refPoint), transformToApzc);
   gfx3DMatrix outTransform = transformToApzc * transformToScreen;
   ApplyTransform(&(aOutEvent->refPoint), outTransform);
   return nsEventStatus_eIgnore;
 }
 
 nsEventStatus
-APZCTreeManager::ReceiveInputEvent(const nsInputEvent& aEvent,
-                                   nsInputEvent* aOutEvent)
+APZCTreeManager::ReceiveInputEvent(const WidgetInputEvent& aEvent,
+                                   WidgetInputEvent* aOutEvent)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   switch (aEvent.eventStructType) {
     case NS_TOUCH_EVENT: {
       const WidgetTouchEvent& touchEvent =
         static_cast<const WidgetTouchEvent&>(aEvent);
       if (!touchEvent.touches.Length()) {
@@ -426,17 +426,17 @@ APZCTreeManager::ReceiveInputEvent(const
     }
     default: {
       return ProcessEvent(aEvent, aOutEvent);
     }
   }
 }
 
 nsEventStatus
-APZCTreeManager::ReceiveInputEvent(nsInputEvent& aEvent)
+APZCTreeManager::ReceiveInputEvent(WidgetInputEvent& aEvent)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   switch (aEvent.eventStructType) {
     case NS_TOUCH_EVENT: {
       WidgetTouchEvent& touchEvent = static_cast<WidgetTouchEvent&>(aEvent);
       if (!touchEvent.touches.Length()) {
         return nsEventStatus_eIgnore;
--- a/gfx/layers/composite/APZCTreeManager.h
+++ b/gfx/layers/composite/APZCTreeManager.h
@@ -7,17 +7,17 @@
 #define mozilla_layers_APZCTreeManager_h
 
 #include <stdint.h>                     // for uint64_t, uint32_t
 #include "FrameMetrics.h"               // for FrameMetrics, etc
 #include "Units.h"                      // for CSSPoint, CSSRect, etc
 #include "gfxPoint.h"                   // for gfxPoint
 #include "gfx3DMatrix.h"                // for gfx3DMatrix
 #include "mozilla/Assertions.h"         // for MOZ_ASSERT_HELPER2
-#include "mozilla/EventForwards.h"      // for nsInputEvent, nsEventStatus
+#include "mozilla/EventForwards.h"      // for WidgetInputEvent, nsEventStatus
 #include "mozilla/Monitor.h"            // for Monitor
 #include "nsAutoPtr.h"                  // for nsRefPtr
 #include "nsCOMPtr.h"                   // for already_AddRefed
 #include "nsISupportsImpl.h"
 #include "nsTraceRefcnt.h"              // for MOZ_COUNT_CTOR, etc
 
 class gfx3DMatrix;
 template <class E> class nsTArray;
@@ -141,40 +141,40 @@ public:
   /**
    * General handler for incoming input events. Manipulates the frame metrics
    * based on what type of input it is. For example, a PinchGestureEvent will
    * cause scaling. This should only be called externally to this class.
    */
   nsEventStatus ReceiveInputEvent(const InputData& aEvent);
 
   /**
-   * nsInputEvent handler. Sets |aOutEvent| (which is assumed to be an
-   * already-existing instance of an nsInputEvent which may be an
+   * WidgetInputEvent handler. Sets |aOutEvent| (which is assumed to be an
+   * already-existing instance of an WidgetInputEvent which may be an
    * WidgetTouchEvent) to have its coordinates in DOM space. This is so that the
    * event can be passed through the DOM and content can handle them.
    *
-   * NOTE: Be careful of invoking the nsInputEvent variant. This can only be
+   * NOTE: Be careful of invoking the WidgetInputEvent variant. This can only be
    * called on the main thread. See widget/InputData.h for more information on
-   * why we have InputData and nsInputEvent separated.
+   * why we have InputData and WidgetInputEvent separated.
    * NOTE: On unix, mouse events are treated as touch and are forwarded
    * to the appropriate apz as such.
    *
    * @param aEvent input event object, will not be modified
    * @param aOutEvent event object transformed to DOM coordinate space.
    */
-  nsEventStatus ReceiveInputEvent(const nsInputEvent& aEvent,
-                                  nsInputEvent* aOutEvent);
+  nsEventStatus ReceiveInputEvent(const WidgetInputEvent& aEvent,
+                                  WidgetInputEvent* aOutEvent);
 
   /**
-   * nsInputEvent handler with inline dom transform of the passed in
-   * nsInputEvent. Must be called on the main thread.
+   * WidgetInputEvent handler with inline dom transform of the passed in
+   * WidgetInputEvent. Must be called on the main thread.
    *
    * @param aEvent input event object
    */
-  nsEventStatus ReceiveInputEvent(nsInputEvent& aEvent);
+  nsEventStatus ReceiveInputEvent(WidgetInputEvent& aEvent);
 
   /**
    * Updates the composition bounds, i.e. the dimensions of the final size of
    * the frame this is tied to during composition onto, in device pixels. In
    * general, this will just be:
    * { x = 0, y = 0, width = surface.width, height = surface.height }, however
    * there is no hard requirement for this.
    */
@@ -298,17 +298,17 @@ private:
   /* Helpers */
   AsyncPanZoomController* FindTargetAPZC(AsyncPanZoomController* aApzc, const ScrollableLayerGuid& aGuid);
   AsyncPanZoomController* GetAPZCAtPoint(AsyncPanZoomController* aApzc, const gfxPoint& aHitTestPoint);
   AsyncPanZoomController* CommonAncestor(AsyncPanZoomController* aApzc1, AsyncPanZoomController* aApzc2);
   AsyncPanZoomController* RootAPZCForLayersId(AsyncPanZoomController* aApzc);
   AsyncPanZoomController* GetTouchInputBlockAPZC(const WidgetTouchEvent& aEvent, ScreenPoint aPoint);
   nsEventStatus ProcessTouchEvent(const WidgetTouchEvent& touchEvent, WidgetTouchEvent* aOutEvent);
   nsEventStatus ProcessMouseEvent(const nsMouseEvent& mouseEvent, nsMouseEvent* aOutEvent);
-  nsEventStatus ProcessEvent(const nsInputEvent& inputEvent, nsInputEvent* aOutEvent);
+  nsEventStatus ProcessEvent(const WidgetInputEvent& inputEvent, WidgetInputEvent* aOutEvent);
 
   /**
    * Recursive helper function to build the APZC tree. The tree of APZC instances has
    * the same shape as the layer tree, but excludes all the layers that are not scrollable.
    * Note that this means APZCs corresponding to layers at different depths in the tree
    * may end up becoming siblings. It also means that the "root" APZC may have siblings.
    * This function walks the layer tree backwards through siblings and constructs the APZC
    * tree also as a last-child-prev-sibling tree because that simplifies the hit detection
--- a/layout/base/nsPresShell.h
+++ b/layout/base/nsPresShell.h
@@ -558,17 +558,17 @@ protected:
         w->DispatchEvent(mEvent, status);
       }
     }
 
   protected:
     nsDelayedInputEvent()
     : nsDelayedEvent(), mEvent(nullptr) {}
 
-    nsInputEvent* mEvent;
+    mozilla::WidgetInputEvent* mEvent;
   };
 
   class nsDelayedMouseEvent : public nsDelayedInputEvent
   {
   public:
     nsDelayedMouseEvent(nsMouseEvent* aEvent) : nsDelayedInputEvent()
     {
       mEvent = new nsMouseEvent(aEvent->mFlags.mIsTrusted,
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -2581,19 +2581,18 @@ nsFrame::HandlePress(nsPresContext* aPre
 
   // if we are in Navigator and the click is in a draggable node, we don't want
   // to start selection because we don't want to interfere with a potential
   // drag of said node and steal all its glory.
   int16_t isEditor = shell->GetSelectionFlags();
   //weaaak. only the editor can display frame selection not just text and images
   isEditor = isEditor == nsISelectionDisplay::DISPLAY_ALL;
 
-  nsInputEvent* keyEvent = (nsInputEvent*)aEvent;
+  WidgetInputEvent* keyEvent = static_cast<WidgetInputEvent*>(aEvent);
   if (!keyEvent->IsAlt()) {
-    
     for (nsIContent* content = mContent; content;
          content = content->GetParent()) {
       if (nsContentUtils::ContentIsDraggable(content) &&
           !content->IsEditable()) {
         // coordinate stuff is the fix for bug #55921
         if ((mRect - GetPosition()).Contains(
                nsLayoutUtils::GetEventCoordinatesRelativeTo(aEvent, this)))
           return NS_OK;
--- a/layout/ipc/RenderFrameParent.cpp
+++ b/layout/ipc/RenderFrameParent.cpp
@@ -821,18 +821,18 @@ void
 RenderFrameParent::OwnerContentChanged(nsIContent* aContent)
 {
   NS_ABORT_IF_FALSE(mFrameLoader->GetOwnerContent() == aContent,
                     "Don't build new map if owner is same!");
   BuildViewMap();
 }
 
 void
-RenderFrameParent::NotifyInputEvent(const nsInputEvent& aEvent,
-                                    nsInputEvent* aOutEvent)
+RenderFrameParent::NotifyInputEvent(const WidgetInputEvent& aEvent,
+                                    WidgetInputEvent* aOutEvent)
 {
   if (GetApzcTreeManager()) {
     GetApzcTreeManager()->ReceiveInputEvent(aEvent, aOutEvent);
   }
 }
 
 void
 RenderFrameParent::NotifyDimensionsChanged(ScreenIntSize size)
--- a/layout/ipc/RenderFrameParent.h
+++ b/layout/ipc/RenderFrameParent.h
@@ -88,18 +88,18 @@ public:
                                      const nsIntRect& aVisibleRect,
                                      nsDisplayItem* aItem,
                                      const ContainerParameters& aContainerParameters);
 
   void OwnerContentChanged(nsIContent* aContent);
 
   void SetBackgroundColor(nscolor aColor) { mBackgroundColor = gfxRGBA(aColor); };
 
-  void NotifyInputEvent(const nsInputEvent& aEvent,
-                        nsInputEvent* aOutEvent);
+  void NotifyInputEvent(const WidgetInputEvent& aEvent,
+                        WidgetInputEvent* aOutEvent);
 
   void NotifyDimensionsChanged(ScreenIntSize size);
 
   void ZoomToRect(const CSSRect& aRect);
 
   void ContentReceivedTouch(bool aPreventDefault);
 
   void UpdateZoomConstraints(bool aAllowZoom,
--- a/layout/xul/base/src/nsButtonBoxFrame.cpp
+++ b/layout/xul/base/src/nsButtonBoxFrame.cpp
@@ -124,20 +124,20 @@ nsButtonBoxFrame::DoMouseClick(nsGUIEven
     return;
 
   // Execute the oncommand event handler.
   bool isShift = false;
   bool isControl = false;
   bool isAlt = false;
   bool isMeta = false;
   if(aEvent) {
-    isShift = ((nsInputEvent*)(aEvent))->IsShift();
-    isControl = ((nsInputEvent*)(aEvent))->IsControl();
-    isAlt = ((nsInputEvent*)(aEvent))->IsAlt();
-    isMeta = ((nsInputEvent*)(aEvent))->IsMeta();
+    isShift = static_cast<WidgetInputEvent*>(aEvent)->IsShift();
+    isControl = static_cast<WidgetInputEvent*>(aEvent)->IsControl();
+    isAlt = static_cast<WidgetInputEvent*>(aEvent)->IsAlt();
+    isMeta = static_cast<WidgetInputEvent*>(aEvent)->IsMeta();
   }
 
   // Have the content handle the event, propagating it according to normal DOM rules.
   nsCOMPtr<nsIPresShell> shell = PresContext()->GetPresShell();
   if (shell) {
     nsContentUtils::DispatchXULCommand(mContent,
                                        aEvent ?
                                          aEvent->mFlags.mIsTrusted : aTrustEvent,
--- a/layout/xul/base/src/nsMenuBarListener.cpp
+++ b/layout/xul/base/src/nsMenuBarListener.cpp
@@ -265,18 +265,18 @@ nsMenuBarListener::IsAccessKeyPressed(ns
           (modifiers & mAccessKeyMask) &&
           (modifiers & ~(mAccessKeyMask | MODIFIER_SHIFT)) == 0);
 }
 
 uint32_t
 nsMenuBarListener::GetModifiers(nsIDOMKeyEvent* aKeyEvent)
 {
   uint32_t modifiers = 0;
-  nsInputEvent* inputEvent =
-    static_cast<nsInputEvent*>(aKeyEvent->GetInternalNSEvent());
+  WidgetInputEvent* inputEvent =
+    static_cast<WidgetInputEvent*>(aKeyEvent->GetInternalNSEvent());
   MOZ_ASSERT(inputEvent);
 
   if (inputEvent->IsShift()) {
     modifiers |= MODIFIER_SHIFT;
   }
 
   if (inputEvent->IsControl()) {
     modifiers |= MODIFIER_CONTROL;
--- a/layout/xul/base/src/nsMenuFrame.cpp
+++ b/layout/xul/base/src/nsMenuFrame.cpp
@@ -1243,20 +1243,20 @@ nsMenuFrame::CreateMenuCommandEvent(nsGU
   // we're called from chrome code (since at least one of our caller
   // passes in a null event).
   bool isTrusted = aEvent ? aEvent->mFlags.mIsTrusted :
                               nsContentUtils::IsCallerChrome();
 
   bool shift = false, control = false, alt = false, meta = false;
   if (aEvent && (aEvent->eventStructType == NS_MOUSE_EVENT ||
                  aEvent->eventStructType == NS_KEY_EVENT)) {
-    shift = static_cast<nsInputEvent *>(aEvent)->IsShift();
-    control = static_cast<nsInputEvent *>(aEvent)->IsControl();
-    alt = static_cast<nsInputEvent *>(aEvent)->IsAlt();
-    meta = static_cast<nsInputEvent *>(aEvent)->IsMeta();
+    shift = static_cast<WidgetInputEvent*>(aEvent)->IsShift();
+    control = static_cast<WidgetInputEvent*>(aEvent)->IsControl();
+    alt = static_cast<WidgetInputEvent*>(aEvent)->IsAlt();
+    meta = static_cast<WidgetInputEvent*>(aEvent)->IsMeta();
   }
 
   // Because the command event is firing asynchronously, a flag is needed to
   // indicate whether user input is being handled. This ensures that a popup
   // window won't get blocked.
   bool userinput = nsEventStateManager::IsHandlingUserInput();
 
   mDelayedMenuCommandEvent =
--- a/layout/xul/base/src/nsXULPopupManager.cpp
+++ b/layout/xul/base/src/nsXULPopupManager.cpp
@@ -477,17 +477,17 @@ nsXULPopupManager::InitTriggerEvent(nsID
 
     // get the event coordinates relative to the root frame of the document
     // containing the popup.
     NS_ASSERTION(aPopup, "Expected a popup node");
     nsEvent* event = aEvent->GetInternalNSEvent();
     if (event) {
       if (event->eventStructType == NS_MOUSE_EVENT ||
           event->eventStructType == NS_KEY_EVENT) {
-        mCachedModifiers = static_cast<nsInputEvent*>(event)->modifiers;
+        mCachedModifiers = static_cast<WidgetInputEvent*>(event)->modifiers;
       }
       nsIDocument* doc = aPopup->GetCurrentDoc();
       if (doc) {
         nsIPresShell* presShell = doc->GetShell();
         nsPresContext* presContext;
         if (presShell && (presContext = presShell->GetPresContext())) {
           nsPresContext* rootDocPresContext =
             presContext->GetRootPresContext();
--- a/widget/BasicEvents.h
+++ b/widget/BasicEvents.h
@@ -1020,11 +1020,10 @@ public:
   }
 };
 
 } // namespace mozilla
 
 // TODO: Remove following typedefs
 typedef mozilla::WidgetEvent      nsEvent;
 typedef mozilla::WidgetGUIEvent   nsGUIEvent;
-typedef mozilla::WidgetInputEvent nsInputEvent;
 
 #endif // mozilla_BasicEvents_h__
--- a/widget/EventForwards.h
+++ b/widget/EventForwards.h
@@ -100,17 +100,16 @@ class WidgetPluginEvent;
 
 // MutationEvent.h (content/events/public)
 class InternalMutationEvent;
 } // namespace mozilla
 
 // TODO: Remove following typedefs
 typedef mozilla::WidgetEvent               nsEvent;
 typedef mozilla::WidgetGUIEvent            nsGUIEvent;
-typedef mozilla::WidgetInputEvent          nsInputEvent;
 typedef mozilla::WidgetMouseEventBase      nsMouseEvent_base;
 typedef mozilla::WidgetMouseEvent          nsMouseEvent;
 typedef mozilla::WidgetDragEvent           nsDragEvent;
 typedef mozilla::WidgetMouseScrollEvent    nsMouseScrollEvent;
 
 namespace mozilla {
 typedef WidgetWheelEvent                   WheelEvent;
 }
--- a/widget/InputData.h
+++ b/widget/InputData.h
@@ -39,18 +39,19 @@ class TapGestureInput;
 
 /** Base input data class. Should never be instantiated. */
 class InputData
 {
 public:
   InputType mInputType;
   // Time in milliseconds that this data is relevant to. This only really
   // matters when this data is used as an event. We use uint32_t instead of
-  // TimeStamp because it is easier to convert from nsInputEvent. The time is
-  // platform-specific but it in the case of B2G and Fennec it is since startup.
+  // TimeStamp because it is easier to convert from WidgetInputEvent. The time
+  // is platform-specific but it in the case of B2G and Fennec it is since
+  // startup.
   uint32_t mTime;
 
   INPUTDATA_AS_CHILD_TYPE(MultiTouchInput, MULTITOUCH_INPUT)
   INPUTDATA_AS_CHILD_TYPE(PinchGestureInput, PINCHGESTURE_INPUT)
   INPUTDATA_AS_CHILD_TYPE(TapGestureInput, TAPGESTURE_INPUT)
 
   InputData()
   {
--- a/widget/android/nsWindow.cpp
+++ b/widget/android/nsWindow.cpp
@@ -1309,17 +1309,17 @@ nsWindow::DispatchGestureEvent(uint32_t 
     event.time = time;
     event.refPoint = LayoutDeviceIntPoint::FromUntyped(refPoint);
 
     DispatchEvent(&event);
 }
 
 
 void
-nsWindow::DispatchMotionEvent(nsInputEvent &event, AndroidGeckoEvent *ae,
+nsWindow::DispatchMotionEvent(WidgetInputEvent &event, AndroidGeckoEvent *ae,
                               const nsIntPoint &refPoint)
 {
     nsIntPoint offset = WidgetToScreenOffset();
 
     event.modifiers = 0;
     event.time = ae->Time();
 
     // XXX possibly bound the range of event.refPoint here.
--- a/widget/android/nsWindow.h
+++ b/widget/android/nsWindow.h
@@ -219,17 +219,17 @@ protected:
     static void DumpWindows();
     static void DumpWindows(const nsTArray<nsWindow*>& wins, int indent = 0);
     static void LogWindow(nsWindow *win, int index, int indent);
 
 private:
     void InitKeyEvent(mozilla::WidgetKeyboardEvent& event,
                       mozilla::AndroidGeckoEvent& key,
                       ANPEvent* pluginEvent);
-    void DispatchMotionEvent(nsInputEvent &event,
+    void DispatchMotionEvent(mozilla::WidgetInputEvent &event,
                              mozilla::AndroidGeckoEvent *ae,
                              const nsIntPoint &refPoint);
     void DispatchGestureEvent(uint32_t msg, uint32_t direction, double delta,
                               const nsIntPoint &refPoint, uint64_t time);
     void HandleSpecialKey(mozilla::AndroidGeckoEvent *ae);
     void CreateLayerManager(int aCompositorWidth, int aCompositorHeight);
     void RedrawAll();
 
--- a/widget/cocoa/TextInputHandler.mm
+++ b/widget/cocoa/TextInputHandler.mm
@@ -4173,17 +4173,17 @@ TextInputHandlerBase::OnDestroyWidget(ns
   mWidget = nullptr;
   return true;
 }
 
 bool
 TextInputHandlerBase::DispatchEvent(nsGUIEvent& aEvent)
 {
   if (aEvent.message == NS_KEY_PRESS) {
-    nsInputEvent& inputEvent = static_cast<nsInputEvent&>(aEvent);
+    WidgetInputEvent& inputEvent = static_cast<WidgetInputEvent&>(aEvent);
     if (!inputEvent.IsMeta()) {
       PR_LOG(gLog, PR_LOG_ALWAYS,
         ("%p TextInputHandlerBase::DispatchEvent, hiding mouse cursor", this));
       [NSCursor setHiddenUntilMouseMoves:YES];
     }
   }
   return mWidget->DispatchWindowEvent(aEvent);
 }
--- a/widget/cocoa/nsChildView.mm
+++ b/widget/cocoa/nsChildView.mm
@@ -135,17 +135,18 @@ uint32_t nsChildView::sLastInputEventCou
 
 @interface ChildView(Private)
 
 // sets up our view, attaching it to its owning gecko view
 - (id)initWithFrame:(NSRect)inFrame geckoChild:(nsChildView*)inChild;
 - (void)forceRefreshOpenGL;
 
 // set up a gecko mouse event based on a cocoa mouse event
-- (void) convertCocoaMouseEvent:(NSEvent*)aMouseEvent toGeckoEvent:(nsInputEvent*)outGeckoEvent;
+- (void) convertCocoaMouseEvent:(NSEvent*)aMouseEvent
+                   toGeckoEvent:(WidgetInputEvent*)outGeckoEvent;
 
 - (NSMenu*)contextMenu;
 
 - (void)setIsPluginView:(BOOL)aIsPlugin;
 - (void)setPluginEventModel:(NPEventModel)eventModel;
 - (void)setPluginDrawingModel:(NPDrawingModel)drawingModel;
 - (NPDrawingModel)pluginDrawingModel;
 
@@ -4828,17 +4829,18 @@ static int32_t RoundUp(double aDouble)
   if ([superView respondsToSelector:@selector(contextMenu)])
     return [(NSView<mozView>*)superView contextMenu];
 
   return nil;
 
   NS_OBJC_END_TRY_ABORT_BLOCK_NIL;
 }
 
-- (void) convertCocoaMouseEvent:(NSEvent*)aMouseEvent toGeckoEvent:(nsInputEvent*)outGeckoEvent
+- (void) convertCocoaMouseEvent:(NSEvent*)aMouseEvent
+                   toGeckoEvent:(WidgetInputEvent*)outGeckoEvent
 {
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
 
   NS_ASSERTION(outGeckoEvent, "convertCocoaMouseEvent:toGeckoEvent: requires non-null aoutGeckoEvent");
   if (!outGeckoEvent)
     return;
 
   nsCocoaUtils::InitInputEvent(*outGeckoEvent, aMouseEvent);
--- a/widget/cocoa/nsCocoaUtils.h
+++ b/widget/cocoa/nsCocoaUtils.h
@@ -284,21 +284,21 @@ class nsCocoaUtils
   static void InitNPCocoaEvent(NPCocoaEvent* aNPCocoaEvent);
 
   /**
    * Initializes aPluginEvent for aCocoaEvent.
    */
   static void InitPluginEvent(mozilla::WidgetPluginEvent &aPluginEvent,
                               NPCocoaEvent &aCocoaEvent);
   /**
-   * Initializes nsInputEvent for aNativeEvent or aModifiers.
+   * Initializes WidgetInputEvent for aNativeEvent or aModifiers.
    */
-  static void InitInputEvent(nsInputEvent &aInputEvent,
+  static void InitInputEvent(mozilla::WidgetInputEvent &aInputEvent,
                              NSEvent* aNativeEvent);
-  static void InitInputEvent(nsInputEvent &aInputEvent,
+  static void InitInputEvent(mozilla::WidgetInputEvent &aInputEvent,
                              NSUInteger aModifiers);
 
   /**
    * ConvertToCarbonModifier() returns carbon modifier flags for the cocoa
    * modifier flags.
    * NOTE: The result never includes right*Key.
    */
   static UInt32 ConvertToCarbonModifier(NSUInteger aCocoaModifier);
--- a/widget/cocoa/nsCocoaUtils.mm
+++ b/widget/cocoa/nsCocoaUtils.mm
@@ -425,33 +425,33 @@ nsCocoaUtils::InitPluginEvent(WidgetPlug
 {
   aPluginEvent.time = PR_IntervalNow();
   aPluginEvent.pluginEvent = (void*)&aCocoaEvent;
   aPluginEvent.retargetToFocusedDocument = false;
 }
 
 // static
 void
-nsCocoaUtils::InitInputEvent(nsInputEvent &aInputEvent,
+nsCocoaUtils::InitInputEvent(WidgetInputEvent& aInputEvent,
                              NSEvent* aNativeEvent)
 {
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
 
   NSUInteger modifiers =
     aNativeEvent ? [aNativeEvent modifierFlags] : [NSEvent modifierFlags];
   InitInputEvent(aInputEvent, modifiers);
 
   aInputEvent.time = PR_IntervalNow();
 
   NS_OBJC_END_TRY_ABORT_BLOCK;
 }
 
 // static
 void
-nsCocoaUtils::InitInputEvent(nsInputEvent &aInputEvent,
+nsCocoaUtils::InitInputEvent(WidgetInputEvent& aInputEvent,
                              NSUInteger aModifiers)
 {
   aInputEvent.modifiers = 0;
   if (aModifiers & NSShiftKeyMask) {
     aInputEvent.modifiers |= MODIFIER_SHIFT;
   }
   if (aModifiers & NSControlKeyMask) {
     aInputEvent.modifiers |= MODIFIER_CONTROL;
--- a/widget/gtk/nsGtkKeyUtils.cpp
+++ b/widget/gtk/nsGtkKeyUtils.cpp
@@ -490,17 +490,17 @@ KeymapWrapper::AreModifiersActive(Modifi
             return false;
         }
         aModifiers &= ~modifier;
     }
     return true;
 }
 
 /* static */ void
-KeymapWrapper::InitInputEvent(nsInputEvent& aInputEvent,
+KeymapWrapper::InitInputEvent(WidgetInputEvent& aInputEvent,
                               guint aModifierState)
 {
     KeymapWrapper* keymapWrapper = GetInstance();
 
     aInputEvent.modifiers = 0;
     // DOM Meta key should be TRUE only on Mac.  We need to discuss this
     // issue later.
     if (keymapWrapper->AreModifiersActive(SHIFT, aModifierState)) {
--- a/widget/gtk/nsGtkKeyUtils.h
+++ b/widget/gtk/nsGtkKeyUtils.h
@@ -97,17 +97,17 @@ public:
      *                          Otherwise, FALSE.
      */
     static bool AreModifiersActive(Modifiers aModifiers,
                                    guint aModifierState);
 
     /**
      * InitInputEvent() initializes the aInputEvent with aModifierState.
      */
-    static void InitInputEvent(nsInputEvent& aInputEvent,
+    static void InitInputEvent(WidgetInputEvent& aInputEvent,
                                guint aModifierState);
 
     /**
      * InitKeyEvent() intializes aKeyEvent's modifier key related members
      * and keycode related values.
      *
      * @param aKeyEvent         It's an WidgetKeyboardEvent which needs to be
      *                          initialized.
--- a/widget/nsGUIEventIPC.h
+++ b/widget/nsGUIEventIPC.h
@@ -77,19 +77,19 @@ struct ParamTraits<nsGUIEvent>
 
   static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
   {
     return ReadParam(aMsg, aIter, static_cast<nsEvent*>(aResult));
   }
 };
 
 template<>
-struct ParamTraits<nsInputEvent>
+struct ParamTraits<mozilla::WidgetInputEvent>
 {
-  typedef nsInputEvent paramType;
+  typedef mozilla::WidgetInputEvent paramType;
 
   static void Write(Message* aMsg, const paramType& aParam)
   {
     WriteParam(aMsg, static_cast<nsGUIEvent>(aParam));
     WriteParam(aMsg, aParam.modifiers);
   }
 
   static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
@@ -101,26 +101,27 @@ struct ParamTraits<nsInputEvent>
 
 template<>
 struct ParamTraits<nsMouseEvent_base>
 {
   typedef nsMouseEvent_base paramType;
 
   static void Write(Message* aMsg, const paramType& aParam)
   {
-    WriteParam(aMsg, static_cast<nsInputEvent>(aParam));
+    WriteParam(aMsg, static_cast<mozilla::WidgetInputEvent>(aParam));
     WriteParam(aMsg, aParam.button);
     WriteParam(aMsg, aParam.buttons);
     WriteParam(aMsg, aParam.pressure);
     WriteParam(aMsg, aParam.inputSource);
   }
 
   static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
   {
-    return ReadParam(aMsg, aIter, static_cast<nsInputEvent*>(aResult)) &&
+    return ReadParam(aMsg, aIter,
+                     static_cast<mozilla::WidgetInputEvent*>(aResult)) &&
            ReadParam(aMsg, aIter, &aResult->button) &&
            ReadParam(aMsg, aIter, &aResult->buttons) &&
            ReadParam(aMsg, aIter, &aResult->pressure) &&
            ReadParam(aMsg, aIter, &aResult->inputSource);
   }
 };
 
 template<>
@@ -202,17 +203,17 @@ struct ParamTraits<nsMouseEvent>
 
 template<>
 struct ParamTraits<mozilla::WidgetTouchEvent>
 {
   typedef mozilla::WidgetTouchEvent paramType;
 
   static void Write(Message* aMsg, const paramType& aParam)
   {
-    WriteParam(aMsg, static_cast<const nsInputEvent&>(aParam));
+    WriteParam(aMsg, static_cast<const mozilla::WidgetInputEvent&>(aParam));
     // Sigh, Touch bites us again!  We want to be able to do
     //   WriteParam(aMsg, aParam.touches);
     const nsTArray< nsRefPtr<mozilla::dom::Touch> >& touches = aParam.touches;
     WriteParam(aMsg, touches.Length());
     for (uint32_t i = 0; i < touches.Length(); ++i) {
       mozilla::dom::Touch* touch = touches[i];
       WriteParam(aMsg, touch->mIdentifier);
       WriteParam(aMsg, touch->mRefPoint);
@@ -220,17 +221,18 @@ struct ParamTraits<mozilla::WidgetTouchE
       WriteParam(aMsg, touch->mRotationAngle);
       WriteParam(aMsg, touch->mForce);
     }
   }
 
   static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
   {
     uint32_t numTouches;
-    if (!ReadParam(aMsg, aIter, static_cast<nsInputEvent*>(aResult)) ||
+    if (!ReadParam(aMsg, aIter,
+                   static_cast<mozilla::WidgetInputEvent*>(aResult)) ||
         !ReadParam(aMsg, aIter, &numTouches)) {
       return false;
     }
     for (uint32_t i = 0; i < numTouches; ++i) {
         int32_t identifier;
         mozilla::LayoutDeviceIntPoint refPoint;
         nsIntPoint radius;
         float rotationAngle;
@@ -253,31 +255,32 @@ struct ParamTraits<mozilla::WidgetTouchE
 
 template<>
 struct ParamTraits<mozilla::WidgetKeyboardEvent>
 {
   typedef mozilla::WidgetKeyboardEvent paramType;
 
   static void Write(Message* aMsg, const paramType& aParam)
   {
-    WriteParam(aMsg, static_cast<nsInputEvent>(aParam));
+    WriteParam(aMsg, static_cast<mozilla::WidgetInputEvent>(aParam));
     WriteParam(aMsg, static_cast<uint32_t>(aParam.mKeyNameIndex));
     WriteParam(aMsg, aParam.keyCode);
     WriteParam(aMsg, aParam.charCode);
     WriteParam(aMsg, aParam.isChar);
     WriteParam(aMsg, aParam.location);
     WriteParam(aMsg, aParam.mUniqueId);
     // An OS-specific native event might be attached in |mNativeKeyEvent|,  but
     // that cannot be copied across process boundaries.
   }
 
   static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
   {
     uint32_t keyNameIndex = 0;
-    if (ReadParam(aMsg, aIter, static_cast<nsInputEvent*>(aResult)) &&
+    if (ReadParam(aMsg, aIter,
+                  static_cast<mozilla::WidgetInputEvent*>(aResult)) &&
         ReadParam(aMsg, aIter, &keyNameIndex) &&
         ReadParam(aMsg, aIter, &aResult->keyCode) &&
         ReadParam(aMsg, aIter, &aResult->charCode) &&
         ReadParam(aMsg, aIter, &aResult->isChar) &&
         ReadParam(aMsg, aIter, &aResult->location) &&
         ReadParam(aMsg, aIter, &aResult->mUniqueId))
     {
       aResult->mKeyNameIndex = static_cast<mozilla::KeyNameIndex>(keyNameIndex);
--- a/widget/windows/KeyboardLayout.cpp
+++ b/widget/windows/KeyboardLayout.cpp
@@ -120,17 +120,17 @@ ModifierKeyState::Update()
   if (::GetKeyState(VK_SCROLL) & 1) {
     mModifiers |= MODIFIER_SCROLLLOCK;
   }
 
   EnsureAltGr();
 }
 
 void
-ModifierKeyState::InitInputEvent(nsInputEvent& aInputEvent) const
+ModifierKeyState::InitInputEvent(WidgetInputEvent& aInputEvent) const
 {
   aInputEvent.modifiers = mModifiers;
 
   switch(aInputEvent.eventStructType) {
     case NS_MOUSE_EVENT:
     case NS_MOUSE_SCROLL_EVENT:
     case NS_WHEEL_EVENT:
     case NS_DRAG_EVENT:
@@ -138,17 +138,17 @@ ModifierKeyState::InitInputEvent(nsInput
       InitMouseEvent(aInputEvent);
       break;
     default:
       break;
   }
 }
 
 void
-ModifierKeyState::InitMouseEvent(nsInputEvent& aMouseEvent) const
+ModifierKeyState::InitMouseEvent(WidgetInputEvent& aMouseEvent) const
 {
   NS_ASSERTION(aMouseEvent.eventStructType == NS_MOUSE_EVENT ||
                aMouseEvent.eventStructType == NS_WHEEL_EVENT ||
                aMouseEvent.eventStructType == NS_DRAG_EVENT ||
                aMouseEvent.eventStructType == NS_SIMPLE_GESTURE_EVENT,
                "called with non-mouse event");
 
   nsMouseEvent_base& mouseEvent = static_cast<nsMouseEvent_base&>(aMouseEvent);
--- a/widget/windows/KeyboardLayout.h
+++ b/widget/windows/KeyboardLayout.h
@@ -97,17 +97,17 @@ public:
   }
 
   void Set(Modifiers aAddingModifiers)
   {
     mModifiers |= aAddingModifiers;
     EnsureAltGr();
   }
 
-  void InitInputEvent(nsInputEvent& aInputEvent) const;
+  void InitInputEvent(WidgetInputEvent& aInputEvent) const;
 
   bool IsShift() const { return (mModifiers & MODIFIER_SHIFT) != 0; }
   bool IsControl() const { return (mModifiers & MODIFIER_CONTROL) != 0; }
   bool IsAlt() const { return (mModifiers & MODIFIER_ALT) != 0; }
   bool IsAltGr() const { return IsControl() && IsAlt(); }
   bool IsWin() const { return (mModifiers & MODIFIER_OS) != 0; }
 
   bool IsCapsLocked() const { return (mModifiers & MODIFIER_CAPSLOCK) != 0; }
@@ -128,17 +128,17 @@ private:
     // Ideally, we should check whether the current keyboard layout has AltGr
     // or not.  However, setting AltGr flags for keyboard which doesn't have
     // AltGr must not be serious bug.  So, it should be OK for now.
     if (IsAltGr()) {
       mModifiers |= MODIFIER_ALTGRAPH;
     }
   }
 
-  void InitMouseEvent(nsInputEvent& aMouseEvent) const;
+  void InitMouseEvent(WidgetInputEvent& aMouseEvent) const;
 };
 
 struct UniCharsAndModifiers
 {
   // Dead-key + up to 4 characters
   PRUnichar mChars[5];
   Modifiers mModifiers[5];
   uint32_t  mLength;
--- a/widget/windows/winrt/MetroInput.cpp
+++ b/widget/windows/winrt/MetroInput.cpp
@@ -1122,17 +1122,17 @@ MetroInput::HandleLongTap(const Foundati
 }
 
 /**
  * Implementation Details
  */
 nsEventStatus MetroInput::sThrowawayStatus;
 
 void
-MetroInput::DispatchAsyncEventIgnoreStatus(nsInputEvent* aEvent)
+MetroInput::DispatchAsyncEventIgnoreStatus(WidgetInputEvent* aEvent)
 {
   aEvent->time = ::GetMessageTime();
   mModifierKeyState.Update();
   mModifierKeyState.InitInputEvent(*aEvent);
   mInputEventQueue.Push(aEvent);
   nsCOMPtr<nsIRunnable> runnable =
     NS_NewRunnableMethod(this, &MetroInput::DeliverNextQueuedEventIgnoreStatus);
   NS_DispatchToCurrentThread(runnable);
--- a/widget/windows/winrt/MetroInput.h
+++ b/widget/windows/winrt/MetroInput.h
@@ -258,17 +258,17 @@ private:
   // native event dispatcher in MetroAppShell. So all events delivered to us
   // on the ui thread via a native event dispatch call get bounced through
   // the gecko thread event queue using runnables. Most events can be sent
   // async without the need to see the status result. Those that do have
   // specialty callbacks. Note any event that arrives to us on the ui thread
   // that originates from another thread is safe to send sync.
 
   // Async event dispatching
-  void DispatchAsyncEventIgnoreStatus(nsInputEvent* aEvent);
+  void DispatchAsyncEventIgnoreStatus(WidgetInputEvent* aEvent);
   void DispatchAsyncTouchEventIgnoreStatus(WidgetTouchEvent* aEvent);
   void DispatchAsyncTouchEventWithCallback(WidgetTouchEvent* aEvent,
                                            void (MetroInput::*Callback)());
 
   // Async event callbacks
   void DeliverNextQueuedEventIgnoreStatus();
   nsEventStatus DeliverNextQueuedTouchEvent();
 
--- a/widget/windows/winrt/MetroWidget.cpp
+++ b/widget/windows/winrt/MetroWidget.cpp
@@ -1008,37 +1008,38 @@ MetroWidget::HitTestAPZC(ScreenPoint& pt
 {
   if (!MetroWidget::sAPZC) {
     return false;
   }
   return MetroWidget::sAPZC->HitTestAPZC(pt);
 }
 
 nsEventStatus
-MetroWidget::ApzReceiveInputEvent(nsInputEvent* aEvent)
+MetroWidget::ApzReceiveInputEvent(WidgetInputEvent* aEvent)
 {
   MOZ_ASSERT(aEvent);
 
   if (!MetroWidget::sAPZC) {
     return nsEventStatus_eIgnore;
   }
-  nsInputEvent& event = static_cast<nsInputEvent&>(*aEvent);
+  WidgetInputEvent& event = static_cast<WidgetInputEvent&>(*aEvent);
   return MetroWidget::sAPZC->ReceiveInputEvent(event);
 }
 
 nsEventStatus
-MetroWidget::ApzReceiveInputEvent(nsInputEvent* aInEvent, nsInputEvent* aOutEvent)
+MetroWidget::ApzReceiveInputEvent(WidgetInputEvent* aInEvent,
+                                  WidgetInputEvent* aOutEvent)
 {
   MOZ_ASSERT(aInEvent);
   MOZ_ASSERT(aOutEvent);
 
   if (!MetroWidget::sAPZC) {
     return nsEventStatus_eIgnore;
   }
-  nsInputEvent& event = static_cast<nsInputEvent&>(*aInEvent);
+  WidgetInputEvent& event = static_cast<WidgetInputEvent&>(*aInEvent);
   return MetroWidget::sAPZC->ReceiveInputEvent(event, aOutEvent);
 }
 
 LayerManager*
 MetroWidget::GetLayerManager(PLayerTransactionChild* aShadowManager,
                              LayersBackend aBackendHint,
                              LayerManagerPersistence aPersistence,
                              bool* aAllowRetaining)
--- a/widget/windows/winrt/MetroWidget.h
+++ b/widget/windows/winrt/MetroWidget.h
@@ -193,18 +193,19 @@ public:
   void SetView(FrameworkView* aView);
   void FindMetroWindow();
   virtual void SetTransparencyMode(nsTransparencyMode aMode);
   virtual nsTransparencyMode GetTransparencyMode();
 
   // APZ related apis
   void ApzContentConsumingTouch();
   void ApzContentIgnoringTouch();
-  nsEventStatus ApzReceiveInputEvent(nsInputEvent* aEvent);
-  nsEventStatus ApzReceiveInputEvent(nsInputEvent* aInEvent, nsInputEvent* aOutEvent);
+  nsEventStatus ApzReceiveInputEvent(mozilla::WidgetInputEvent* aEvent);
+  nsEventStatus ApzReceiveInputEvent(mozilla::WidgetInputEvent* aInEvent,
+                                     mozilla::WidgetInputEvent* aOutEvent);
   bool HitTestAPZC(mozilla::ScreenPoint& pt);
   nsresult RequestContentScroll();
   void RequestContentRepaintImplMainThread();
 
 protected:
   friend class FrameworkView;
 
   struct OleInitializeWrapper {