Bug 895274 part.26 Rename NS_MOUSE_BUTTON_UP to eMouseUp r=smaug
authorMasayuki Nakano <masayuki@d-toybox.com>
Sat, 29 Aug 2015 08:58:30 +0900
changeset 294243 ae625cd90875c0f939e83fc58c9e40fb3b6fd75f
parent 294242 cd4d30cf8ecfb8789d0e69c2adcdfe4c1de7ac8f
child 294244 e637f3ff6f3e3add6aa4ac4b7325e3983504cef7
push id962
push userjlund@mozilla.com
push dateFri, 04 Dec 2015 23:28:54 +0000
treeherdermozilla-release@23a2d286e80f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs895274
milestone43.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 895274 part.26 Rename NS_MOUSE_BUTTON_UP to eMouseUp r=smaug
accessible/base/nsCoreUtils.cpp
accessible/generic/Accessible.cpp
dom/base/nsContentUtils.cpp
dom/base/nsGlobalWindow.cpp
dom/events/Event.cpp
dom/events/EventNameList.h
dom/events/EventStateManager.cpp
dom/events/IMEContentObserver.cpp
dom/events/WheelHandlingHelper.cpp
dom/html/HTMLButtonElement.cpp
dom/html/HTMLInputElement.cpp
dom/ipc/TabChild.cpp
dom/plugins/base/nsPluginInstanceOwner.cpp
dom/xul/nsXULElement.cpp
editor/libeditor/nsEditorEventListener.cpp
gfx/layers/apz/src/APZCTreeManager.cpp
gfx/layers/apz/util/APZCCallbackHelper.cpp
layout/base/AccessibleCaretEventHub.cpp
layout/base/SelectionCarets.cpp
layout/base/TouchCaret.cpp
layout/base/gtest/TestAccessibleCaretEventHub.cpp
layout/base/nsPresShell.cpp
layout/forms/nsImageControlFrame.cpp
layout/generic/nsFrame.cpp
layout/generic/nsFrameSetFrame.cpp
layout/generic/nsImageFrame.cpp
layout/generic/nsPluginFrame.cpp
layout/xul/nsMenuFrame.cpp
layout/xul/nsResizerFrame.cpp
layout/xul/nsRootBoxFrame.cpp
layout/xul/nsScrollbarButtonFrame.cpp
layout/xul/nsSliderFrame.cpp
layout/xul/nsSplitterFrame.cpp
layout/xul/nsTitleBarFrame.cpp
widget/EventMessageList.h
widget/InputData.cpp
widget/WidgetEventImpl.cpp
widget/cocoa/nsChildView.mm
widget/gtk/nsWindow.cpp
widget/nsBaseWidget.cpp
widget/qt/nsWindow.cpp
widget/uikit/nsWindow.mm
widget/windows/TSFTextStore.cpp
widget/windows/WinUtils.cpp
widget/windows/nsWindow.cpp
--- a/accessible/base/nsCoreUtils.cpp
+++ b/accessible/base/nsCoreUtils.cpp
@@ -108,17 +108,17 @@ nsCoreUtils::DispatchClickEvent(nsITreeB
     presContext->AppUnitsToDevPixels(offset.x);
   int32_t cnvdY = presContext->CSSPixelsToDevPixels(tcY + y + 1) +
     presContext->AppUnitsToDevPixels(offset.y);
 
   // XUL is just desktop, so there is no real reason for senfing touch events.
   DispatchMouseEvent(NS_MOUSE_BUTTON_DOWN, cnvdX, cnvdY,
                      tcContent, tcFrame, presShell, rootWidget);
 
-  DispatchMouseEvent(NS_MOUSE_BUTTON_UP, cnvdX, cnvdY,
+  DispatchMouseEvent(eMouseUp, cnvdX, cnvdY,
                      tcContent, tcFrame, presShell, rootWidget);
 }
 
 void
 nsCoreUtils::DispatchMouseEvent(EventMessage aMessage, int32_t aX, int32_t aY,
                                 nsIContent *aContent, nsIFrame *aFrame,
                                 nsIPresShell *aPresShell, nsIWidget *aRootWidget)
 {
--- a/accessible/generic/Accessible.cpp
+++ b/accessible/generic/Accessible.cpp
@@ -1832,17 +1832,18 @@ Accessible::DispatchClickEvent(nsIConten
   nsRefPtr<nsPresContext> presContext = presShell->GetPresContext();
   int32_t x = presContext->AppUnitsToDevPixels(point.x + size.width / 2);
   int32_t y = presContext->AppUnitsToDevPixels(point.y + size.height / 2);
 
   // Simulate a touch interaction by dispatching touch events with mouse events.
   nsCoreUtils::DispatchTouchEvent(NS_TOUCH_START, x, y, aContent, frame, presShell, widget);
   nsCoreUtils::DispatchMouseEvent(NS_MOUSE_BUTTON_DOWN, x, y, aContent, frame, presShell, widget);
   nsCoreUtils::DispatchTouchEvent(NS_TOUCH_END, x, y, aContent, frame, presShell, widget);
-  nsCoreUtils::DispatchMouseEvent(NS_MOUSE_BUTTON_UP, x, y, aContent, frame, presShell, widget);
+  nsCoreUtils::DispatchMouseEvent(eMouseUp, x, y, aContent, frame,
+                                  presShell, widget);
 }
 
 void
 Accessible::ScrollToPoint(uint32_t aCoordinateType, int32_t aX, int32_t aY)
 {
   nsIFrame* frame = GetFrame();
   if (!frame)
     return;
--- a/dom/base/nsContentUtils.cpp
+++ b/dom/base/nsContentUtils.cpp
@@ -7835,17 +7835,17 @@ nsContentUtils::SendMouseEvent(nsCOMPtr<
   if (!widget)
     return NS_ERROR_FAILURE;
 
   EventMessage msg;
   bool contextMenuKey = false;
   if (aType.EqualsLiteral("mousedown"))
     msg = NS_MOUSE_BUTTON_DOWN;
   else if (aType.EqualsLiteral("mouseup"))
-    msg = NS_MOUSE_BUTTON_UP;
+    msg = eMouseUp;
   else if (aType.EqualsLiteral("mousemove"))
     msg = eMouseMove;
   else if (aType.EqualsLiteral("mouseover"))
     msg = NS_MOUSE_ENTER_WIDGET;
   else if (aType.EqualsLiteral("mouseout"))
     msg = NS_MOUSE_EXIT_WIDGET;
   else if (aType.EqualsLiteral("contextmenu")) {
     msg = NS_CONTEXTMENU;
--- a/dom/base/nsGlobalWindow.cpp
+++ b/dom/base/nsGlobalWindow.cpp
@@ -3082,18 +3082,17 @@ nsGlobalWindow::PreHandleEvent(EventChai
     nsCOMPtr<nsPIDOMWindow> window =
       do_QueryInterface(aVisitor.mEvent->originalTarget);
     if (window) {
       mIsHandlingResizeEvent = true;
     }
   } else if (msg == NS_MOUSE_BUTTON_DOWN &&
              aVisitor.mEvent->mFlags.mIsTrusted) {
     gMouseDown = true;
-  } else if ((msg == NS_MOUSE_BUTTON_UP ||
-              msg == NS_DRAGDROP_END) &&
+  } else if ((msg == eMouseUp || msg == NS_DRAGDROP_END) &&
              aVisitor.mEvent->mFlags.mIsTrusted) {
     gMouseDown = false;
     if (gDragServiceDisabled) {
       nsCOMPtr<nsIDragService> ds =
         do_GetService("@mozilla.org/widget/dragservice;1");
       if (ds) {
         gDragServiceDisabled = false;
         ds->Unsuppress();
--- a/dom/events/Event.cpp
+++ b/dom/events/Event.cpp
@@ -813,17 +813,17 @@ Event::GetEventPopupControlState(WidgetE
         break;
       }
     }
     break;
   case eMouseEventClass:
     if (aEvent->mFlags.mIsTrusted &&
         aEvent->AsMouseEvent()->button == WidgetMouseEvent::eLeftButton) {
       switch(aEvent->mMessage) {
-      case NS_MOUSE_BUTTON_UP :
+      case eMouseUp:
         if (PopupAllowedForEvent("mouseup")) {
           abuse = openControlled;
         }
         break;
       case NS_MOUSE_BUTTON_DOWN :
         if (PopupAllowedForEvent("mousedown")) {
           abuse = openControlled;
         }
--- a/dom/events/EventNameList.h
+++ b/dom/events/EventNameList.h
@@ -286,17 +286,17 @@ EVENT(mouseout,
       NS_MOUSE_OUT,
       EventNameType_All,
       eMouseEventClass)
 EVENT(mouseover,
       NS_MOUSE_OVER,
       EventNameType_All,
       eMouseEventClass)
 EVENT(mouseup,
-      NS_MOUSE_BUTTON_UP,
+      eMouseUp,
       EventNameType_All,
       eMouseEventClass)
 EVENT(mozfullscreenchange,
       NS_FULLSCREENCHANGE,
       EventNameType_HTML,
       eBasicEventClass)
 EVENT(mozfullscreenerror,
       NS_FULLSCREENERROR,
--- a/dom/events/EventStateManager.cpp
+++ b/dom/events/EventStateManager.cpp
@@ -562,17 +562,17 @@ EventStateManager::PreHandleEvent(nsPres
       break;
     case WidgetMouseEvent::eRightButton:
       mRClickCount = mouseEvent->clickCount;
       SetClickCount(aPresContext, mouseEvent, aStatus);
       break;
     }
     break;
   }
-  case NS_MOUSE_BUTTON_UP: {
+  case eMouseUp: {
     switch (mouseEvent->button) {
       case WidgetMouseEvent::eLeftButton:
         if (Prefs::ClickHoldContextMenu()) {
           KillClickHoldTimer();
         }
         StopTrackingDragGesture();
         sNormalLMouseEventInProcess = false;
         // then fall through...
@@ -1166,17 +1166,17 @@ CrossProcessSafeEvent(const WidgetEvent&
 {
   switch (aEvent.mClass) {
   case eKeyboardEventClass:
   case eWheelEventClass:
     return true;
   case eMouseEventClass:
     switch (aEvent.mMessage) {
     case NS_MOUSE_BUTTON_DOWN:
-    case NS_MOUSE_BUTTON_UP:
+    case eMouseUp:
     case eMouseMove:
     case NS_CONTEXTMENU:
     case NS_MOUSE_ENTER_WIDGET:
     case NS_MOUSE_EXIT_WIDGET:
       return true;
     default:
       return false;
     }
@@ -2790,17 +2790,17 @@ EventStateManager::PostHandleEvent(nsPre
   bool dispatchedToContentProcess = HandleCrossProcessEvent(aEvent,
                                                             aStatus);
 
   mCurrentTarget = aTargetFrame;
   mCurrentTargetContent = nullptr;
 
   // Most of the events we handle below require a frame.
   // Add special cases here.
-  if (!mCurrentTarget && aEvent->mMessage != NS_MOUSE_BUTTON_UP &&
+  if (!mCurrentTarget && aEvent->mMessage != eMouseUp &&
       aEvent->mMessage != NS_MOUSE_BUTTON_DOWN) {
     return NS_OK;
   }
 
   //Keep the prescontext alive, we might need it after event dispatch
   nsRefPtr<nsPresContext> presContext = aPresContext;
   nsresult ret = NS_OK;
 
@@ -3012,17 +3012,17 @@ EventStateManager::PostHandleEvent(nsPre
     // After UP/Cancel Touch pointers become invalid so we can remove relevant helper from Table
     // Mouse/Pen pointers are valid all the time (not only between down/up)
     if (pointerEvent->inputSource == nsIDOMMouseEvent::MOZ_SOURCE_TOUCH) {
       mPointersEnterLeaveHelper.Remove(pointerEvent->pointerId);
       GenerateMouseEnterExit(pointerEvent);
     }
     break;
   }
-  case NS_MOUSE_BUTTON_UP:
+  case eMouseUp:
     {
       ClearGlobalActiveContent(this);
       WidgetMouseEvent* mouseEvent = aEvent->AsMouseEvent();
       if (mouseEvent && mouseEvent->IsReal()) {
         if (!mCurrentTarget) {
           GetEventTarget();
         }
         // Make sure to dispatch the click even if there is no frame for
@@ -4436,17 +4436,17 @@ EventStateManager::SetClickCount(nsPresC
     }
   }
 
   switch (aEvent->button) {
   case WidgetMouseEvent::eLeftButton:
     if (aEvent->mMessage == NS_MOUSE_BUTTON_DOWN) {
       mLastLeftMouseDownContent = mouseContent;
       mLastLeftMouseDownContentParent = mouseContentParent;
-    } else if (aEvent->mMessage == NS_MOUSE_BUTTON_UP) {
+    } else if (aEvent->mMessage == eMouseUp) {
       if (mLastLeftMouseDownContent == mouseContent ||
           mLastLeftMouseDownContentParent == mouseContent ||
           mLastLeftMouseDownContent == mouseContentParent) {
         aEvent->clickCount = mLClickCount;
         mLClickCount = 0;
       } else {
         aEvent->clickCount = 0;
       }
@@ -4454,17 +4454,17 @@ EventStateManager::SetClickCount(nsPresC
       mLastLeftMouseDownContentParent = nullptr;
     }
     break;
 
   case WidgetMouseEvent::eMiddleButton:
     if (aEvent->mMessage == NS_MOUSE_BUTTON_DOWN) {
       mLastMiddleMouseDownContent = mouseContent;
       mLastMiddleMouseDownContentParent = mouseContentParent;
-    } else if (aEvent->mMessage == NS_MOUSE_BUTTON_UP) {
+    } else if (aEvent->mMessage == eMouseUp) {
       if (mLastMiddleMouseDownContent == mouseContent ||
           mLastMiddleMouseDownContentParent == mouseContent ||
           mLastMiddleMouseDownContent == mouseContentParent) {
         aEvent->clickCount = mMClickCount;
         mMClickCount = 0;
       } else {
         aEvent->clickCount = 0;
       }
@@ -4472,17 +4472,17 @@ EventStateManager::SetClickCount(nsPresC
       mLastMiddleMouseDownContentParent = nullptr;
     }
     break;
 
   case WidgetMouseEvent::eRightButton:
     if (aEvent->mMessage == NS_MOUSE_BUTTON_DOWN) {
       mLastRightMouseDownContent = mouseContent;
       mLastRightMouseDownContentParent = mouseContentParent;
-    } else if (aEvent->mMessage == NS_MOUSE_BUTTON_UP) {
+    } else if (aEvent->mMessage == eMouseUp) {
       if (mLastRightMouseDownContent == mouseContent ||
           mLastRightMouseDownContentParent == mouseContent ||
           mLastRightMouseDownContent == mouseContentParent) {
         aEvent->clickCount = mRClickCount;
         mRClickCount = 0;
       } else {
         aEvent->clickCount = 0;
       }
@@ -5760,17 +5760,17 @@ AutoHandlingUserInputStatePusher::AutoHa
     nsIPresShell::SetCapturingContent(nullptr, 0);
     nsIPresShell::AllowMouseCapture(true);
   }
   if (!aDocument || !aEvent || !aEvent->mFlags.mIsTrusted) {
     return;
   }
   mResetFMMouseButtonHandlingState =
     (aEvent->mMessage == NS_MOUSE_BUTTON_DOWN ||
-     aEvent->mMessage == NS_MOUSE_BUTTON_UP);
+     aEvent->mMessage == eMouseUp);
   if (mResetFMMouseButtonHandlingState) {
     nsFocusManager* fm = nsFocusManager::GetFocusManager();
     NS_ENSURE_TRUE_VOID(fm);
     // If it's in modal state, mouse button event handling may be nested.
     // E.g., a modal dialog is opened at mousedown or mouseup event handler
     // and the dialog is clicked.  Therefore, we should store current
     // mouse button event handling document if nsFocusManager already has it.
     mMouseButtonEventHandlingDocument =
--- a/dom/events/IMEContentObserver.cpp
+++ b/dom/events/IMEContentObserver.cpp
@@ -452,17 +452,17 @@ IMEContentObserver::OnMouseButtonEvent(n
   }
   if (!aMouseEvent->mFlags.mIsTrusted ||
       aMouseEvent->mFlags.mDefaultPrevented ||
       !aMouseEvent->widget) {
     return false;
   }
   // Now, we need to notify only mouse down and mouse up event.
   switch (aMouseEvent->mMessage) {
-    case NS_MOUSE_BUTTON_UP:
+    case eMouseUp:
     case NS_MOUSE_BUTTON_DOWN:
       break;
     default:
       return false;
   }
   if (NS_WARN_IF(!mWidget) || NS_WARN_IF(mWidget->Destroyed())) {
     return false;
   }
--- a/dom/events/WheelHandlingHelper.cpp
+++ b/dom/events/WheelHandlingHelper.cpp
@@ -205,17 +205,17 @@ WheelTransaction::OnEvent(WidgetEvent* a
           sMouseMoved = PR_IntervalToMilliseconds(PR_IntervalNow());
         }
       }
       return;
     }
     case eKeyPress:
     case eKeyUp:
     case eKeyDown:
-    case NS_MOUSE_BUTTON_UP:
+    case eMouseUp:
     case NS_MOUSE_BUTTON_DOWN:
     case NS_MOUSE_DOUBLECLICK:
     case NS_MOUSE_CLICK:
     case NS_CONTEXTMENU:
     case NS_DRAGDROP_DROP:
       EndTransaction();
       return;
     default:
--- a/dom/html/HTMLButtonElement.cpp
+++ b/dom/html/HTMLButtonElement.cpp
@@ -329,17 +329,17 @@ HTMLButtonElement::PostHandleEvent(Event
               aVisitor.mDOMEvent->StopPropagation();
             }
           }
         }
         break;
 
       // cancel all of these events for buttons
       //XXXsmaug What to do with these events? Why these should be cancelled?
-      case NS_MOUSE_BUTTON_UP:
+      case eMouseUp:
       case NS_MOUSE_DOUBLECLICK:
         {
           WidgetMouseEvent* mouseEvent = aVisitor.mEvent->AsMouseEvent();
           if (aVisitor.mDOMEvent &&
               (mouseEvent->button == WidgetMouseEvent::eMiddleButton ||
                mouseEvent->button == WidgetMouseEvent::eRightButton)) {
             aVisitor.mDOMEvent->StopPropagation();
           }
--- a/dom/html/HTMLInputElement.cpp
+++ b/dom/html/HTMLInputElement.cpp
@@ -3223,17 +3223,17 @@ HTMLInputElement::PreHandleEvent(EventCh
             if (numberControlFrame) {
               numberControlFrame->SpinnerStateChanged();
             }
           }
         }
         if (stopSpin) {
           StopNumberControlSpinnerSpin();
         }
-      } else if (aVisitor.mEvent->mMessage == NS_MOUSE_BUTTON_UP) {
+      } else if (aVisitor.mEvent->mMessage == eMouseUp) {
         StopNumberControlSpinnerSpin();
       }
     }
     if (aVisitor.mEvent->mMessage == NS_FOCUS_CONTENT ||
         aVisitor.mEvent->mMessage == NS_BLUR_CONTENT) {
       if (aVisitor.mEvent->mMessage == NS_FOCUS_CONTENT) {
         // Tell our frame it's getting focus so that it can make sure focus
         // is moved to our anonymous text control.
@@ -3934,17 +3934,17 @@ HTMLInputElement::PostHandleEvent(EventC
               SetValueOfRangeForUserEvent(newValue);
               aVisitor.mEventStatus = nsEventStatus_eConsumeNoDefault;
             }
           }
 
         } break; // eKeyPress || eKeyUp
 
         case NS_MOUSE_BUTTON_DOWN:
-        case NS_MOUSE_BUTTON_UP:
+        case eMouseUp:
         case NS_MOUSE_DOUBLECLICK:
         {
           // cancel all of these events for buttons
           //XXXsmaug Why?
           WidgetMouseEvent* mouseEvent = aVisitor.mEvent->AsMouseEvent();
           if (mouseEvent->button == WidgetMouseEvent::eMiddleButton ||
               mouseEvent->button == WidgetMouseEvent::eRightButton) {
             if (mType == NS_FORM_INPUT_BUTTON ||
@@ -4128,17 +4128,17 @@ HTMLInputElement::PostHandleEventForRang
         CancelRangeThumbDrag();
         break;
       }
       SetValueOfRangeForUserEvent(
         rangeFrame->GetValueAtEventPoint(aVisitor.mEvent->AsInputEvent()));
       aVisitor.mEvent->mFlags.mMultipleActionsPrevented = true;
       break;
 
-    case NS_MOUSE_BUTTON_UP:
+    case eMouseUp:
     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).
--- a/dom/ipc/TabChild.cpp
+++ b/dom/ipc/TabChild.cpp
@@ -2054,17 +2054,17 @@ TabChild::UpdateTapState(const WidgetTou
 
   case NS_TOUCH_END:
     if (!TouchManager::gPreventMouseEvents) {
       APZCCallbackHelper::DispatchSynthesizedMouseEvent(
         eMouseMove, time, currentPoint, 0, mPuppetWidget);
       APZCCallbackHelper::DispatchSynthesizedMouseEvent(
         NS_MOUSE_BUTTON_DOWN, time, currentPoint, 0, mPuppetWidget);
       APZCCallbackHelper::DispatchSynthesizedMouseEvent(
-        NS_MOUSE_BUTTON_UP, time, currentPoint, 0, mPuppetWidget);
+        eMouseUp, time, currentPoint, 0, mPuppetWidget);
     }
     // fall through
   case NS_TOUCH_CANCEL:
     CancelTapTracking();
     return;
 
   default:
     NS_WARNING("Unknown touch event type");
--- a/dom/plugins/base/nsPluginInstanceOwner.cpp
+++ b/dom/plugins/base/nsPluginInstanceOwner.cpp
@@ -1678,17 +1678,17 @@ nsresult nsPluginInstanceOwner::Dispatch
   if (mouseEvent && mouseEvent->mClass == eMouseEventClass) {
     nsEventStatus rv = ProcessEvent(*mouseEvent);
     if (nsEventStatus_eConsumeNoDefault == rv) {
       aMouseEvent->PreventDefault();
       if (!aAllowPropagate) {
         aMouseEvent->StopPropagation();
       }
     }
-    if (mouseEvent->mMessage == NS_MOUSE_BUTTON_UP) {
+    if (mouseEvent->mMessage == eMouseUp) {
       mLastMouseDownButtonType = -1;
     }
   }
   return NS_OK;
 }
 
 nsresult
 nsPluginInstanceOwner::HandleEvent(nsIDOMEvent* aEvent)
@@ -1819,17 +1819,17 @@ CocoaEventTypeForEvent(const WidgetGUIEv
       if (nsIPresShell::GetCapturingContent()) {
         return NPCocoaEventMouseDragged;
       }
 
       return NPCocoaEventMouseMoved;
     }
     case NS_MOUSE_BUTTON_DOWN:
       return NPCocoaEventMouseDown;
-    case NS_MOUSE_BUTTON_UP:
+    case eMouseUp:
       return NPCocoaEventMouseUp;
     case eKeyDown:
       return NPCocoaEventKeyDown;
     case eKeyUp:
       return NPCocoaEventKeyUp;
     case NS_FOCUS_CONTENT:
     case NS_BLUR_CONTENT:
       return NPCocoaEventFocusChanged;
@@ -1844,17 +1844,17 @@ static NPCocoaEvent
 TranslateToNPCocoaEvent(WidgetGUIEvent* anEvent, nsIFrame* aObjectFrame)
 {
   NPCocoaEvent cocoaEvent;
   InitializeNPCocoaEvent(&cocoaEvent);
   cocoaEvent.type = CocoaEventTypeForEvent(*anEvent, aObjectFrame);
 
   if (anEvent->mMessage == eMouseMove ||
       anEvent->mMessage == NS_MOUSE_BUTTON_DOWN ||
-      anEvent->mMessage == NS_MOUSE_BUTTON_UP ||
+      anEvent->mMessage == eMouseUp ||
       anEvent->mMessage == NS_MOUSE_SCROLL ||
       anEvent->mMessage == NS_MOUSE_OVER ||
       anEvent->mMessage == NS_MOUSE_OUT)
   {
     nsPoint pt = nsLayoutUtils::GetEventCoordinatesRelativeTo(anEvent, aObjectFrame) -
                  aObjectFrame->GetContentRectRelativeToSelf().TopLeft();
     nsPresContext* presContext = aObjectFrame->PresContext();
     // Plugin event coordinates need to be translated from device pixels
@@ -1865,18 +1865,17 @@ TranslateToNPCocoaEvent(WidgetGUIEvent* 
     nsIntPoint ptPx(presContext->AppUnitsToDevPixels(pt.x) / intScaleFactor,
                     presContext->AppUnitsToDevPixels(pt.y) / intScaleFactor);
     cocoaEvent.data.mouse.pluginX = double(ptPx.x);
     cocoaEvent.data.mouse.pluginY = double(ptPx.y);
   }
 
   switch (anEvent->mMessage) {
     case NS_MOUSE_BUTTON_DOWN:
-    case NS_MOUSE_BUTTON_UP:
-    {
+    case eMouseUp: {
       WidgetMouseEvent* mouseEvent = anEvent->AsMouseEvent();
       if (mouseEvent) {
         switch (mouseEvent->button) {
           case WidgetMouseEvent::eLeftButton:
             cocoaEvent.data.mouse.buttonNumber = 0;
             break;
           case WidgetMouseEvent::eRightButton:
             cocoaEvent.data.mouse.buttonNumber = 1;
@@ -1884,17 +1883,17 @@ TranslateToNPCocoaEvent(WidgetGUIEvent* 
           case WidgetMouseEvent::eMiddleButton:
             cocoaEvent.data.mouse.buttonNumber = 2;
             break;
           default:
             NS_WARNING("Mouse button we don't know about?");
         }
         cocoaEvent.data.mouse.clickCount = mouseEvent->clickCount;
       } else {
-        NS_WARNING("NS_MOUSE_BUTTON_UP/DOWN is not a WidgetMouseEvent?");
+        NS_WARNING("eMouseUp/DOWN is not a WidgetMouseEvent?");
       }
       break;
     }
     case NS_MOUSE_SCROLL:
     {
       WidgetWheelEvent* wheelEvent = anEvent->AsWheelEvent();
       if (wheelEvent) {
         cocoaEvent.data.mouse.deltaX = wheelEvent->lineOrPageDeltaX;
@@ -2071,17 +2070,17 @@ nsEventStatus nsPluginInstanceOwner::Pro
           { WM_LBUTTONDBLCLK, WM_MBUTTONDBLCLK, WM_RBUTTONDBLCLK };
         if (mouseEvent->clickCount == 2) {
           pluginEvent.event = dblClickMsgs[mouseEvent->button];
         } else {
           pluginEvent.event = downMsgs[mouseEvent->button];
         }
         break;
       }
-      case NS_MOUSE_BUTTON_UP: {
+      case eMouseUp: {
         static const int upMsgs[] =
           { WM_LBUTTONUP, WM_MBUTTONUP, WM_RBUTTONUP };
         pluginEvent.event = upMsgs[mouseEvent->button];
         break;
       }
       // don't synthesize anything for NS_MOUSE_DOUBLECLICK, since that
       // is a synthetic event generated on mouse-up, and Windows WM_*DBLCLK
       // messages are sent on mouse-down
@@ -2101,17 +2100,17 @@ nsEventStatus nsPluginInstanceOwner::Pro
       }
     }
     if (pPluginEvent) {
       // Make event coordinates relative to our enclosing widget,
       // not the widget they were received on.
       // See use of NPEvent in widget/windows/nsWindow.cpp
       // for why this assert should be safe
       NS_ASSERTION(anEvent.mMessage == NS_MOUSE_BUTTON_DOWN ||
-                   anEvent.mMessage == NS_MOUSE_BUTTON_UP ||
+                   anEvent.mMessage == eMouseUp ||
                    anEvent.mMessage == NS_MOUSE_DOUBLECLICK ||
                    anEvent.mMessage == NS_MOUSE_OVER ||
                    anEvent.mMessage == NS_MOUSE_OUT ||
                    anEvent.mMessage == eMouseMove,
                    "Incorrect event type for coordinate translation");
       nsPoint pt =
         nsLayoutUtils::GetEventCoordinatesRelativeTo(&anEvent, mPluginFrame) -
         mPluginFrame->GetContentRectRelativeToSelf().TopLeft();
@@ -2232,17 +2231,17 @@ nsEventStatus nsPluginInstanceOwner::Pro
               event.state = XInputEventState(mouseEvent);
               // information lost
               event.subwindow = None;
               event.is_hint = NotifyNormal;
               event.same_screen = True;
             }
             break;
           case NS_MOUSE_BUTTON_DOWN:
-          case NS_MOUSE_BUTTON_UP:
+          case eMouseUp:
             {
               XButtonEvent& event = pluginEvent.xbutton;
               event.type = anEvent.mMessage == NS_MOUSE_BUTTON_DOWN ?
                 ButtonPress : ButtonRelease;
               event.root = root;
               event.time = anEvent.time;
               event.x = pluginPoint.x;
               event.y = pluginPoint.y;
@@ -2405,17 +2404,17 @@ nsEventStatus nsPluginInstanceOwner::Pro
               event.inSize = sizeof(ANPEvent);
               event.eventType = kMouse_ANPEventType;
               event.data.mouse.action = kDown_ANPMouseAction;
               event.data.mouse.x = pluginPoint.x;
               event.data.mouse.y = pluginPoint.y;
               mInstance->HandleEvent(&event, nullptr, NS_PLUGIN_CALL_SAFE_TO_REENTER_GECKO);
             }
             break;
-          case NS_MOUSE_BUTTON_UP:
+          case eMouseUp:
             {
               ANPEvent event;
               event.inSize = sizeof(ANPEvent);
               event.eventType = kMouse_ANPEventType;
               event.data.mouse.action = kUp_ANPMouseAction;
               event.data.mouse.x = pluginPoint.x;
               event.data.mouse.y = pluginPoint.y;
               mInstance->HandleEvent(&event, nullptr, NS_PLUGIN_CALL_SAFE_TO_REENTER_GECKO);
--- a/dom/xul/nsXULElement.cpp
+++ b/dom/xul/nsXULElement.cpp
@@ -1737,17 +1737,17 @@ nsXULElement::ClickWithInputSource(uint1
         if (shell) {
             // strong ref to PresContext so events don't destroy it
             nsRefPtr<nsPresContext> context = shell->GetPresContext();
 
             bool isCallerChrome = nsContentUtils::IsCallerChrome();
 
             WidgetMouseEvent eventDown(isCallerChrome, NS_MOUSE_BUTTON_DOWN,
                                        nullptr, WidgetMouseEvent::eReal);
-            WidgetMouseEvent eventUp(isCallerChrome, NS_MOUSE_BUTTON_UP,
+            WidgetMouseEvent eventUp(isCallerChrome, eMouseUp,
                                      nullptr, WidgetMouseEvent::eReal);
             WidgetMouseEvent eventClick(isCallerChrome, NS_MOUSE_CLICK, nullptr,
                                         WidgetMouseEvent::eReal);
             eventDown.inputSource = eventUp.inputSource = eventClick.inputSource
                                   = aInputSource;
 
             // send mouse down
             nsEventStatus status = nsEventStatus_eIgnore;
--- a/editor/libeditor/nsEditorEventListener.cpp
+++ b/editor/libeditor/nsEditorEventListener.cpp
@@ -417,17 +417,17 @@ nsEditorEventListener::HandleEvent(nsIDO
       // preceding mousedown and/or mouseup event is consumed by IME.
       // Therefore, even if case #2 or case #3 occurs,
       // mMouseDownOrUpConsumedByIME is true here.  Therefore, we should always
       // overwrite it here.
       mMouseDownOrUpConsumedByIME = NotifyIMEOfMouseButtonEvent(mouseEvent);
       return mMouseDownOrUpConsumedByIME ? NS_OK : MouseDown(mouseEvent);
     }
     // mouseup
-    case NS_MOUSE_BUTTON_UP: {
+    case eMouseUp: {
       nsCOMPtr<nsIDOMMouseEvent> mouseEvent = do_QueryInterface(aEvent);
       NS_ENSURE_TRUE(mouseEvent, NS_OK);
       // See above comment in the NS_MOUSE_BUTTON_DOWN case, first.
       // This code assumes that case #1 is occuring.  However, if case #3 may
       // occurs after case #2 and the mousedown is consumed,
       // mMouseDownOrUpConsumedByIME is true even though nsEditorEventListener
       // has not received the preceding mousedown event of this mouseup event.
       // So, mMouseDownOrUpConsumedByIME may be invalid here.  However,
--- a/gfx/layers/apz/src/APZCTreeManager.cpp
+++ b/gfx/layers/apz/src/APZCTreeManager.cpp
@@ -884,17 +884,17 @@ APZCTreeManager::UpdateWheelTransaction(
      ScreenIntPoint point =
        ViewAs<ScreenPixel>(aEvent.refPoint, PixelCastJustification::LayoutDeviceToScreenForUntransformedEvent);
      txn->OnMouseMove(point);
      return;
    }
    case eKeyPress:
    case eKeyUp:
    case eKeyDown:
-   case NS_MOUSE_BUTTON_UP:
+   case eMouseUp:
    case NS_MOUSE_BUTTON_DOWN:
    case NS_MOUSE_DOUBLECLICK:
    case NS_MOUSE_CLICK:
    case NS_CONTEXTMENU:
    case NS_DRAGDROP_DROP:
      txn->EndTransaction();
      return;
    default:
--- a/gfx/layers/apz/util/APZCCallbackHelper.cpp
+++ b/gfx/layers/apz/util/APZCCallbackHelper.cpp
@@ -492,17 +492,17 @@ APZCCallbackHelper::DispatchWidgetEvent(
 nsEventStatus
 APZCCallbackHelper::DispatchSynthesizedMouseEvent(EventMessage aMsg,
                                                   uint64_t aTime,
                                                   const LayoutDevicePoint& aRefPoint,
                                                   Modifiers aModifiers,
                                                   nsIWidget* aWidget)
 {
   MOZ_ASSERT(aMsg == eMouseMove || aMsg == NS_MOUSE_BUTTON_DOWN ||
-             aMsg == NS_MOUSE_BUTTON_UP || aMsg == NS_MOUSE_MOZLONGTAP);
+             aMsg == eMouseUp || aMsg == NS_MOUSE_MOZLONGTAP);
 
   WidgetMouseEvent event(true, aMsg, nullptr,
                          WidgetMouseEvent::eReal, WidgetMouseEvent::eNormal);
   event.refPoint = LayoutDeviceIntPoint(aRefPoint.x, aRefPoint.y);
   event.time = aTime;
   event.button = WidgetMouseEvent::eLeftButton;
   event.inputSource = nsIDOMMouseEvent::MOZ_SOURCE_TOUCH;
   event.ignoreRootScrollFrame = true;
@@ -543,17 +543,17 @@ APZCCallbackHelper::FireSingleTapEvent(c
   if (aWidget->Destroyed()) {
     return;
   }
   APZCCH_LOG("Dispatching single-tap component events to %s\n",
     Stringify(aPoint).c_str());
   int time = 0;
   DispatchSynthesizedMouseEvent(eMouseMove, time, aPoint, aModifiers, aWidget);
   DispatchSynthesizedMouseEvent(NS_MOUSE_BUTTON_DOWN, time, aPoint, aModifiers, aWidget);
-  DispatchSynthesizedMouseEvent(NS_MOUSE_BUTTON_UP, time, aPoint, aModifiers, aWidget);
+  DispatchSynthesizedMouseEvent(eMouseUp, time, aPoint, aModifiers, aWidget);
 }
 
 static nsIScrollableFrame*
 GetScrollableAncestorFrame(nsIFrame* aTarget)
 {
   uint32_t flags = nsLayoutUtils::SCROLLABLE_ALWAYS_MATCH_ROOT
                  | nsLayoutUtils::SCROLLABLE_ONLY_ASYNC_SCROLLABLE;
   return nsLayoutUtils::GetNearestScrollableFrame(aTarget, flags);
--- a/layout/base/AccessibleCaretEventHub.cpp
+++ b/layout/base/AccessibleCaretEventHub.cpp
@@ -509,20 +509,20 @@ AccessibleCaretEventHub::HandleMouseEven
     break;
 
   case eMouseMove:
     AC_LOGV("Before eMouseMove, state: %s", mState->Name());
     rv = mState->OnMove(this, point);
     AC_LOGV("After eMouseMove, state: %s, consume: %d", mState->Name(), rv);
     break;
 
-  case NS_MOUSE_BUTTON_UP:
-    AC_LOGV("Before NS_MOUSE_BUTTON_UP, state: %s", mState->Name());
+  case eMouseUp:
+    AC_LOGV("Before eMouseUp, state: %s", mState->Name());
     rv = mState->OnRelease(this);
-    AC_LOGV("After NS_MOUSE_BUTTON_UP, state: %s, consume: %d", mState->Name(),
+    AC_LOGV("After eMouseUp, state: %s, consume: %d", mState->Name(),
             rv);
     break;
 
   case NS_MOUSE_MOZLONGTAP:
     AC_LOGV("Before NS_MOUSE_MOZLONGTAP, state: %s", mState->Name());
     rv = mState->OnLongTap(this, point);
     AC_LOGV("After NS_MOUSE_MOZLONGTAP, state: %s, consume: %d", mState->Name(),
             rv);
--- a/layout/base/SelectionCarets.cpp
+++ b/layout/base/SelectionCarets.cpp
@@ -228,17 +228,17 @@ SelectionCarets::HandleEvent(WidgetEvent
       return nsEventStatus_eConsumeNoDefault;
     } else {
       mDragMode = NONE;
       mActiveTouchId = -1;
       LaunchLongTapDetector();
     }
   } else if (aEvent->mMessage == NS_TOUCH_END ||
              aEvent->mMessage == NS_TOUCH_CANCEL ||
-             aEvent->mMessage == NS_MOUSE_BUTTON_UP) {
+             aEvent->mMessage == eMouseUp) {
     CancelLongTapDetector();
     if (mDragMode != NONE) {
       // Only care about same id
       if (mActiveTouchId == nowTouchId) {
         SetSelectionDragState(false);
         mDragMode = NONE;
         mActiveTouchId = -1;
       }
--- a/layout/base/TouchCaret.cpp
+++ b/layout/base/TouchCaret.cpp
@@ -764,17 +764,17 @@ TouchCaret::HandleEvent(WidgetEvent* aEv
       status = HandleTouchDownEvent(aEvent->AsTouchEvent());
       break;
     case NS_MOUSE_BUTTON_DOWN:
       status = HandleMouseDownEvent(aEvent->AsMouseEvent());
       break;
     case NS_TOUCH_END:
       status = HandleTouchUpEvent(aEvent->AsTouchEvent());
       break;
-    case NS_MOUSE_BUTTON_UP:
+    case eMouseUp:
       status = HandleMouseUpEvent(aEvent->AsMouseEvent());
       break;
     case NS_TOUCH_MOVE:
       status = HandleTouchMoveEvent(aEvent->AsTouchEvent());
       break;
     case eMouseMove:
       status = HandleMouseMoveEvent(aEvent->AsMouseEvent());
       break;
--- a/layout/base/gtest/TestAccessibleCaretEventHub.cpp
+++ b/layout/base/gtest/TestAccessibleCaretEventHub.cpp
@@ -131,17 +131,17 @@ public:
 
   static UniquePtr<WidgetEvent> CreateMouseMoveEvent(nscoord aX, nscoord aY)
   {
     return CreateMouseEvent(eMouseMove, aX, aY);
   }
 
   static UniquePtr<WidgetEvent> CreateMouseReleaseEvent(nscoord aX, nscoord aY)
   {
-    return CreateMouseEvent(NS_MOUSE_BUTTON_UP, aX, aY);
+    return CreateMouseEvent(eMouseUp, aX, aY);
   }
 
   static UniquePtr<WidgetEvent> CreateLongTapEvent(nscoord aX, nscoord aY)
   {
     return CreateMouseEvent(NS_MOUSE_MOZLONGTAP, aX, aY);
   }
 
   static UniquePtr<WidgetEvent> CreateTouchEvent(EventMessage aMessage,
--- a/layout/base/nsPresShell.cpp
+++ b/layout/base/nsPresShell.cpp
@@ -463,17 +463,17 @@ class MOZ_STACK_CLASS nsPresShellEventCB
 {
 public:
   explicit nsPresShellEventCB(PresShell* aPresShell) : mPresShell(aPresShell) {}
 
   virtual void HandleEvent(EventChainPostVisitor& aVisitor) override
   {
     if (aVisitor.mPresContext && aVisitor.mEvent->mClass != eBasicEventClass) {
       if (aVisitor.mEvent->mMessage == NS_MOUSE_BUTTON_DOWN ||
-          aVisitor.mEvent->mMessage == NS_MOUSE_BUTTON_UP) {
+          aVisitor.mEvent->mMessage == eMouseUp) {
         // Mouse-up and mouse-down events call nsFrame::HandlePress/Release
         // which call GetContentOffsetsFromPoint which requires up-to-date layout.
         // Bring layout up-to-date now so that GetCurrentEventFrame() below
         // will return a real frame and we don't have to worry about
         // destroying it by flushing later.
         mPresShell->FlushPendingNotifications(Flush_Layout);
       } else if (aVisitor.mEvent->mMessage == NS_WHEEL_WHEEL &&
                  aVisitor.mEventStatus != nsEventStatus_eConsumeNoDefault) {
@@ -487,17 +487,17 @@ public:
             aVisitor.mPresContext->EventStateManager();
           esm->DispatchLegacyMouseScrollEvents(frame,
                                                aVisitor.mEvent->AsWheelEvent(),
                                                &aVisitor.mEventStatus);
         }
       }
       nsIFrame* frame = mPresShell->GetCurrentEventFrame();
       if (!frame &&
-          (aVisitor.mEvent->mMessage == NS_MOUSE_BUTTON_UP ||
+          (aVisitor.mEvent->mMessage == eMouseUp ||
            aVisitor.mEvent->mMessage == NS_TOUCH_END)) {
         // Redirect BUTTON_UP and TOUCH_END events to the root frame to ensure
         // that capturing is released.
         frame = mPresShell->GetRootFrame();
       }
       if (frame) {
         frame->HandleEvent(aVisitor.mPresContext,
                            aVisitor.mEvent->AsGUIEvent(),
@@ -6566,17 +6566,17 @@ PresShell::RecordMouseLocation(WidgetGUI
     }
     return;
   }
 
   if ((aEvent->mMessage == eMouseMove &&
        aEvent->AsMouseEvent()->reason == WidgetMouseEvent::eReal) ||
       aEvent->mMessage == NS_MOUSE_ENTER_WIDGET ||
       aEvent->mMessage == NS_MOUSE_BUTTON_DOWN ||
-      aEvent->mMessage == NS_MOUSE_BUTTON_UP) {
+      aEvent->mMessage == eMouseUp) {
     nsIFrame* rootFrame = GetRootFrame();
     if (!rootFrame) {
       nsView* rootView = mViewManager->GetRootView();
       mMouseLocation = nsLayoutUtils::TranslateWidgetToView(mPresContext,
         aEvent->widget, aEvent->refPoint, rootView);
     } else {
       mMouseLocation =
         nsLayoutUtils::GetEventCoordinatesRelativeTo(aEvent, rootFrame);
@@ -6671,17 +6671,17 @@ DispatchPointerFromMouseOrTouch(PresShel
     int16_t button = mouseEvent->button;
     switch (mouseEvent->mMessage) {
     case eMouseMove:
       if (mouseEvent->buttons == 0) {
         button = -1;
       }
       pointerMessage = NS_POINTER_MOVE;
       break;
-    case NS_MOUSE_BUTTON_UP:
+    case eMouseUp:
       pointerMessage = NS_POINTER_UP;
       break;
     case NS_MOUSE_BUTTON_DOWN:
       pointerMessage = NS_POINTER_DOWN;
       break;
     default:
       return NS_OK;
     }
@@ -7478,18 +7478,17 @@ PresShell::HandleEvent(nsIFrame* aFrame,
     }
 
     // Suppress mouse event if it's being targeted at an element inside
     // a document which needs events suppressed
     if (aEvent->mClass == eMouseEventClass &&
         frame->PresContext()->Document()->EventHandlingSuppressed()) {
       if (aEvent->mMessage == NS_MOUSE_BUTTON_DOWN) {
         mNoDelayedMouseEvents = true;
-      } else if (!mNoDelayedMouseEvents &&
-                 aEvent->mMessage == NS_MOUSE_BUTTON_UP) {
+      } else if (!mNoDelayedMouseEvents && aEvent->mMessage == eMouseUp) {
         DelayedEvent* event = new DelayedMouseEvent(aEvent->AsMouseEvent());
         if (!mDelayedEvents.AppendElement(event)) {
           delete event;
         }
       }
       return NS_OK;
     }
 
@@ -7884,17 +7883,17 @@ PresShell::HandleEventInternal(WidgetEve
           // Allow keys other than ESC and modifiers be marked as a
           // valid user input for triggering popup, fullscreen, and
           // pointer lock.
           isHandlingUserInput = true;
         }
         break;
       }
       case NS_MOUSE_BUTTON_DOWN:
-      case NS_MOUSE_BUTTON_UP:
+      case eMouseUp:
         isHandlingUserInput = true;
         break;
 
       case NS_DRAGDROP_DROP: {
         nsCOMPtr<nsIDragSession> session = nsContentUtils::GetDragSession();
         if (session) {
           bool onlyChromeDrop = false;
           session->GetOnlyChromeDrop(&onlyChromeDrop);
@@ -7988,17 +7987,17 @@ PresShell::HandleEventInternal(WidgetEve
           if (aEvent->mFlags.mOnlyChromeDispatch &&
               aEvent->mFlags.mDefaultPreventedByChrome) {
             mIsLastChromeOnlyEscapeKeyConsumed = true;
           }
         }
       }
       break;
     }
-    case NS_MOUSE_BUTTON_UP:
+    case eMouseUp:
       // reset the capturing content now that the mouse button is up
       SetCapturingContent(nullptr, 0);
       break;
     case eMouseMove:
       nsIPresShell::AllowMouseCapture(false);
       break;
     default:
       break;
--- a/layout/forms/nsImageControlFrame.cpp
+++ b/layout/forms/nsImageControlFrame.cpp
@@ -157,17 +157,17 @@ nsImageControlFrame::HandleEvent(nsPresC
     return nsFrame::HandleEvent(aPresContext, aEvent, aEventStatus);
 
   if (mContent->HasAttr(kNameSpaceID_None, nsGkAtoms::disabled)) { // XXX cache disabled
     return NS_OK;
   }
 
   *aEventStatus = nsEventStatus_eIgnore;
 
-  if (aEvent->mMessage == NS_MOUSE_BUTTON_UP &&
+  if (aEvent->mMessage == eMouseUp &&
       aEvent->AsMouseEvent()->button == WidgetMouseEvent::eLeftButton) {
     // Store click point for HTMLInputElement::SubmitNamesValues
     // Do this on MouseUp because the specs don't say and that's what IE does
     nsIntPoint* lastClickPoint =
       static_cast<nsIntPoint*>
                  (mContent->GetProperty(nsGkAtoms::imageClickedPoint));
     if (lastClickPoint) {
       // normally lastClickedPoint is not null, as it's allocated in Init()
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -2565,17 +2565,17 @@ nsFrame::HandleEvent(nsPresContext* aPre
   }
 
   if ((aEvent->mClass == eMouseEventClass &&
        aEvent->AsMouseEvent()->button == WidgetMouseEvent::eLeftButton) ||
       aEvent->mClass == eTouchEventClass) {
     if (aEvent->mMessage == NS_MOUSE_BUTTON_DOWN ||
         aEvent->mMessage == NS_TOUCH_START) {
       HandlePress(aPresContext, aEvent, aEventStatus);
-    } else if (aEvent->mMessage == NS_MOUSE_BUTTON_UP ||
+    } else if (aEvent->mMessage == eMouseUp ||
                aEvent->mMessage == NS_TOUCH_END) {
       HandleRelease(aPresContext, aEvent, aEventStatus);
     }
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
@@ -2600,17 +2600,17 @@ nsFrame::GetDataForTableSelection(const 
   // DISPLAY_ALL means we're in an editor.
   // If already in cell selection mode, 
   //  continue selecting with mouse drag or end on mouse up,
   //  or when using shift key to extend block of cells
   //  (Mouse down does normal selection unless Ctrl/Cmd is pressed)
   bool doTableSelection =
      displaySelection == nsISelectionDisplay::DISPLAY_ALL && selectingTableCells &&
      (aMouseEvent->mMessage == eMouseMove ||
-      (aMouseEvent->mMessage == NS_MOUSE_BUTTON_UP &&
+      (aMouseEvent->mMessage == eMouseUp &&
        aMouseEvent->button == WidgetMouseEvent::eLeftButton) ||
       aMouseEvent->IsShift());
 
   if (!doTableSelection)
   {  
     // In Browser, special 'table selection' key must be pressed for table selection
     // or when just Shift is pressed and we're already in table/cell selection mode
 #ifdef XP_MACOSX
--- a/layout/generic/nsFrameSetFrame.cpp
+++ b/layout/generic/nsFrameSetFrame.cpp
@@ -650,17 +650,17 @@ nsresult nsHTMLFramesetFrame::HandleEven
 {
   NS_ENSURE_ARG_POINTER(aEventStatus);
   if (mDragger) {
     // the nsFramesetBorderFrame has captured NS_MOUSE_DOWN
     switch (aEvent->mMessage) {
       case eMouseMove:
         MouseDrag(aPresContext, aEvent);
 	      break;
-      case NS_MOUSE_BUTTON_UP:
+      case eMouseUp:
         if (aEvent->AsMouseEvent()->button == WidgetMouseEvent::eLeftButton) {
           EndMouseDrag(aPresContext);
         }
 	      break;
       default:
         break;
     }
     *aEventStatus = nsEventStatus_eConsumeNoDefault;
--- a/layout/generic/nsImageFrame.cpp
+++ b/layout/generic/nsImageFrame.cpp
@@ -2005,17 +2005,17 @@ nsImageFrame::GetContentForEvent(WidgetE
 // XXX what should clicks on transparent pixels do?
 nsresult
 nsImageFrame::HandleEvent(nsPresContext* aPresContext,
                           WidgetGUIEvent* aEvent,
                           nsEventStatus* aEventStatus)
 {
   NS_ENSURE_ARG_POINTER(aEventStatus);
 
-  if ((aEvent->mMessage == NS_MOUSE_BUTTON_UP && 
+  if ((aEvent->mMessage == eMouseUp && 
        aEvent->AsMouseEvent()->button == WidgetMouseEvent::eLeftButton) ||
       aEvent->mMessage == eMouseMove) {
     nsImageMap* map = GetImageMap();
     bool isServerMap = IsServerImageMap();
     if ((nullptr != map) || isServerMap) {
       nsIntPoint p;
       TranslateEventCoords(
         nsLayoutUtils::GetEventCoordinatesRelativeTo(aEvent, this), p);
@@ -2045,17 +2045,17 @@ nsImageFrame::HandleEvent(nsPresContext*
           if (p.x < 0) p.x = 0;
           if (p.y < 0) p.y = 0;
           nsAutoCString spec;
           uri->GetSpec(spec);
           spec += nsPrintfCString("?%d,%d", p.x, p.y);
           uri->SetSpec(spec);                
           
           bool clicked = false;
-          if (aEvent->mMessage == NS_MOUSE_BUTTON_UP) {
+          if (aEvent->mMessage == eMouseUp) {
             *aEventStatus = nsEventStatus_eConsumeDoDefault; 
             clicked = true;
           }
           nsContentUtils::TriggerLink(anchorNode, aPresContext, uri, target,
                                       clicked, true, true);
         }
       }
     }
--- a/layout/generic/nsPluginFrame.cpp
+++ b/layout/generic/nsPluginFrame.cpp
@@ -1807,17 +1807,17 @@ nsPluginFrame::HandleEvent(nsPresContext
 #endif
 
   rv = nsPluginFrameSuper::HandleEvent(aPresContext, anEvent, anEventStatus);
 
   // We need to be careful from this point because the call to
   // nsPluginFrameSuper::HandleEvent() might have killed us.
 
 #ifdef XP_MACOSX
-  if (anEvent->mMessage == NS_MOUSE_BUTTON_UP) {
+  if (anEvent->mMessage == eMouseUp) {
     nsIPresShell::SetCapturingContent(nullptr, 0);
   }
 #endif
 
   return rv;
 }
 
 nsresult
--- a/layout/xul/nsMenuFrame.cpp
+++ b/layout/xul/nsMenuFrame.cpp
@@ -426,17 +426,17 @@ nsMenuFrame::HandleEvent(nsPresContext* 
     else {
       if (!IsOpen()) {
         OpenMenu(false);
       }
     }
   }
   else if (
 #ifndef NSCONTEXTMENUISMOUSEUP
-           (aEvent->mMessage == NS_MOUSE_BUTTON_UP &&
+           (aEvent->mMessage == eMouseUp &&
             aEvent->AsMouseEvent()->button == WidgetMouseEvent::eRightButton) &&
 #else
            aEvent->mMessage == NS_CONTEXTMENU &&
 #endif
            onmenu && !IsMenu() && !IsDisabled()) {
     // if this menu is a context menu it accepts right-clicks...fire away!
     // Make sure we cancel default processing of the context menu event so
     // that it doesn't bubble and get seen again by the popuplistener and show
@@ -447,17 +447,17 @@ nsMenuFrame::HandleEvent(nsPresContext* 
     // on others we get it on a mouse down. For the ones where we get it on a
     // mouse down, we must continue listening for the right button up event to
     // dismiss the menu.
     if (menuParent->IsContextMenu()) {
       *aEventStatus = nsEventStatus_eConsumeNoDefault;
       Execute(aEvent);
     }
   }
-  else if (aEvent->mMessage == NS_MOUSE_BUTTON_UP &&
+  else if (aEvent->mMessage == eMouseUp &&
            aEvent->AsMouseEvent()->button == WidgetMouseEvent::eLeftButton &&
            !IsMenu() && !IsDisabled()) {
     // Execute the execute event handler.
     *aEventStatus = nsEventStatus_eConsumeNoDefault;
     Execute(aEvent);
   }
   else if (aEvent->mMessage == NS_MOUSE_OUT) {
     // Kill our timer if one is active.
--- a/layout/xul/nsResizerFrame.cpp
+++ b/layout/xul/nsResizerFrame.cpp
@@ -124,17 +124,17 @@ nsResizerFrame::HandleEvent(nsPresContex
         mTrackingMouseMove = true;
 
         nsIPresShell::SetCapturingContent(GetContent(), CAPTURE_IGNOREALLOWED);
       }
     }
     break;
 
   case NS_TOUCH_END:
-  case NS_MOUSE_BUTTON_UP: {
+  case eMouseUp: {
     if (aEvent->mClass == eTouchEventClass ||
         (aEvent->mClass == eMouseEventClass &&
          aEvent->AsMouseEvent()->button == WidgetMouseEvent::eLeftButton)) {
       // we're done tracking.
       mTrackingMouseMove = false;
 
       nsIPresShell::SetCapturingContent(nullptr, 0);
 
--- a/layout/xul/nsRootBoxFrame.cpp
+++ b/layout/xul/nsRootBoxFrame.cpp
@@ -200,17 +200,17 @@ nsRootBoxFrame::HandleEvent(nsPresContex
                             WidgetGUIEvent* aEvent,
                             nsEventStatus* aEventStatus)
 {
   NS_ENSURE_ARG_POINTER(aEventStatus);
   if (nsEventStatus_eConsumeNoDefault == *aEventStatus) {
     return NS_OK;
   }
 
-  if (aEvent->mMessage == NS_MOUSE_BUTTON_UP) {
+  if (aEvent->mMessage == eMouseUp) {
     nsFrame::HandleEvent(aPresContext, aEvent, aEventStatus);
   }
 
   return NS_OK;
 }
 
 // REVIEW: The override here was doing nothing since nsBoxFrame is our
 // parent class
--- a/layout/xul/nsScrollbarButtonFrame.cpp
+++ b/layout/xul/nsScrollbarButtonFrame.cpp
@@ -55,17 +55,17 @@ nsScrollbarButtonFrame::HandleEvent(nsPr
   switch (aEvent->mMessage) {
     case NS_MOUSE_BUTTON_DOWN:
       mCursorOnThis = true;
       // if we didn't handle the press ourselves, pass it on to the superclass
       if (HandleButtonPress(aPresContext, aEvent, aEventStatus)) {
         return NS_OK;
       }
       break;
-    case NS_MOUSE_BUTTON_UP:
+    case eMouseUp:
       HandleRelease(aPresContext, aEvent, aEventStatus);
       break;
     case NS_MOUSE_OUT:
       mCursorOnThis = false;
       break;
     case eMouseMove: {
       nsPoint cursor =
         nsLayoutUtils::GetEventCoordinatesRelativeTo(aEvent, this);
--- a/layout/xul/nsSliderFrame.cpp
+++ b/layout/xul/nsSliderFrame.cpp
@@ -536,17 +536,17 @@ nsSliderFrame::HandleEvent(nsPresContext
       }
 
       // set it
       SetCurrentThumbPosition(scrollbar, pos, false, true); // with snapping
     }
     break;
 
     case NS_TOUCH_END:
-    case NS_MOUSE_BUTTON_UP:
+    case eMouseUp:
       if (ShouldScrollForEvent(aEvent)) {
         StopDrag();
         //we MUST call nsFrame HandleEvent for mouse ups to maintain the selection state and capture state.
         return nsFrame::HandleEvent(aPresContext, aEvent, aEventStatus);
       }
 
     default:
       break;
@@ -596,17 +596,17 @@ nsSliderFrame::HandleEvent(nsPresContext
 #ifdef MOZ_WIDGET_GTK
   else if (ShouldScrollForEvent(aEvent) &&
            aEvent->mClass == eMouseEventClass &&
            aEvent->AsMouseEvent()->button == WidgetMouseEvent::eRightButton) {
     // HandlePress and HandleRelease are usually called via
     // nsFrame::HandleEvent, but only for the left mouse button.
     if (aEvent->mMessage == NS_MOUSE_BUTTON_DOWN) {
       HandlePress(aPresContext, aEvent, aEventStatus);
-    } else if (aEvent->mMessage == NS_MOUSE_BUTTON_UP) {
+    } else if (aEvent->mMessage == eMouseUp) {
       HandleRelease(aPresContext, aEvent, aEventStatus);
     }
 
     return NS_OK;
   }
 #endif
 
   // XXX hack until handle release is actually called in nsframe.
@@ -1048,17 +1048,17 @@ nsSliderFrame::RemoveListener()
 bool
 nsSliderFrame::ShouldScrollForEvent(WidgetGUIEvent* aEvent)
 {
   switch (aEvent->mMessage) {
     case NS_TOUCH_START:
     case NS_TOUCH_END:
       return true;
     case NS_MOUSE_BUTTON_DOWN:
-    case NS_MOUSE_BUTTON_UP: {
+    case eMouseUp: {
       uint16_t button = aEvent->AsMouseEvent()->button;
 #ifdef MOZ_WIDGET_GTK
       return (button == WidgetMouseEvent::eLeftButton) ||
              (button == WidgetMouseEvent::eRightButton && GetScrollToClick()) ||
              (button == WidgetMouseEvent::eMiddleButton && gMiddlePref && !GetScrollToClick());
 #else
       return (button == WidgetMouseEvent::eLeftButton) ||
              (button == WidgetMouseEvent::eMiddleButton && gMiddlePref);
--- a/layout/xul/nsSplitterFrame.cpp
+++ b/layout/xul/nsSplitterFrame.cpp
@@ -388,17 +388,17 @@ nsSplitterFrame::HandleEvent(nsPresConte
 
   nsWeakFrame weakFrame(this);
   nsRefPtr<nsSplitterFrameInner> kungFuDeathGrip(mInner);
   switch (aEvent->mMessage) {
     case eMouseMove: 
       mInner->MouseDrag(aPresContext, aEvent);
       break;
   
-    case NS_MOUSE_BUTTON_UP:
+    case eMouseUp:
       if (aEvent->AsMouseEvent()->button == WidgetMouseEvent::eLeftButton) {
         mInner->MouseUp(aPresContext, aEvent);
       }
       break;
 
     default:
       break;
   }
--- a/layout/xul/nsTitleBarFrame.cpp
+++ b/layout/xul/nsTitleBarFrame.cpp
@@ -87,17 +87,17 @@ nsTitleBarFrame::HandleEvent(nsPresConte
 
          *aEventStatus = nsEventStatus_eConsumeNoDefault;
          doDefault = false;
        }
      }
      break;
 
 
-   case NS_MOUSE_BUTTON_UP: {
+   case eMouseUp: {
        if (mTrackingMouseMove &&
            aEvent->AsMouseEvent()->button == WidgetMouseEvent::eLeftButton) {
          // we're done tracking.
          mTrackingMouseMove = false;
 
          // end capture
          nsIPresShell::SetCapturingContent(nullptr, 0);
 
--- a/widget/EventMessageList.h
+++ b/widget/EventMessageList.h
@@ -42,17 +42,17 @@ NS_EVENT_MESSAGE(eOffline,              
 NS_EVENT_MESSAGE(eOnline,               eWindowEventFirst + 65)
 
 // NS_BEFORERESIZE_EVENT used to be here (eWindowEventFirst + 66)
 
 NS_EVENT_MESSAGE(eLanguageChange,       eWindowEventFirst + 70)
 
 NS_EVENT_MESSAGE(eMouseEventFirst,      300)
 NS_EVENT_MESSAGE(eMouseMove,            eMouseEventFirst)
-NS_EVENT_MESSAGE(NS_MOUSE_BUTTON_UP,    eMouseEventFirst + 1)
+NS_EVENT_MESSAGE(eMouseUp,              eMouseEventFirst + 1)
 NS_EVENT_MESSAGE(NS_MOUSE_BUTTON_DOWN,  eMouseEventFirst + 2)
 NS_EVENT_MESSAGE(NS_MOUSE_ENTER_WIDGET, eMouseEventFirst + 22)
 NS_EVENT_MESSAGE(NS_MOUSE_EXIT_WIDGET,  eMouseEventFirst + 23)
 NS_EVENT_MESSAGE(NS_MOUSE_DOUBLECLICK,  eMouseEventFirst + 24)
 NS_EVENT_MESSAGE(NS_MOUSE_CLICK,        eMouseEventFirst + 27)
 NS_EVENT_MESSAGE(NS_MOUSE_ACTIVATE,     eMouseEventFirst + 30)
 NS_EVENT_MESSAGE(NS_MOUSE_OVER,         eMouseEventFirst + 31)
 NS_EVENT_MESSAGE(NS_MOUSE_OUT,          eMouseEventFirst + 32)
--- a/widget/InputData.cpp
+++ b/widget/InputData.cpp
@@ -127,17 +127,17 @@ MultiTouchInput::ToWidgetMouseEvent(nsIW
     case MultiTouchInput::MULTITOUCH_START:
       mouseEventMessage = NS_MOUSE_BUTTON_DOWN;
       break;
     case MultiTouchInput::MULTITOUCH_MOVE:
       mouseEventMessage = eMouseMove;
       break;
     case MultiTouchInput::MULTITOUCH_CANCEL:
     case MultiTouchInput::MULTITOUCH_END:
-      mouseEventMessage = NS_MOUSE_BUTTON_UP;
+      mouseEventMessage = eMouseUp;
       break;
     default:
       MOZ_ASSERT_UNREACHABLE("Did not assign a type to WidgetMouseEvent");
       break;
   }
 
   WidgetMouseEvent event(true, mouseEventMessage, aWidget,
                          WidgetMouseEvent::eReal, WidgetMouseEvent::eNormal);
@@ -183,17 +183,17 @@ MultiTouchInput::MultiTouchInput(const W
              "Can only copy from WidgetMouseEvent on main thread");
   switch (aMouseEvent.mMessage) {
   case NS_MOUSE_BUTTON_DOWN:
     mType = MULTITOUCH_START;
     break;
   case eMouseMove:
     mType = MULTITOUCH_MOVE;
     break;
-  case NS_MOUSE_BUTTON_UP:
+  case eMouseUp:
     mType = MULTITOUCH_END;
     break;
   // The mouse pointer has been interrupted in an implementation-specific
   // manner, such as a synchronous event or action cancelling the touch, or a
   // touch point leaving the document window and going into a non-document
   // area capable of handling user interactions.
   case NS_MOUSE_EXIT_WIDGET:
     mType = MULTITOUCH_CANCEL;
--- a/widget/WidgetEventImpl.cpp
+++ b/widget/WidgetEventImpl.cpp
@@ -74,17 +74,17 @@ WidgetEvent::IsNativeEventDelivererForPl
  * Event message checking methods.
  ******************************************************************************/
 
 bool
 WidgetEvent::HasMouseEventMessage() const
 {
   switch (mMessage) {
     case NS_MOUSE_BUTTON_DOWN:
-    case NS_MOUSE_BUTTON_UP:
+    case eMouseUp:
     case NS_MOUSE_CLICK:
     case NS_MOUSE_DOUBLECLICK:
     case NS_MOUSE_ENTER_WIDGET:
     case NS_MOUSE_EXIT_WIDGET:
     case NS_MOUSE_ACTIVATE:
     case NS_MOUSE_OVER:
     case NS_MOUSE_OUT:
     case NS_MOUSE_MOZHITTEST:
--- a/widget/cocoa/nsChildView.mm
+++ b/widget/cocoa/nsChildView.mm
@@ -4606,17 +4606,17 @@ NSEvent* gLastDragMouseDownEvent = nil;
 {
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
 
   if (!mGeckoChild || mBlockedLastMouseDown)
     return;
 
   nsAutoRetainCocoaObject kungFuDeathGrip(self);
 
-  WidgetMouseEvent geckoEvent(true, NS_MOUSE_BUTTON_UP, mGeckoChild,
+  WidgetMouseEvent geckoEvent(true, eMouseUp, mGeckoChild,
                               WidgetMouseEvent::eReal);
   [self convertCocoaMouseEvent:theEvent toGeckoEvent:&geckoEvent];
   if ([theEvent modifierFlags] & NSControlKeyMask)
     geckoEvent.button = WidgetMouseEvent::eRightButton;
   else
     geckoEvent.button = WidgetMouseEvent::eLeftButton;
 
   // This might destroy our widget (and null out mGeckoChild).
@@ -4805,17 +4805,17 @@ NewCGSRegionFromRegion(const nsIntRegion
 
 - (void)rightMouseUp:(NSEvent *)theEvent
 {
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
 
   if (!mGeckoChild)
     return;
 
-  WidgetMouseEvent geckoEvent(true, NS_MOUSE_BUTTON_UP, mGeckoChild,
+  WidgetMouseEvent geckoEvent(true, eMouseUp, mGeckoChild,
                               WidgetMouseEvent::eReal);
   [self convertCocoaMouseEvent:theEvent toGeckoEvent:&geckoEvent];
   geckoEvent.button = WidgetMouseEvent::eRightButton;
   geckoEvent.clickCount = [theEvent clickCount];
 
   nsAutoRetainCocoaObject kungFuDeathGrip(self);
   mGeckoChild->DispatchInputEvent(&geckoEvent);
 
@@ -4861,17 +4861,17 @@ NewCGSRegionFromRegion(const nsIntRegion
   NS_OBJC_END_TRY_ABORT_BLOCK;
 }
 
 - (void)otherMouseUp:(NSEvent *)theEvent
 {
   if (!mGeckoChild)
     return;
 
-  WidgetMouseEvent geckoEvent(true, NS_MOUSE_BUTTON_UP, mGeckoChild,
+  WidgetMouseEvent geckoEvent(true, eMouseUp, mGeckoChild,
                               WidgetMouseEvent::eReal);
   [self convertCocoaMouseEvent:theEvent toGeckoEvent:&geckoEvent];
   geckoEvent.button = WidgetMouseEvent::eMiddleButton;
 
   nsAutoRetainCocoaObject kungFuDeathGrip(self);
   mGeckoChild->DispatchInputEvent(&geckoEvent);
 }
 
--- a/widget/gtk/nsWindow.cpp
+++ b/widget/gtk/nsWindow.cpp
@@ -2622,17 +2622,17 @@ nsWindow::DispatchMissedButtonReleases(G
 
             LOG(("Synthesized button %u release on %p\n",
                  guint(buttonType + 1), (void *)this));
 
             // Dispatch a synthesized button up event to tell Gecko about the
             // change in state.  This event is marked as synthesized so that
             // it is not dispatched as a DOM event, because we don't know the
             // position, widget, modifiers, or time/order.
-            WidgetMouseEvent synthEvent(true, NS_MOUSE_BUTTON_UP, this,
+            WidgetMouseEvent synthEvent(true, eMouseUp, this,
                                         WidgetMouseEvent::eSynthesized);
             synthEvent.button = buttonType;
             DispatchInputEvent(&synthEvent);
         }
     }
 }
 
 void
@@ -2647,17 +2647,17 @@ nsWindow::InitButtonEvent(WidgetMouseEve
         LayoutDeviceIntPoint point(NSToIntFloor(aGdkEvent->x_root),
                                    NSToIntFloor(aGdkEvent->y_root));
         aEvent.refPoint = point - WidgetToScreenOffset();
     }
 
     guint modifierState = aGdkEvent->state;
     // aEvent's state doesn't include this event's information.  Therefore,
     // if aEvent is mouse button down event, we need to set it manually.
-    // Note that we cannot do same thing for NS_MOUSE_BUTTON_UP because
+    // Note that we cannot do same thing for eMouseUp because
     // system may have two or more mice and same button of another mouse
     // may be still pressed.
     if (aGdkEvent->type != GDK_BUTTON_RELEASE) {
         switch (aGdkEvent->button) {
             case 1:
                 modifierState |= GDK_BUTTON1_MASK;
                 break;
             case 2:
@@ -2789,17 +2789,17 @@ nsWindow::OnButtonReleaseEvent(GdkEventB
         domButton = WidgetMouseEvent::eRightButton;
         break;
     default:
         return;
     }
 
     gButtonState &= ~ButtonMaskFromGDKButton(aEvent->button);
 
-    WidgetMouseEvent event(true, NS_MOUSE_BUTTON_UP, this,
+    WidgetMouseEvent event(true, eMouseUp, this,
                            WidgetMouseEvent::eReal);
     event.button = domButton;
     InitButtonEvent(event, aEvent);
     gdouble pressure = 0;
     gdk_event_get_axis ((GdkEvent*)aEvent, GDK_AXIS_PRESSURE, &pressure);
     event.pressure = pressure ? pressure : mLastMotionPressure;
 
     DispatchInputEvent(&event);
--- a/widget/nsBaseWidget.cpp
+++ b/widget/nsBaseWidget.cpp
@@ -2645,17 +2645,17 @@ case _value: eventName.AssignLiteral(_na
     _ASSIGN_eventName(NS_IMAGE_ABORT,"NS_IMAGE_ABORT");
     _ASSIGN_eventName(NS_LOAD_ERROR,"NS_LOAD_ERROR");
     _ASSIGN_eventName(eKeyDown,"eKeyDown");
     _ASSIGN_eventName(eKeyPress,"eKeyPress");
     _ASSIGN_eventName(eKeyUp,"eKeyUp");
     _ASSIGN_eventName(NS_MOUSE_ENTER_WIDGET,"NS_MOUSE_ENTER_WIDGET");
     _ASSIGN_eventName(NS_MOUSE_EXIT_WIDGET,"NS_MOUSE_EXIT_WIDGET");
     _ASSIGN_eventName(NS_MOUSE_BUTTON_DOWN,"NS_MOUSE_BUTTON_DOWN");
-    _ASSIGN_eventName(NS_MOUSE_BUTTON_UP,"NS_MOUSE_BUTTON_UP");
+    _ASSIGN_eventName(eMouseUp,"eMouseUp");
     _ASSIGN_eventName(NS_MOUSE_CLICK,"NS_MOUSE_CLICK");
     _ASSIGN_eventName(NS_MOUSE_DOUBLECLICK,"NS_MOUSE_DBLCLICK");
     _ASSIGN_eventName(eMouseMove,"eMouseMove");
     _ASSIGN_eventName(NS_LOAD,"NS_LOAD");
     _ASSIGN_eventName(NS_POPSTATE,"NS_POPSTATE");
     _ASSIGN_eventName(NS_BEFORE_SCRIPT_EXECUTE,"NS_BEFORE_SCRIPT_EXECUTE");
     _ASSIGN_eventName(NS_AFTER_SCRIPT_EXECUTE,"NS_AFTER_SCRIPT_EXECUTE");
     _ASSIGN_eventName(NS_PAGE_UNLOAD,"NS_PAGE_UNLOAD");
--- a/widget/qt/nsWindow.cpp
+++ b/widget/qt/nsWindow.cpp
@@ -1020,18 +1020,17 @@ nsEventStatus
 nsWindow::mouseReleaseEvent(QMouseEvent* aEvent)
 {
     // The user has done something.
     UserActivity();
 
     if (!IsAcceptedButton(aEvent->button()))
         return nsEventStatus_eIgnore;
 
-    WidgetMouseEvent event(true, NS_MOUSE_BUTTON_UP, this,
-                           WidgetMouseEvent::eReal);
+    WidgetMouseEvent event(true, eMouseUp, this, WidgetMouseEvent::eReal);
     InitMouseEvent(event, aEvent, 1);
     return DispatchEvent(&event);
 }
 
 nsEventStatus
 nsWindow::mouseDoubleClickEvent(QMouseEvent* aEvent)
 {
     // The user has done something.
--- a/widget/uikit/nsWindow.mm
+++ b/widget/uikit/nsWindow.mm
@@ -155,17 +155,17 @@ private:
 
 - (void)handleTap:(UITapGestureRecognizer *)sender
 {
     if (sender.state == UIGestureRecognizerStateEnded) {
         ALOG("[ChildView[%p] handleTap]", self);
         LayoutDeviceIntPoint lp = UIKitPointsToDevPixels([sender locationInView:self], [self contentScaleFactor]);
         [self sendMouseEvent:eMouseMove point:lp widget:mGeckoChild];
         [self sendMouseEvent:NS_MOUSE_BUTTON_DOWN point:lp widget:mGeckoChild];
-        [self sendMouseEvent:NS_MOUSE_BUTTON_UP point:lp widget:mGeckoChild];
+        [self sendMouseEvent:eMouseUp point:lp widget:mGeckoChild];
     }
 }
 
 - (void)sendTouchEvent:(int) aType touches:(NSSet*)aTouches widget:(nsWindow*)aWindow
 {
     WidgetTouchEvent event(true, aType, aWindow);
     //XXX: I think nativeEvent.timestamp * 1000 is probably usable here but
     // I don't care that much right now.
--- a/widget/windows/TSFTextStore.cpp
+++ b/widget/windows/TSFTextStore.cpp
@@ -535,18 +535,18 @@ GetDisplayAttrStr(const TF_DISPLAYATTRIB
 }
 
 static const char*
 GetEventMessageName(uint32_t aMessage)
 {
   switch (aMessage) {
     case NS_MOUSE_BUTTON_DOWN:
       return "NS_MOUSE_BUTTON_DOWN";
-    case NS_MOUSE_BUTTON_UP:
-      return "NS_MOUSE_BUTTON_UP";
+    case eMouseUp:
+      return "eMouseUp";
     default:
       return "Unknown";
   }
 }
 
 static const char*
 GetMouseButtonName(int16_t aButton)
 {
@@ -4752,17 +4752,17 @@ TSFTextStore::OnMouseButtonEventInternal
   if (charRect.width > 0) {
     int32_t cursorXInChar = cursorPos.x - charRect.x;
     quadrant = cursorXInChar * 4 / charRect.width;
     quadrant = (quadrant + 2) % 4;
   }
   ULONG edge = quadrant < 2 ? offset + 1 : offset;
   DWORD buttonStatus = 0;
   bool isMouseUp =
-    aIMENotification.mMouseButtonEventData.mEventMessage == NS_MOUSE_BUTTON_UP;
+    aIMENotification.mMouseButtonEventData.mEventMessage == eMouseUp;
   if (!isMouseUp) {
     switch (aIMENotification.mMouseButtonEventData.mButton) {
       case WidgetMouseEventBase::eLeftButton:
         buttonStatus = MK_LBUTTON;
         break;
       case WidgetMouseEventBase::eMiddleButton:
         buttonStatus = MK_MBUTTON;
         break;
--- a/widget/windows/WinUtils.cpp
+++ b/widget/windows/WinUtils.cpp
@@ -943,17 +943,17 @@ WinUtils::GetMouseInputSource()
 /* static */
 bool
 WinUtils::GetIsMouseFromTouch(EventMessage aEventMessage)
 {
   const uint32_t MOZ_T_I_SIGNATURE = TABLET_INK_TOUCH | TABLET_INK_SIGNATURE;
   const uint32_t MOZ_T_I_CHECK_TCH = TABLET_INK_TOUCH | TABLET_INK_CHECK;
   return ((aEventMessage == eMouseMove ||
            aEventMessage == NS_MOUSE_BUTTON_DOWN ||
-           aEventMessage == NS_MOUSE_BUTTON_UP) &&
+           aEventMessage == eMouseUp) &&
          (GetMessageExtraInfo() & MOZ_T_I_SIGNATURE) == MOZ_T_I_CHECK_TCH);
 }
 
 /* static */
 MSG
 WinUtils::InitMSG(UINT aMessage, WPARAM wParam, LPARAM lParam, HWND aWnd)
 {
   MSG msg;
--- a/widget/windows/nsWindow.cpp
+++ b/widget/windows/nsWindow.cpp
@@ -4027,17 +4027,17 @@ nsWindow::DispatchMouseEvent(EventMessag
   switch (aEventMessage) {
     case NS_MOUSE_BUTTON_DOWN:
       CaptureMouse(true);
       break;
 
     // eMouseMove and NS_MOUSE_EXIT_WIDGET are here because we need to make
     // sure capture flag isn't left on after a drag where we wouldn't see a
     // button up message (see bug 324131).
-    case NS_MOUSE_BUTTON_UP:
+    case eMouseUp:
     case eMouseMove:
     case NS_MOUSE_EXIT_WIDGET:
       if (!(wParam & (MK_LBUTTON | MK_MBUTTON | MK_RBUTTON)) && sIsInMouseCapture)
         CaptureMouse(false);
       break;
 
     default:
       break;
@@ -4101,17 +4101,17 @@ nsWindow::DispatchMouseEvent(EventMessag
 
   switch (aEventMessage) {
     case NS_MOUSE_DOUBLECLICK:
       event.mMessage = NS_MOUSE_BUTTON_DOWN;
       event.button = aButton;
       sLastClickCount = 2;
       sLastMouseDownTime = curMsgTime;
       break;
-    case NS_MOUSE_BUTTON_UP:
+    case eMouseUp:
       // remember when this happened for the next mouse down
       sLastMousePoint.x = eventPoint.x;
       sLastMousePoint.y = eventPoint.y;
       sLastMouseButton = eventButton;
       break;
     case NS_MOUSE_BUTTON_DOWN:
       // now look to see if we want to convert this to a double- or triple-click
       if (((curMsgTime - sLastMouseDownTime) < (LONG)::GetDoubleClickTime()) &&
@@ -4157,17 +4157,17 @@ nsWindow::DispatchMouseEvent(EventMessag
           break;
         case WidgetMouseEvent::eRightButton:
           pluginEvent.event = WM_RBUTTONDOWN;
           break;
         default:
           break;
       }
       break;
-    case NS_MOUSE_BUTTON_UP:
+    case eMouseUp:
       switch (aButton) {
         case WidgetMouseEvent::eLeftButton:
           pluginEvent.event = WM_LBUTTONUP;
           break;
         case WidgetMouseEvent::eMiddleButton:
           pluginEvent.event = WM_MBUTTONUP;
           break;
         case WidgetMouseEvent::eRightButton:
@@ -5146,17 +5146,17 @@ nsWindow::ProcessMessage(UINT msg, WPARA
                                   false, WidgetMouseEvent::eLeftButton,
                                   MOUSE_INPUT_SOURCE());
       DispatchPendingEvents();
     }
     break;
 
     case WM_LBUTTONUP:
     {
-      result = DispatchMouseEvent(NS_MOUSE_BUTTON_UP, wParam, lParam,
+      result = DispatchMouseEvent(eMouseUp, wParam, lParam,
                                   false, WidgetMouseEvent::eLeftButton,
                                   MOUSE_INPUT_SOURCE());
       DispatchPendingEvents();
     }
     break;
 
     case WM_MOUSELEAVE:
     {
@@ -5236,17 +5236,17 @@ nsWindow::ProcessMessage(UINT msg, WPARA
       result = DispatchMouseEvent(NS_MOUSE_BUTTON_DOWN, wParam,
                                   lParam, false,
                                   WidgetMouseEvent::eMiddleButton,
                                   MOUSE_INPUT_SOURCE());
       DispatchPendingEvents();
       break;
 
     case WM_MBUTTONUP:
-      result = DispatchMouseEvent(NS_MOUSE_BUTTON_UP, wParam,
+      result = DispatchMouseEvent(eMouseUp, wParam,
                                   lParam, false,
                                   WidgetMouseEvent::eMiddleButton,
                                   MOUSE_INPUT_SOURCE());
       DispatchPendingEvents();
       break;
 
     case WM_MBUTTONDBLCLK:
       result = DispatchMouseEvent(NS_MOUSE_DOUBLECLICK, wParam,
@@ -5260,17 +5260,17 @@ nsWindow::ProcessMessage(UINT msg, WPARA
       result = DispatchMouseEvent(NS_MOUSE_BUTTON_DOWN, 0,
                                   lParamToClient(lParam), false,
                                   WidgetMouseEvent::eMiddleButton,
                                   MOUSE_INPUT_SOURCE());
       DispatchPendingEvents();
       break;
 
     case WM_NCMBUTTONUP:
-      result = DispatchMouseEvent(NS_MOUSE_BUTTON_UP, 0,
+      result = DispatchMouseEvent(eMouseUp, 0,
                                   lParamToClient(lParam), false,
                                   WidgetMouseEvent::eMiddleButton,
                                   MOUSE_INPUT_SOURCE());
       DispatchPendingEvents();
       break;
 
     case WM_NCMBUTTONDBLCLK:
       result = DispatchMouseEvent(NS_MOUSE_DOUBLECLICK, 0,
@@ -5284,17 +5284,17 @@ nsWindow::ProcessMessage(UINT msg, WPARA
       result = DispatchMouseEvent(NS_MOUSE_BUTTON_DOWN, wParam,
                                   lParam, false,
                                   WidgetMouseEvent::eRightButton,
                                   MOUSE_INPUT_SOURCE());
       DispatchPendingEvents();
       break;
 
     case WM_RBUTTONUP:
-      result = DispatchMouseEvent(NS_MOUSE_BUTTON_UP, wParam,
+      result = DispatchMouseEvent(eMouseUp, wParam,
                                   lParam, false,
                                   WidgetMouseEvent::eRightButton,
                                   MOUSE_INPUT_SOURCE());
       DispatchPendingEvents();
       break;
 
     case WM_RBUTTONDBLCLK:
       result = DispatchMouseEvent(NS_MOUSE_DOUBLECLICK, wParam,
@@ -5308,17 +5308,17 @@ nsWindow::ProcessMessage(UINT msg, WPARA
       result = DispatchMouseEvent(NS_MOUSE_BUTTON_DOWN, 0,
                                   lParamToClient(lParam), false,
                                   WidgetMouseEvent::eRightButton,
                                   MOUSE_INPUT_SOURCE());
       DispatchPendingEvents();
       break;
 
     case WM_NCRBUTTONUP:
-      result = DispatchMouseEvent(NS_MOUSE_BUTTON_UP, 0,
+      result = DispatchMouseEvent(eMouseUp, 0,
                                   lParamToClient(lParam), false,
                                   WidgetMouseEvent::eRightButton,
                                   MOUSE_INPUT_SOURCE());
       DispatchPendingEvents();
       break;
 
     case WM_NCRBUTTONDBLCLK:
       result = DispatchMouseEvent(NS_MOUSE_DOUBLECLICK, 0,
@@ -5372,17 +5372,17 @@ nsWindow::ProcessMessage(UINT msg, WPARA
       break;
     }
 
     case WM_NCLBUTTONDBLCLK:
       DispatchMouseEvent(NS_MOUSE_DOUBLECLICK, 0, lParamToClient(lParam),
                          false, WidgetMouseEvent::eLeftButton,
                          MOUSE_INPUT_SOURCE());
       result = 
-        DispatchMouseEvent(NS_MOUSE_BUTTON_UP, 0, lParamToClient(lParam),
+        DispatchMouseEvent(eMouseUp, 0, lParamToClient(lParam),
                            false, WidgetMouseEvent::eLeftButton,
                            MOUSE_INPUT_SOURCE());
       DispatchPendingEvents();
       break;
 
     case WM_APPCOMMAND:
     {
       MSG nativeMsg = WinUtils::InitMSG(msg, wParam, lParam, mWnd);