Bug 1046101 part.11 Rename NS_MOUSE_EVENT to eMouseEventClass r=smaug
authorMasayuki Nakano <masayuki@d-toybox.com>
Mon, 04 Aug 2014 14:28:50 +0900
changeset 197542 cddf9f550571fe3eececf0b4115683437e464edf
parent 197541 d1866b96921bee8fd9a0780f45314ef7930d26a9
child 197543 df76962b36837df8be48ddd05e56d7ac2ec4c46c
push id47161
push usermasayuki@d-toybox.com
push dateMon, 04 Aug 2014 05:29:14 +0000
treeherdermozilla-inbound@c0cfff4ee625 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1046101
milestone34.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 1046101 part.11 Rename NS_MOUSE_EVENT to eMouseEventClass r=smaug
content/html/content/src/HTMLCanvasElement.cpp
content/html/content/src/HTMLInputElement.cpp
dom/base/nsGlobalWindow.cpp
dom/events/Event.cpp
dom/events/EventDispatcher.cpp
dom/events/EventNameList.h
dom/events/EventStateManager.cpp
dom/events/MouseEvent.cpp
dom/events/UIEvent.cpp
dom/events/UIEvent.h
dom/plugins/base/nsPluginInstanceOwner.cpp
dom/xbl/nsXBLEventHandler.cpp
layout/base/PositionedEventTargeting.cpp
layout/base/nsLayoutUtils.cpp
layout/base/nsPresShell.cpp
layout/forms/nsNumberControlFrame.cpp
layout/forms/nsRangeFrame.cpp
layout/generic/nsFrame.cpp
layout/xul/nsResizerFrame.cpp
layout/xul/nsXULPopupManager.cpp
widget/BasicEvents.h
widget/MouseEvents.h
widget/gtk/nsGtkKeyUtils.cpp
widget/gtk/nsWindow.cpp
widget/shared/WidgetEventImpl.cpp
widget/windows/KeyboardLayout.cpp
widget/windows/nsWindow.cpp
--- a/content/html/content/src/HTMLCanvasElement.cpp
+++ b/content/html/content/src/HTMLCanvasElement.cpp
@@ -288,17 +288,17 @@ HTMLCanvasElement::CopyInnerTo(Element* 
       rv = err.ErrorCode();
     }
   }
   return rv;
 }
 
 nsresult HTMLCanvasElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
 {
-  if (aVisitor.mEvent->mClass == NS_MOUSE_EVENT) {
+  if (aVisitor.mEvent->mClass == eMouseEventClass) {
     WidgetMouseEventBase* evt = (WidgetMouseEventBase*)aVisitor.mEvent;
     if (mCurrentContext) {
       nsIFrame *frame = GetPrimaryFrame();
       if (!frame)
         return NS_OK;
       nsPoint ptInRoot = nsLayoutUtils::GetEventCoordinatesRelativeTo(evt, frame);
       nsRect paddingRect = frame->GetContentRectRelativeToSelf();
       Point hitpoint;
--- a/content/html/content/src/HTMLInputElement.cpp
+++ b/content/html/content/src/HTMLInputElement.cpp
@@ -4264,17 +4264,17 @@ HTMLInputElement::PostHandleEvent(EventC
 }
 
 void
 HTMLInputElement::PostHandleEventForRangeThumb(EventChainPostVisitor& aVisitor)
 {
   MOZ_ASSERT(mType == NS_FORM_INPUT_RANGE);
 
   if (nsEventStatus_eConsumeNoDefault == aVisitor.mEventStatus ||
-      !(aVisitor.mEvent->mClass == NS_MOUSE_EVENT ||
+      !(aVisitor.mEvent->mClass == eMouseEventClass ||
         aVisitor.mEvent->mClass == NS_TOUCH_EVENT ||
         aVisitor.mEvent->mClass == eKeyboardEventClass)) {
     return;
   }
 
   nsRangeFrame* rangeFrame = do_QueryFrame(GetPrimaryFrame());
   if (!rangeFrame && mIsDraggingRange) {
     CancelRangeThumbDrag();
--- a/dom/base/nsGlobalWindow.cpp
+++ b/dom/base/nsGlobalWindow.cpp
@@ -13489,17 +13489,17 @@ nsGlobalWindow::BeginWindowMove(Event& a
 #endif
 
   if (!widget) {
     return;
   }
 
   WidgetMouseEvent* mouseEvent =
     aMouseDownEvent.GetInternalNSEvent()->AsMouseEvent();
-  if (!mouseEvent || mouseEvent->mClass != NS_MOUSE_EVENT) {
+  if (!mouseEvent || mouseEvent->mClass != eMouseEventClass) {
     aError.Throw(NS_ERROR_FAILURE);
     return;
   }
 
   aError = widget->BeginMoveDrag(mouseEvent);
 }
 
 //Note: This call will lock the cursor, it will not change as it moves.
--- a/dom/events/Event.cpp
+++ b/dom/events/Event.cpp
@@ -153,17 +153,17 @@ NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(Eve
 NS_IMPL_CYCLE_COLLECTION_TRACE_END
 
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(Event)
   if (tmp->mEventIsInternal) {
     tmp->mEvent->target = nullptr;
     tmp->mEvent->currentTarget = nullptr;
     tmp->mEvent->originalTarget = nullptr;
     switch (tmp->mEvent->mClass) {
-      case NS_MOUSE_EVENT:
+      case eMouseEventClass:
       case NS_MOUSE_SCROLL_EVENT:
       case NS_WHEEL_EVENT:
       case NS_SIMPLE_GESTURE_EVENT:
       case NS_POINTER_EVENT:
         tmp->mEvent->AsMouseEventBase()->relatedTarget = nullptr;
         break;
       case NS_DRAG_EVENT: {
         WidgetDragEvent* dragEvent = tmp->mEvent->AsDragEvent();
@@ -191,17 +191,17 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(Ev
 NS_IMPL_CYCLE_COLLECTION_UNLINK_END
 
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(Event)
   if (tmp->mEventIsInternal) {
     NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mEvent->target)
     NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mEvent->currentTarget)
     NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mEvent->originalTarget)
     switch (tmp->mEvent->mClass) {
-      case NS_MOUSE_EVENT:
+      case eMouseEventClass:
       case NS_MOUSE_SCROLL_EVENT:
       case NS_WHEEL_EVENT:
       case NS_SIMPLE_GESTURE_EVENT:
       case NS_POINTER_EVENT:
         NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "mEvent->relatedTarget");
         cb.NoteXPCOMChild(tmp->mEvent->AsMouseEventBase()->relatedTarget);
         break;
       case NS_DRAG_EVENT: {
@@ -751,17 +751,17 @@ Event::GetEventPopupControlState(WidgetE
       case NS_TOUCH_END :
         if (PopupAllowedForEvent("touchend")) {
           abuse = openControlled;
         }
         break;
       }
     }
     break;
-  case NS_MOUSE_EVENT :
+  case eMouseEventClass:
     if (aEvent->mFlags.mIsTrusted &&
         aEvent->AsMouseEvent()->button == WidgetMouseEvent::eLeftButton) {
       switch(aEvent->message) {
       case NS_MOUSE_BUTTON_UP :
         if (PopupAllowedForEvent("mouseup")) {
           abuse = openControlled;
         }
         break;
@@ -842,17 +842,17 @@ Event::GetScreenCoords(nsPresContext* aP
                        WidgetEvent* aEvent,
                        LayoutDeviceIntPoint aPoint)
 {
   if (EventStateManager::sIsPointerLocked) {
     return EventStateManager::sLastScreenPoint;
   }
 
   if (!aEvent || 
-       (aEvent->mClass != NS_MOUSE_EVENT &&
+       (aEvent->mClass != eMouseEventClass &&
         aEvent->mClass != NS_MOUSE_SCROLL_EVENT &&
         aEvent->mClass != NS_WHEEL_EVENT &&
         aEvent->mClass != NS_POINTER_EVENT &&
         aEvent->mClass != NS_TOUCH_EVENT &&
         aEvent->mClass != NS_DRAG_EVENT &&
         aEvent->mClass != NS_SIMPLE_GESTURE_EVENT)) {
     return nsIntPoint(0, 0);
   }
@@ -898,17 +898,17 @@ Event::GetClientCoords(nsPresContext* aP
                        LayoutDeviceIntPoint aPoint,
                        CSSIntPoint aDefaultPoint)
 {
   if (EventStateManager::sIsPointerLocked) {
     return EventStateManager::sLastClientPoint;
   }
 
   if (!aEvent ||
-      (aEvent->mClass != NS_MOUSE_EVENT &&
+      (aEvent->mClass != eMouseEventClass &&
        aEvent->mClass != NS_MOUSE_SCROLL_EVENT &&
        aEvent->mClass != NS_WHEEL_EVENT &&
        aEvent->mClass != NS_TOUCH_EVENT &&
        aEvent->mClass != NS_DRAG_EVENT &&
        aEvent->mClass != NS_POINTER_EVENT &&
        aEvent->mClass != NS_SIMPLE_GESTURE_EVENT) ||
       !aPresContext ||
       !aEvent->AsGUIEvent()->widget) {
--- a/dom/events/EventDispatcher.cpp
+++ b/dom/events/EventDispatcher.cpp
@@ -697,17 +697,17 @@ EventDispatcher::CreateEvent(EventTarget
       return NS_NewDOMScrollAreaEvent(aDOMEvent, aOwner, aPresContext,
                                       aEvent->AsScrollAreaEvent());
     case eKeyboardEventClass:
       return NS_NewDOMKeyboardEvent(aDOMEvent, aOwner, aPresContext,
                                     aEvent->AsKeyboardEvent());
     case eCompositionEventClass:
       return NS_NewDOMCompositionEvent(aDOMEvent, aOwner, aPresContext,
                                        aEvent->AsCompositionEvent());
-    case NS_MOUSE_EVENT:
+    case eMouseEventClass:
       return NS_NewDOMMouseEvent(aDOMEvent, aOwner, aPresContext,
                                  aEvent->AsMouseEvent());
     case NS_FOCUS_EVENT:
       return NS_NewDOMFocusEvent(aDOMEvent, aOwner, aPresContext,
                                  aEvent->AsFocusEvent());
     case NS_MOUSE_SCROLL_EVENT:
       return NS_NewDOMMouseScrollEvent(aDOMEvent, aOwner, aPresContext,
                                        aEvent->AsMouseScrollEvent());
--- a/dom/events/EventNameList.h
+++ b/dom/events/EventNameList.h
@@ -161,27 +161,27 @@ EVENT(canplaythrough,
       NS_EVENT)
 EVENT(change,
       NS_FORM_CHANGE,
       EventNameType_HTMLXUL,
       NS_EVENT )
 EVENT(click,
       NS_MOUSE_CLICK,
       EventNameType_All,
-      NS_MOUSE_EVENT)
+      eMouseEventClass)
 EVENT(contextmenu,
       NS_CONTEXTMENU,
       EventNameType_HTMLXUL,
-      NS_MOUSE_EVENT)
+      eMouseEventClass)
 // Not supported yet
 // EVENT(cuechange)
 EVENT(dblclick,
       NS_MOUSE_DOUBLECLICK,
       EventNameType_HTMLXUL,
-      NS_MOUSE_EVENT)
+      eMouseEventClass)
 EVENT(drag,
       NS_DRAGDROP_DRAG,
       EventNameType_HTMLXUL,
       NS_DRAG_EVENT)
 EVENT(dragend,
       NS_DRAGDROP_END,
       EventNameType_HTMLXUL,
       NS_DRAG_EVENT)
@@ -247,41 +247,41 @@ EVENT(loadedmetadata,
       NS_EVENT)
 EVENT(loadstart,
       NS_LOADSTART,
       EventNameType_HTML,
       NS_EVENT)
 EVENT(mousedown,
       NS_MOUSE_BUTTON_DOWN,
       EventNameType_All,
-      NS_MOUSE_EVENT)
+      eMouseEventClass)
 EVENT(mouseenter,
       NS_MOUSEENTER,
       EventNameType_All,
-      NS_MOUSE_EVENT)
+      eMouseEventClass)
 EVENT(mouseleave,
       NS_MOUSELEAVE,
       EventNameType_All,
-      NS_MOUSE_EVENT)
+      eMouseEventClass)
 EVENT(mousemove,
       NS_MOUSE_MOVE,
       EventNameType_All,
-      NS_MOUSE_EVENT)
+      eMouseEventClass)
 EVENT(mouseout,
       NS_MOUSE_EXIT_SYNTH,
       EventNameType_All,
-      NS_MOUSE_EVENT)
+      eMouseEventClass)
 EVENT(mouseover,
       NS_MOUSE_ENTER_SYNTH,
       EventNameType_All,
-      NS_MOUSE_EVENT)
+      eMouseEventClass)
 EVENT(mouseup,
       NS_MOUSE_BUTTON_UP,
       EventNameType_All,
-      NS_MOUSE_EVENT)
+      eMouseEventClass)
 EVENT(mozfullscreenchange,
       NS_FULLSCREENCHANGE,
       EventNameType_HTML,
       NS_EVENT)
 EVENT(mozfullscreenerror,
       NS_FULLSCREENERROR,
       EventNameType_HTML,
       NS_EVENT)
@@ -567,17 +567,17 @@ TOUCH_EVENT(touchcancel,
 DOCUMENT_ONLY_EVENT(readystatechange,
                     NS_READYSTATECHANGE,
                     EventNameType_HTMLXUL,
                     NS_EVENT)
 
 NON_IDL_EVENT(MozMouseHittest,
               NS_MOUSE_MOZHITTEST,
               EventNameType_None,
-              NS_MOUSE_EVENT)
+              eMouseEventClass)
 
 NON_IDL_EVENT(DOMAttrModified,
               NS_MUTATION_ATTRMODIFIED,
               EventNameType_HTMLXUL,
               NS_MUTATION_EVENT)
 NON_IDL_EVENT(DOMCharacterDataModified,
               NS_MUTATION_CHARACTERDATAMODIFIED,
               EventNameType_HTMLXUL,
--- a/dom/events/EventStateManager.cpp
+++ b/dom/events/EventStateManager.cpp
@@ -1085,17 +1085,17 @@ EventStateManager::DispatchCrossProcessE
                                              nsEventStatus *aStatus) {
   PBrowserParent* remoteBrowser = aFrameLoader->GetRemoteBrowser();
   TabParent* remote = static_cast<TabParent*>(remoteBrowser);
   if (!remote) {
     return false;
   }
 
   switch (aEvent->mClass) {
-  case NS_MOUSE_EVENT: {
+  case eMouseEventClass: {
     return remote->SendRealMouseEvent(*aEvent->AsMouseEvent());
   }
   case eKeyboardEventClass: {
     return remote->SendRealKeyEvent(*aEvent->AsKeyboardEvent());
   }
   case NS_WHEEL_EVENT: {
     return remote->SendMouseWheelEvent(*aEvent->AsWheelEvent());
   }
@@ -1155,17 +1155,17 @@ EventStateManager::GetChildProcessOffset
 
 bool
 CrossProcessSafeEvent(const WidgetEvent& aEvent)
 {
   switch (aEvent.mClass) {
   case eKeyboardEventClass:
   case NS_WHEEL_EVENT:
     return true;
-  case NS_MOUSE_EVENT:
+  case eMouseEventClass:
     switch (aEvent.message) {
     case NS_MOUSE_BUTTON_DOWN:
     case NS_MOUSE_BUTTON_UP:
     case NS_MOUSE_MOVE:
     case NS_CONTEXTMENU:
     case NS_MOUSE_EXIT:
       return true;
     default:
--- a/dom/events/MouseEvent.cpp
+++ b/dom/events/MouseEvent.cpp
@@ -65,17 +65,17 @@ MouseEvent::InitMouseEvent(const nsAStri
                            uint16_t aButton,
                            nsIDOMEventTarget* aRelatedTarget)
 {
   nsresult rv =
     UIEvent::InitUIEvent(aType, aCanBubble, aCancelable, aView, aDetail);
   NS_ENSURE_SUCCESS(rv, rv);
 
   switch(mEvent->mClass) {
-    case NS_MOUSE_EVENT:
+    case eMouseEventClass:
     case NS_MOUSE_SCROLL_EVENT:
     case NS_WHEEL_EVENT:
     case NS_DRAG_EVENT:
     case NS_POINTER_EVENT:
     case NS_SIMPLE_GESTURE_EVENT: {
       WidgetMouseEventBase* mouseEventBase = mEvent->AsMouseEventBase();
       mouseEventBase->relatedTarget = aRelatedTarget;
       mouseEventBase->button = aButton;
@@ -119,17 +119,17 @@ MouseEvent::InitMouseEvent(const nsAStri
                                (modifiers & MODIFIER_CONTROL) != 0,
                                (modifiers & MODIFIER_ALT) != 0,
                                (modifiers & MODIFIER_SHIFT) != 0,
                                (modifiers & MODIFIER_META) != 0,
                                aButton, aRelatedTarget);
   NS_ENSURE_SUCCESS(rv, rv);
 
   switch(mEvent->mClass) {
-    case NS_MOUSE_EVENT:
+    case eMouseEventClass:
     case NS_MOUSE_SCROLL_EVENT:
     case NS_WHEEL_EVENT:
     case NS_DRAG_EVENT:
     case NS_POINTER_EVENT:
     case NS_SIMPLE_GESTURE_EVENT:
       mEvent->AsInputEvent()->modifiers = modifiers;
       return NS_OK;
     default:
@@ -150,17 +150,17 @@ MouseEvent::Constructor(const GlobalObje
                     aParam.mView, aParam.mDetail, aParam.mScreenX,
                     aParam.mScreenY, aParam.mClientX, aParam.mClientY,
                     aParam.mCtrlKey, aParam.mAltKey, aParam.mShiftKey,
                     aParam.mMetaKey, aParam.mButton, aParam.mRelatedTarget,
                     aRv);
   e->SetTrusted(trusted);
 
   switch (e->mEvent->mClass) {
-    case NS_MOUSE_EVENT:
+    case eMouseEventClass:
     case NS_MOUSE_SCROLL_EVENT:
     case NS_WHEEL_EVENT:
     case NS_DRAG_EVENT:
     case NS_POINTER_EVENT:
     case NS_SIMPLE_GESTURE_EVENT:
       e->mEvent->AsMouseEventBase()->buttons = aParam.mButtons;
       break;
     default:
@@ -209,17 +209,17 @@ MouseEvent::GetButton(int16_t* aButton)
   *aButton = Button();
   return NS_OK;
 }
 
 int16_t
 MouseEvent::Button()
 {
   switch(mEvent->mClass) {
-    case NS_MOUSE_EVENT:
+    case eMouseEventClass:
     case NS_MOUSE_SCROLL_EVENT:
     case NS_WHEEL_EVENT:
     case NS_DRAG_EVENT:
     case NS_POINTER_EVENT:
     case NS_SIMPLE_GESTURE_EVENT:
       return mEvent->AsMouseEventBase()->button;
     default:
       NS_WARNING("Tried to get mouse button for non-mouse event!");
@@ -234,17 +234,17 @@ MouseEvent::GetButtons(uint16_t* aButton
   *aButtons = Buttons();
   return NS_OK;
 }
 
 uint16_t
 MouseEvent::Buttons()
 {
   switch(mEvent->mClass) {
-    case NS_MOUSE_EVENT:
+    case eMouseEventClass:
     case NS_MOUSE_SCROLL_EVENT:
     case NS_WHEEL_EVENT:
     case NS_DRAG_EVENT:
     case NS_POINTER_EVENT:
     case NS_SIMPLE_GESTURE_EVENT:
       return mEvent->AsMouseEventBase()->buttons;
     default:
       MOZ_CRASH("Tried to get mouse buttons for non-mouse event!");
@@ -259,17 +259,17 @@ MouseEvent::GetRelatedTarget(nsIDOMEvent
   return NS_OK;
 }
 
 already_AddRefed<EventTarget>
 MouseEvent::GetRelatedTarget()
 {
   nsCOMPtr<EventTarget> relatedTarget;
   switch(mEvent->mClass) {
-    case NS_MOUSE_EVENT:
+    case eMouseEventClass:
     case NS_MOUSE_SCROLL_EVENT:
     case NS_WHEEL_EVENT:
     case NS_DRAG_EVENT:
     case NS_POINTER_EVENT:
     case NS_SIMPLE_GESTURE_EVENT:
       relatedTarget =
         do_QueryInterface(mEvent->AsMouseEventBase()->relatedTarget);
       break;
--- a/dom/events/UIEvent.cpp
+++ b/dom/events/UIEvent.cpp
@@ -113,17 +113,17 @@ DevPixelsToCSSPixels(const LayoutDeviceI
 nsIntPoint
 UIEvent::GetMovementPoint()
 {
   if (mPrivateDataDuplicated) {
     return mMovementPoint;
   }
 
   if (!mEvent ||
-      (mEvent->mClass != NS_MOUSE_EVENT &&
+      (mEvent->mClass != eMouseEventClass &&
        mEvent->mClass != NS_MOUSE_SCROLL_EVENT &&
        mEvent->mClass != NS_WHEEL_EVENT &&
        mEvent->mClass != NS_DRAG_EVENT &&
        mEvent->mClass != NS_POINTER_EVENT &&
        mEvent->mClass != NS_SIMPLE_GESTURE_EVENT) ||
        !mEvent->AsGUIEvent()->widget) {
     return nsIntPoint(0, 0);
   }
@@ -291,17 +291,17 @@ UIEvent::SetCancelBubble(bool aCancelBub
   mEvent->mFlags.mPropagationStopped = aCancelBubble;
   return NS_OK;
 }
 
 nsIntPoint
 UIEvent::GetLayerPoint() const
 {
   if (!mEvent ||
-      (mEvent->mClass != NS_MOUSE_EVENT &&
+      (mEvent->mClass != eMouseEventClass &&
        mEvent->mClass != NS_MOUSE_SCROLL_EVENT &&
        mEvent->mClass != NS_WHEEL_EVENT &&
        mEvent->mClass != NS_POINTER_EVENT &&
        mEvent->mClass != NS_TOUCH_EVENT &&
        mEvent->mClass != NS_DRAG_EVENT &&
        mEvent->mClass != NS_SIMPLE_GESTURE_EVENT) ||
       !mPresContext ||
       mEventIsInternal) {
--- a/dom/events/UIEvent.h
+++ b/dom/events/UIEvent.h
@@ -38,17 +38,17 @@ public:
   NS_IMETHOD DuplicatePrivateData() MOZ_OVERRIDE;
   NS_IMETHOD_(void) Serialize(IPC::Message* aMsg, bool aSerializeInterfaceType) MOZ_OVERRIDE;
   NS_IMETHOD_(bool) Deserialize(const IPC::Message* aMsg, void** aIter) MOZ_OVERRIDE;
 
   static nsIntPoint CalculateScreenPoint(nsPresContext* aPresContext,
                                          WidgetEvent* aEvent)
   {
     if (!aEvent ||
-        (aEvent->mClass != NS_MOUSE_EVENT &&
+        (aEvent->mClass != eMouseEventClass &&
          aEvent->mClass != NS_MOUSE_SCROLL_EVENT &&
          aEvent->mClass != NS_WHEEL_EVENT &&
          aEvent->mClass != NS_DRAG_EVENT &&
          aEvent->mClass != NS_POINTER_EVENT &&
          aEvent->mClass != NS_SIMPLE_GESTURE_EVENT)) {
       return nsIntPoint(0, 0);
     }
 
@@ -65,17 +65,17 @@ public:
                       nsPresContext::AppUnitsToIntCSSPixels(offset.y * factor));
   }
 
   static CSSIntPoint CalculateClientPoint(nsPresContext* aPresContext,
                                           WidgetEvent* aEvent,
                                           CSSIntPoint* aDefaultClientPoint)
   {
     if (!aEvent ||
-        (aEvent->mClass != NS_MOUSE_EVENT &&
+        (aEvent->mClass != eMouseEventClass &&
          aEvent->mClass != NS_MOUSE_SCROLL_EVENT &&
          aEvent->mClass != NS_WHEEL_EVENT &&
          aEvent->mClass != NS_DRAG_EVENT &&
          aEvent->mClass != NS_POINTER_EVENT &&
          aEvent->mClass != NS_SIMPLE_GESTURE_EVENT) ||
         !aPresContext ||
         !aEvent->AsGUIEvent()->widget) {
       return aDefaultClientPoint
@@ -129,17 +129,17 @@ public:
 
   int32_t PageX() const;
   int32_t PageY() const;
 
   virtual uint32_t Which()
   {
     MOZ_ASSERT(mEvent->mClass != eKeyboardEventClass,
                "Key events should override Which()");
-    MOZ_ASSERT(mEvent->mClass != NS_MOUSE_EVENT,
+    MOZ_ASSERT(mEvent->mClass != eMouseEventClass,
                "Mouse events should override Which()");
     return 0;
   }
 
   already_AddRefed<nsINode> GetRangeParent();
 
   int32_t RangeOffset() const;
 
--- a/dom/plugins/base/nsPluginInstanceOwner.cpp
+++ b/dom/plugins/base/nsPluginInstanceOwner.cpp
@@ -1668,17 +1668,17 @@ nsPluginInstanceOwner::ProcessMouseDown(
     if (fm) {
       nsCOMPtr<nsIDOMElement> elem = do_QueryInterface(mContent);
       fm->SetFocus(elem, 0);
     }
   }
 
   WidgetMouseEvent* mouseEvent =
     aMouseEvent->GetInternalNSEvent()->AsMouseEvent();
-  if (mouseEvent && mouseEvent->mClass == NS_MOUSE_EVENT) {
+  if (mouseEvent && mouseEvent->mClass == eMouseEventClass) {
     mLastMouseDownButtonType = mouseEvent->button;
     nsEventStatus rv = ProcessEvent(*mouseEvent);
     if (nsEventStatus_eConsumeNoDefault == rv) {
       return aMouseEvent->PreventDefault(); // consume event
     }
   }
 
   return NS_OK;
@@ -1693,17 +1693,17 @@ nsresult nsPluginInstanceOwner::Dispatch
   // continue only for cases without child window
 #endif
   // don't send mouse events if we are hidden
   if (!mWidgetVisible)
     return NS_OK;
 
   WidgetMouseEvent* mouseEvent =
     aMouseEvent->GetInternalNSEvent()->AsMouseEvent();
-  if (mouseEvent && mouseEvent->mClass == NS_MOUSE_EVENT) {
+  if (mouseEvent && mouseEvent->mClass == eMouseEventClass) {
     nsEventStatus rv = ProcessEvent(*mouseEvent);
     if (nsEventStatus_eConsumeNoDefault == rv) {
       aMouseEvent->PreventDefault();
       if (!aAllowPropagate) {
         aMouseEvent->StopPropagation();
       }
     }
     if (mouseEvent->message == NS_MOUSE_BUTTON_UP) {
@@ -1899,17 +1899,17 @@ nsEventStatus nsPluginInstanceOwner::Pro
 #endif
 
 #ifdef XP_WIN
   // this code supports windowless plugins
   const NPEvent *pPluginEvent = static_cast<const NPEvent*>(anEvent.mPluginEvent);
   // we can get synthetic events from the EventStateManager... these
   // have no pluginEvent
   NPEvent pluginEvent;
-  if (anEvent.mClass == NS_MOUSE_EVENT) {
+  if (anEvent.mClass == eMouseEventClass) {
     if (!pPluginEvent) {
       // XXX Should extend this list to synthesize events for more event
       // types
       pluginEvent.event = 0;
       const WidgetMouseEvent* mouseEvent = anEvent.AsMouseEvent();
       switch (anEvent.message) {
       case NS_MOUSE_MOVE:
         pluginEvent.event = WM_MOUSEMOVE;
@@ -2007,17 +2007,17 @@ nsEventStatus nsPluginInstanceOwner::Pro
 
 #ifdef MOZ_X11
   // this code supports windowless plugins
   nsIWidget* widget = anEvent.widget;
   XEvent pluginEvent = XEvent();
   pluginEvent.type = 0;
 
   switch(anEvent.mClass) {
-    case NS_MOUSE_EVENT:
+    case eMouseEventClass:
       {
         switch (anEvent.message)
           {
           case NS_MOUSE_CLICK:
           case NS_MOUSE_DOUBLECLICK:
             // Button up/down events sent instead.
             return rv;
           }
@@ -2208,17 +2208,17 @@ nsEventStatus nsPluginInstanceOwner::Pro
     // The plugin needs focus to receive keyboard and touch events
     nsIFocusManager* fm = nsFocusManager::GetFocusManager();
     if (fm) {
       nsCOMPtr<nsIDOMElement> elem = do_QueryInterface(mContent);
       fm->SetFocus(elem, 0);
     }
   }
   switch(anEvent.mClass) {
-    case NS_MOUSE_EVENT:
+    case eMouseEventClass:
       {
         switch (anEvent.message)
           {
           case NS_MOUSE_CLICK:
           case NS_MOUSE_DOUBLECLICK:
             // Button up/down events sent instead.
             return rv;
           }
--- a/dom/xbl/nsXBLEventHandler.cpp
+++ b/dom/xbl/nsXBLEventHandler.cpp
@@ -8,16 +8,17 @@
 #include "nsIDOMEventListener.h"
 #include "nsIDOMKeyEvent.h"
 #include "nsIDOMMouseEvent.h"
 #include "nsXBLPrototypeHandler.h"
 #include "nsContentUtils.h"
 #include "mozilla/dom/Event.h" // for nsIDOMEvent::InternalDOMEvent()
 #include "mozilla/dom/EventTarget.h"
 
+using namespace mozilla;
 using namespace mozilla::dom;
 
 nsXBLEventHandler::nsXBLEventHandler(nsXBLPrototypeHandler* aHandler)
   : mProtoHandler(aHandler)
 {
 }
 
 nsXBLEventHandler::~nsXBLEventHandler()
@@ -144,17 +145,17 @@ nsXBLKeyEventHandler::HandleEvent(nsIDOM
 
 nsresult
 NS_NewXBLEventHandler(nsXBLPrototypeHandler* aHandler,
                       nsIAtom* aEventType,
                       nsXBLEventHandler** aResult)
 {
   switch (nsContentUtils::GetEventCategory(nsDependentAtomString(aEventType))) {
     case NS_DRAG_EVENT:
-    case NS_MOUSE_EVENT:
+    case eMouseEventClass:
     case NS_MOUSE_SCROLL_EVENT:
     case NS_WHEEL_EVENT:
     case NS_SIMPLE_GESTURE_EVENT:
       *aResult = new nsXBLMouseEventHandler(aHandler);
       break;
     default:
       *aResult = new nsXBLEventHandler(aHandler);
       break;
--- a/layout/base/PositionedEventTargeting.cpp
+++ b/layout/base/PositionedEventTargeting.cpp
@@ -76,17 +76,17 @@ static EventRadiusPrefs sTouchEventRadiu
 static const EventRadiusPrefs*
 GetPrefsFor(EventClassID aEventClassID)
 {
   EventRadiusPrefs* prefs = nullptr;
   const char* prefBranch = nullptr;
   if (aEventClassID == NS_TOUCH_EVENT) {
     prefBranch = "touch";
     prefs = &sTouchEventRadiusPrefs;
-  } else if (aEventClassID == NS_MOUSE_EVENT) {
+  } else if (aEventClassID == eMouseEventClass) {
     // Mostly for testing purposes
     prefBranch = "mouse";
     prefs = &sMouseEventRadiusPrefs;
   } else {
     return nullptr;
   }
 
   if (!prefs->mRegistered) {
@@ -100,17 +100,17 @@ GetPrefsFor(EventClassID aEventClassID)
 
     static const char prefNames[4][9] =
       { "topmm", "rightmm", "bottommm", "leftmm" };
     for (int32_t i = 0; i < 4; ++i) {
       nsPrintfCString radiusPref("ui.%s.radius.%s", prefBranch, prefNames[i]);
       Preferences::AddUintVarCache(&prefs->mSideRadii[i], radiusPref.get(), 0);
     }
 
-    if (aEventClassID == NS_MOUSE_EVENT) {
+    if (aEventClassID == eMouseEventClass) {
       Preferences::AddBoolVarCache(&prefs->mTouchOnly,
           "ui.mouse.radius.inputSource.touchOnly", true);
     } else {
       prefs->mTouchOnly = false;
     }
   }
 
   return prefs;
@@ -365,17 +365,17 @@ FindFrameTargetedByInputEvent(const Widg
 
   const EventRadiusPrefs* prefs = GetPrefsFor(aEvent->mClass);
   if (!prefs || !prefs->mEnabled || (target && IsElementClickable(target, nsGkAtoms::body))) {
     return target;
   }
 
   // Do not modify targeting for actual mouse hardware; only for mouse
   // events generated by touch-screen hardware.
-  if (aEvent->mClass == NS_MOUSE_EVENT &&
+  if (aEvent->mClass == eMouseEventClass &&
       prefs->mTouchOnly &&
       aEvent->AsMouseEvent()->inputSource !=
         nsIDOMMouseEvent::MOZ_SOURCE_TOUCH) {
     return target;
   }
 
   // If the exact target is non-null, only consider candidate targets in the same
   // document as the exact target. Otherwise, if an ancestor document has
--- a/layout/base/nsLayoutUtils.cpp
+++ b/layout/base/nsLayoutUtils.cpp
@@ -1864,17 +1864,17 @@ nsLayoutUtils::GetDOMEventCoordinatesRel
     return nsPoint(NS_UNCONSTRAINEDSIZE, NS_UNCONSTRAINEDSIZE);
   return GetEventCoordinatesRelativeTo(event, aFrame);
 }
 
 nsPoint
 nsLayoutUtils::GetEventCoordinatesRelativeTo(const WidgetEvent* aEvent,
                                              nsIFrame* aFrame)
 {
-  if (!aEvent || (aEvent->mClass != NS_MOUSE_EVENT &&
+  if (!aEvent || (aEvent->mClass != eMouseEventClass &&
                   aEvent->mClass != NS_MOUSE_SCROLL_EVENT &&
                   aEvent->mClass != NS_WHEEL_EVENT &&
                   aEvent->mClass != NS_DRAG_EVENT &&
                   aEvent->mClass != NS_SIMPLE_GESTURE_EVENT &&
                   aEvent->mClass != NS_POINTER_EVENT &&
                   aEvent->mClass != NS_GESTURENOTIFY_EVENT &&
                   aEvent->mClass != NS_TOUCH_EVENT &&
                   aEvent->mClass != eQueryContentEventClass))
--- a/layout/base/nsPresShell.cpp
+++ b/layout/base/nsPresShell.cpp
@@ -6699,17 +6699,17 @@ FlushThrottledStyles(nsIDocument *aDocum
 static nsresult
 DispatchPointerFromMouseOrTouch(PresShell* aShell,
                                 nsIFrame* aFrame,
                                 WidgetGUIEvent* aEvent,
                                 bool aDontRetargetEvents,
                                 nsEventStatus* aStatus)
 {
   uint32_t pointerMessage = 0;
-  if (aEvent->mClass == NS_MOUSE_EVENT) {
+  if (aEvent->mClass == eMouseEventClass) {
     WidgetMouseEvent* mouseEvent = aEvent->AsMouseEvent();
     // if it is not mouse then it is likely will come as touch event
     if (!mouseEvent->convertToPointer) {
       return NS_OK;
     }
     int16_t button = mouseEvent->button;
     switch (mouseEvent->message) {
     case NS_MOUSE_MOVE:
@@ -7149,17 +7149,17 @@ PresShell::HandleEvent(nsIFrame* aFrame,
             if (oldTouch) {
               touch->SetTarget(oldTouch->mTarget);
             }
           }
         }
       } else {
         eventPoint = nsLayoutUtils::GetEventCoordinatesRelativeTo(aEvent, frame);
       }
-      if (mouseEvent && mouseEvent->mClass == NS_MOUSE_EVENT &&
+      if (mouseEvent && mouseEvent->mClass == eMouseEventClass &&
           mouseEvent->ignoreRootScrollFrame) {
         flags |= INPUT_IGNORE_ROOT_SCROLL_FRAME;
       }
       nsIFrame* target =
         FindFrameTargetedByInputEvent(aEvent, frame, eventPoint, flags);
       if (target) {
         frame = target;
       }
@@ -7204,17 +7204,17 @@ PresShell::HandleEvent(nsIFrame* aFrame,
             releasePointerCaptureCaller.SetTarget(pointerId, pointerCapturingContent);
           }
         }
       }
     }
 
     // Suppress mouse event if it's being targeted at an element inside
     // a document which needs events suppressed
-    if (aEvent->mClass == NS_MOUSE_EVENT &&
+    if (aEvent->mClass == eMouseEventClass &&
         frame->PresContext()->Document()->EventHandlingSuppressed()) {
       if (aEvent->message == NS_MOUSE_BUTTON_DOWN) {
         mNoDelayedMouseEvents = true;
       } else if (!mNoDelayedMouseEvents && aEvent->message == NS_MOUSE_BUTTON_UP) {
         DelayedEvent* event = new DelayedMouseEvent(aEvent->AsMouseEvent());
         if (!mDelayedEvents.AppendElement(event)) {
           delete event;
         }
--- a/layout/forms/nsNumberControlFrame.cpp
+++ b/layout/forms/nsNumberControlFrame.cpp
@@ -558,17 +558,17 @@ nsNumberControlFrame::GetNumberControlFr
     }
   }
   return nullptr;
 }
 
 int32_t
 nsNumberControlFrame::GetSpinButtonForPointerEvent(WidgetGUIEvent* aEvent) const
 {
-  MOZ_ASSERT(aEvent->mClass == NS_MOUSE_EVENT, "Unexpected event type");
+  MOZ_ASSERT(aEvent->mClass == eMouseEventClass, "Unexpected event type");
 
   if (!mSpinBox) {
     // we don't have a spinner
     return eSpinButtonNone;
   }
   if (aEvent->originalTarget == mSpinUp) {
     return eSpinButtonUp;
   }
--- a/layout/forms/nsRangeFrame.cpp
+++ b/layout/forms/nsRangeFrame.cpp
@@ -461,17 +461,17 @@ nsRangeFrame::GetValueAsFractionOfRange(
   MOZ_ASSERT(value >= minimum && value <= maximum, "Unsanitized value");
   
   return ((value - minimum) / (maximum - minimum)).toDouble();
 }
 
 Decimal
 nsRangeFrame::GetValueAtEventPoint(WidgetGUIEvent* aEvent)
 {
-  MOZ_ASSERT(aEvent->mClass == NS_MOUSE_EVENT ||
+  MOZ_ASSERT(aEvent->mClass == eMouseEventClass ||
              aEvent->mClass == NS_TOUCH_EVENT,
              "Unexpected event type - aEvent->refPoint may be meaningless");
 
   MOZ_ASSERT(mContent->IsHTML(nsGkAtoms::input), "bad cast");
   dom::HTMLInputElement* input = static_cast<dom::HTMLInputElement*>(mContent);
 
   MOZ_ASSERT(input->GetType() == NS_FORM_INPUT_RANGE);
 
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -2460,17 +2460,17 @@ nsFrame::HandleEvent(nsPresContext* aPre
 {
 
   if (aEvent->message == NS_MOUSE_MOVE) {
     // XXX If the second argument of HandleDrag() is WidgetMouseEvent,
     //     the implementation becomes simpler.
     return HandleDrag(aPresContext, aEvent, aEventStatus);
   }
 
-  if ((aEvent->mClass == NS_MOUSE_EVENT &&
+  if ((aEvent->mClass == eMouseEventClass &&
        aEvent->AsMouseEvent()->button == WidgetMouseEvent::eLeftButton) ||
       aEvent->mClass == NS_TOUCH_EVENT) {
     if (aEvent->message == NS_MOUSE_BUTTON_DOWN || aEvent->message == NS_TOUCH_START) {
       HandlePress(aPresContext, aEvent, aEventStatus);
     } else if (aEvent->message == NS_MOUSE_BUTTON_UP || aEvent->message == NS_TOUCH_END) {
       HandleRelease(aPresContext, aEvent, aEventStatus);
     }
   }
@@ -3068,17 +3068,17 @@ nsFrame::PeekBackwardAndForward(nsSelect
   // maintain selection
   return frameSelection->MaintainSelection(aAmountBack);
 }
 
 NS_IMETHODIMP nsFrame::HandleDrag(nsPresContext* aPresContext, 
                                   WidgetGUIEvent* aEvent,
                                   nsEventStatus* aEventStatus)
 {
-  MOZ_ASSERT(aEvent->mClass == NS_MOUSE_EVENT,
+  MOZ_ASSERT(aEvent->mClass == eMouseEventClass,
              "HandleDrag can only handle mouse event");
 
   bool selectable;
   IsSelectable(&selectable, nullptr);
 
   // XXX Do we really need to exclude non-selectable content here?
   // GetContentOffsetsFromPoint can handle it just fine, although some
   // other stuff might not like it.
@@ -3204,17 +3204,17 @@ HandleFrameSelection(nsFrameSelection*  
 
   return NS_OK;
 }
 
 NS_IMETHODIMP nsFrame::HandleRelease(nsPresContext* aPresContext,
                                      WidgetGUIEvent* aEvent,
                                      nsEventStatus* aEventStatus)
 {
-  if (aEvent->mClass != NS_MOUSE_EVENT) {
+  if (aEvent->mClass != eMouseEventClass) {
     return NS_OK;
   }
 
   nsIFrame* activeFrame = GetActiveSelectionFrame(aPresContext, this);
 
   nsCOMPtr<nsIContent> captureContent = nsIPresShell::GetCapturingContent();
 
   // We can unconditionally stop capturing because
--- a/layout/xul/nsResizerFrame.cpp
+++ b/layout/xul/nsResizerFrame.cpp
@@ -60,17 +60,17 @@ nsResizerFrame::HandleEvent(nsPresContex
 
   nsWeakFrame weakFrame(this);
   bool doDefault = true;
 
   switch (aEvent->message) {
     case NS_TOUCH_START:
     case NS_MOUSE_BUTTON_DOWN: {
       if (aEvent->mClass == NS_TOUCH_EVENT ||
-          (aEvent->mClass == NS_MOUSE_EVENT &&
+          (aEvent->mClass == eMouseEventClass &&
            aEvent->AsMouseEvent()->button == WidgetMouseEvent::eLeftButton)) {
         nsCOMPtr<nsIBaseWindow> window;
         nsIPresShell* presShell = aPresContext->GetPresShell();
         nsIContent* contentToResize =
           GetContentToResize(presShell, getter_AddRefs(window));
         if (contentToResize) {
           nsIFrame* frameToResize = contentToResize->GetPrimaryFrame();
           if (!frameToResize)
@@ -125,17 +125,17 @@ nsResizerFrame::HandleEvent(nsPresContex
         nsIPresShell::SetCapturingContent(GetContent(), CAPTURE_IGNOREALLOWED);
       }
     }
     break;
 
   case NS_TOUCH_END:
   case NS_MOUSE_BUTTON_UP: {
     if (aEvent->mClass == NS_TOUCH_EVENT ||
-        (aEvent->mClass == NS_MOUSE_EVENT &&
+        (aEvent->mClass == eMouseEventClass &&
          aEvent->AsMouseEvent()->button == WidgetMouseEvent::eLeftButton)) {
       // we're done tracking.
       mTrackingMouseMove = false;
 
       nsIPresShell::SetCapturingContent(nullptr, 0);
 
       doDefault = false;
     }
--- a/layout/xul/nsXULPopupManager.cpp
+++ b/layout/xul/nsXULPopupManager.cpp
@@ -541,17 +541,17 @@ nsXULPopupManager::InitTriggerEvent(nsID
         nsPresContext* presContext;
         if (presShell && (presContext = presShell->GetPresContext())) {
           nsPresContext* rootDocPresContext =
             presContext->GetRootPresContext();
           if (!rootDocPresContext)
             return;
           nsIFrame* rootDocumentRootFrame = rootDocPresContext->
               PresShell()->FrameManager()->GetRootFrame();
-          if ((event->mClass == NS_MOUSE_EVENT || 
+          if ((event->mClass == eMouseEventClass || 
                event->mClass == NS_MOUSE_SCROLL_EVENT ||
                event->mClass == NS_WHEEL_EVENT) &&
                !event->AsGUIEvent()->widget) {
             // no widget, so just use the client point if available
             nsCOMPtr<nsIDOMMouseEvent> mouseEvent = do_QueryInterface(aEvent);
             nsIntPoint clientPt;
             mouseEvent->GetClientX(&clientPt.x);
             mouseEvent->GetClientY(&clientPt.y);
--- a/widget/BasicEvents.h
+++ b/widget/BasicEvents.h
@@ -35,17 +35,17 @@ enum EventClassID MOZ_ENUM_TYPE(EventCla
   eKeyboardEventClass,               // WidgetKeyboardEvent
   eCompositionEventClass,            // WidgetCompositionEvent
   eTextEventClass,                   // WidgetTextEvent
   eQueryContentEventClass,           // WidgetQueryContentEvent
   eSelectionEventClass,              // WidgetSelectionEvent
   eEditorInputEventClass,            // InternalEditorInputEvent
 
   // MouseEvents.h
-  NS_MOUSE_EVENT,                    // WidgetMouseEvent
+  eMouseEventClass,                  // WidgetMouseEvent
   NS_DRAG_EVENT,                     // WidgetDragEvent
   NS_MOUSE_SCROLL_EVENT,             // WidgetMouseScrollEvent
   NS_WHEEL_EVENT,                    // WidgetWheelEvent
   NS_POINTER_EVENT,                  // PointerEvent
 
   // TouchEvents.h
   NS_GESTURENOTIFY_EVENT,            // WidgetGestureNotifyEvent
   NS_SIMPLE_GESTURE_EVENT,           // WidgetSimpleGestureEvent
--- a/widget/MouseEvents.h
+++ b/widget/MouseEvents.h
@@ -210,17 +210,17 @@ protected:
     }
   }
 
 public:
   virtual WidgetMouseEvent* AsMouseEvent() MOZ_OVERRIDE { return this; }
 
   WidgetMouseEvent(bool aIsTrusted, uint32_t aMessage, nsIWidget* aWidget,
                    reasonType aReason, contextType aContext = eNormal) :
-    WidgetMouseEventBase(aIsTrusted, aMessage, aWidget, NS_MOUSE_EVENT),
+    WidgetMouseEventBase(aIsTrusted, aMessage, aWidget, eMouseEventClass),
     acceptActivation(false), ignoreRootScrollFrame(false),
     reason(aReason), context(aContext), exit(eChild), clickCount(0)
   {
     switch (aMessage) {
       case NS_MOUSEENTER:
       case NS_MOUSELEAVE:
         mFlags.mBubbles = false;
         mFlags.mCancelable = false;
@@ -240,17 +240,17 @@ public:
                      button ==
                        ((context == eNormal) ? eRightButton : eLeftButton),
                      "Wrong button set to NS_CONTEXTMENU event?");
   }
 #endif
 
   virtual WidgetEvent* Duplicate() const MOZ_OVERRIDE
   {
-    MOZ_ASSERT(mClass == NS_MOUSE_EVENT,
+    MOZ_ASSERT(mClass == eMouseEventClass,
                "Duplicate() must be overridden by sub class");
     // Not copying widget, it is a weak reference.
     WidgetMouseEvent* result =
       new WidgetMouseEvent(false, message, nullptr, reason, context);
     result->AssignMouseEventData(*this, true);
     result->mFlags = mFlags;
     return result;
   }
--- a/widget/gtk/nsGtkKeyUtils.cpp
+++ b/widget/gtk/nsGtkKeyUtils.cpp
@@ -642,17 +642,17 @@ KeymapWrapper::InitInputEvent(WidgetInpu
          GetBoolName(aInputEvent.modifiers & MODIFIER_META),
          GetBoolName(aInputEvent.modifiers & MODIFIER_OS),
          GetBoolName(aInputEvent.modifiers & MODIFIER_ALTGRAPH),
          GetBoolName(aInputEvent.modifiers & MODIFIER_CAPSLOCK),
          GetBoolName(aInputEvent.modifiers & MODIFIER_NUMLOCK),
          GetBoolName(aInputEvent.modifiers & MODIFIER_SCROLLLOCK)));
 
     switch(aInputEvent.mClass) {
-        case NS_MOUSE_EVENT:
+        case eMouseEventClass:
         case NS_MOUSE_SCROLL_EVENT:
         case NS_WHEEL_EVENT:
         case NS_DRAG_EVENT:
         case NS_SIMPLE_GESTURE_EVENT:
             break;
         default:
             return;
     }
--- a/widget/gtk/nsWindow.cpp
+++ b/widget/gtk/nsWindow.cpp
@@ -6206,17 +6206,17 @@ nsWindow::GetDragInfo(WidgetMouseEvent* 
 
     return true;
 }
 
 NS_IMETHODIMP
 nsWindow::BeginMoveDrag(WidgetMouseEvent* aEvent)
 {
     NS_ABORT_IF_FALSE(aEvent, "must have event");
-    NS_ABORT_IF_FALSE(aEvent->mClass == NS_MOUSE_EVENT,
+    NS_ABORT_IF_FALSE(aEvent->mClass == eMouseEventClass,
                       "event must have correct struct type");
 
     GdkWindow *gdk_window;
     gint button, screenX, screenY;
     if (!GetDragInfo(aEvent, &gdk_window, &button, &screenX, &screenY)) {
         return NS_ERROR_FAILURE;
     }
 
@@ -6229,17 +6229,17 @@ nsWindow::BeginMoveDrag(WidgetMouseEvent
 
 NS_IMETHODIMP
 nsWindow::BeginResizeDrag(WidgetGUIEvent* aEvent,
                           int32_t aHorizontal,
                           int32_t aVertical)
 {
     NS_ENSURE_ARG_POINTER(aEvent);
 
-    if (aEvent->mClass != NS_MOUSE_EVENT) {
+    if (aEvent->mClass != eMouseEventClass) {
         // you can only begin a resize drag with a mouse event
         return NS_ERROR_INVALID_ARG;
     }
 
     GdkWindow *gdk_window;
     gint button, screenX, screenY;
     if (!GetDragInfo(aEvent->AsMouseEvent(), &gdk_window, &button,
                      &screenX, &screenY)) {
--- a/widget/shared/WidgetEventImpl.cpp
+++ b/widget/shared/WidgetEventImpl.cpp
@@ -211,17 +211,17 @@ WidgetEvent::IsTargetedAtFocusedContent(
   return HasKeyEventMessage() || IsIMERelatedEvent() ||
          IsRetargetedNativeEventDelivererForPlugin();
 }
 
 bool
 WidgetEvent::IsAllowedToDispatchDOMEvent() const
 {
   switch (mClass) {
-    case NS_MOUSE_EVENT:
+    case eMouseEventClass:
     case NS_POINTER_EVENT:
       // We want synthesized mouse moves to cause mouseover and mouseout
       // DOM events (EventStateManager::PreHandleEvent), but not mousemove
       // DOM events.
       // Synthesized button up events also do not cause DOM events because they
       // do not have a reliable refPoint.
       return AsMouseEvent()->reason == WidgetMouseEvent::eReal;
 
--- a/widget/windows/KeyboardLayout.cpp
+++ b/widget/windows/KeyboardLayout.cpp
@@ -276,32 +276,32 @@ ModifierKeyState::Set(Modifiers aAddingM
 }
 
 void
 ModifierKeyState::InitInputEvent(WidgetInputEvent& aInputEvent) const
 {
   aInputEvent.modifiers = mModifiers;
 
   switch(aInputEvent.mClass) {
-    case NS_MOUSE_EVENT:
+    case eMouseEventClass:
     case NS_MOUSE_SCROLL_EVENT:
     case NS_WHEEL_EVENT:
     case NS_DRAG_EVENT:
     case NS_SIMPLE_GESTURE_EVENT:
       InitMouseEvent(aInputEvent);
       break;
     default:
       break;
   }
 }
 
 void
 ModifierKeyState::InitMouseEvent(WidgetInputEvent& aMouseEvent) const
 {
-  NS_ASSERTION(aMouseEvent.mClass == NS_MOUSE_EVENT ||
+  NS_ASSERTION(aMouseEvent.mClass == eMouseEventClass ||
                aMouseEvent.mClass == NS_WHEEL_EVENT ||
                aMouseEvent.mClass == NS_DRAG_EVENT ||
                aMouseEvent.mClass == NS_SIMPLE_GESTURE_EVENT,
                "called with non-mouse event");
 
   if (XRE_GetWindowsEnvironment() == WindowsEnvironmentType_Metro) {
     // Buttons for immersive mode are handled in MetroInput.
     return;
--- a/widget/windows/nsWindow.cpp
+++ b/widget/windows/nsWindow.cpp
@@ -1533,17 +1533,17 @@ NS_METHOD nsWindow::Resize(double aX, do
 
 NS_IMETHODIMP
 nsWindow::BeginResizeDrag(WidgetGUIEvent* aEvent,
                           int32_t aHorizontal,
                           int32_t aVertical)
 {
   NS_ENSURE_ARG_POINTER(aEvent);
 
-  if (aEvent->mClass != NS_MOUSE_EVENT) {
+  if (aEvent->mClass != eMouseEventClass) {
     // you can only begin a resize drag with a mouse event
     return NS_ERROR_INVALID_ARG;
   }
 
   if (aEvent->AsMouseEvent()->button != WidgetMouseEvent::eLeftButton) {
     // you can only begin a resize drag with the left mouse button
     return NS_ERROR_INVALID_ARG;
   }