Bug 895274 part.34 Rename NS_MOUSE_OUT to eMouseOut r=smaug
authorMasayuki Nakano <masayuki@d-toybox.com>
Sat, 29 Aug 2015 08:58:32 +0900
changeset 259902 4bcb03faecc6d51c09068243a4b73240b7af80a2
parent 259901 b8fe1dac71aeb337dbdb084297b25071d03cf1a0
child 259903 0d03f7de34c57ba40ca9a60d41f8ce5ca3a47aae
push id64364
push usermasayuki@d-toybox.com
push dateFri, 28 Aug 2015 23:58:47 +0000
treeherdermozilla-inbound@5899c44ed9ce [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.34 Rename NS_MOUSE_OUT to eMouseOut r=smaug
dom/base/Element.cpp
dom/base/FragmentOrElement.cpp
dom/events/EventNameList.h
dom/events/EventStateManager.cpp
dom/html/HTMLButtonElement.cpp
dom/html/HTMLInputElement.cpp
dom/plugins/base/nsPluginInstanceOwner.cpp
layout/forms/nsListControlFrame.cpp
layout/xul/nsMenuFrame.cpp
layout/xul/nsScrollBoxFrame.cpp
layout/xul/nsScrollbarButtonFrame.cpp
layout/xul/nsSliderFrame.cpp
layout/xul/tree/nsTreeBodyFrame.cpp
widget/EventMessageList.h
widget/WidgetEventImpl.cpp
--- a/dom/base/Element.cpp
+++ b/dom/base/Element.cpp
@@ -2865,17 +2865,17 @@ Element::CheckHandleEventForLinksPrecond
 nsresult
 Element::PreHandleEventForLinks(EventChainPreVisitor& aVisitor)
 {
   // Optimisation: return early if this event doesn't interest us.
   // IMPORTANT: this switch and the switch below it must be kept in sync!
   switch (aVisitor.mEvent->mMessage) {
   case eMouseOver:
   case NS_FOCUS_CONTENT:
-  case NS_MOUSE_OUT:
+  case eMouseOut:
   case NS_BLUR_CONTENT:
     break;
   default:
     return NS_OK;
   }
 
   // Make sure we meet the preconditions before continuing
   nsCOMPtr<nsIURI> absURI;
@@ -2899,17 +2899,17 @@ Element::PreHandleEventForLinks(EventCha
       GetLinkTarget(target);
       nsContentUtils::TriggerLink(this, aVisitor.mPresContext, absURI, target,
                                   false, true, true);
       // Make sure any ancestor links don't also TriggerLink
       aVisitor.mEvent->mFlags.mMultipleActionsPrevented = true;
     }
     break;
   }
-  case NS_MOUSE_OUT:
+  case eMouseOut:
     aVisitor.mEventStatus = nsEventStatus_eConsumeNoDefault;
     // FALL THROUGH
   case NS_BLUR_CONTENT:
     rv = LeaveLink(aVisitor.mPresContext);
     if (NS_SUCCEEDED(rv)) {
       aVisitor.mEvent->mFlags.mMultipleActionsPrevented = true;
     }
     break;
--- a/dom/base/FragmentOrElement.cpp
+++ b/dom/base/FragmentOrElement.cpp
@@ -673,17 +673,17 @@ nsIContent::PreHandleEvent(EventChainPre
   //FIXME! Document how this event retargeting works, Bug 329124.
   aVisitor.mCanHandle = true;
   aVisitor.mMayHaveListenerManager = HasListenerManager();
 
   // Don't propagate mouseover and mouseout events when mouse is moving
   // inside chrome access only content.
   bool isAnonForEvents = IsRootOfChromeAccessOnlySubtree();
   if ((aVisitor.mEvent->mMessage == eMouseOver ||
-       aVisitor.mEvent->mMessage == NS_MOUSE_OUT ||
+       aVisitor.mEvent->mMessage == eMouseOut ||
        aVisitor.mEvent->mMessage == NS_POINTER_OVER ||
        aVisitor.mEvent->mMessage == NS_POINTER_OUT) &&
       // Check if we should stop event propagation when event has just been
       // dispatched or when we're about to propagate from
       // chrome access only subtree or if we are about to propagate out of
       // a shadow root to a shadow root host.
       ((this == aVisitor.mEvent->originalTarget &&
         !ChromeOnlyAccess()) || isAnonForEvents || GetShadowRoot())) {
--- a/dom/events/EventNameList.h
+++ b/dom/events/EventNameList.h
@@ -278,17 +278,17 @@ EVENT(mouseleave,
       NS_MOUSELEAVE,
       EventNameType_All,
       eMouseEventClass)
 EVENT(mousemove,
       eMouseMove,
       EventNameType_All,
       eMouseEventClass)
 EVENT(mouseout,
-      NS_MOUSE_OUT,
+      eMouseOut,
       EventNameType_All,
       eMouseEventClass)
 EVENT(mouseover,
       eMouseOver,
       EventNameType_All,
       eMouseEventClass)
 EVENT(mouseup,
       eMouseUp,
--- a/dom/events/EventStateManager.cpp
+++ b/dom/events/EventStateManager.cpp
@@ -3739,17 +3739,17 @@ EventStateManager::DispatchMouseOrPointe
 {
   // http://dvcs.w3.org/hg/webevents/raw-file/default/mouse-lock.html#methods
   // "[When the mouse is locked on an element...e]vents that require the concept
   // of a mouse cursor must not be dispatched (for example: mouseover, mouseout).
   if (sIsPointerLocked &&
       (aMessage == NS_MOUSELEAVE ||
        aMessage == NS_MOUSEENTER ||
        aMessage == eMouseOver ||
-       aMessage == NS_MOUSE_OUT)) {
+       aMessage == eMouseOut)) {
     mCurrentTargetContent = nullptr;
     nsCOMPtr<Element> pointerLockedElement =
       do_QueryReferent(EventStateManager::sPointerLockedElement);
     if (!pointerLockedElement) {
       NS_WARNING("Should have pointer locked element, but didn't.");
       return nullptr;
     }
     nsCOMPtr<nsIContent> content = do_QueryInterface(pointerLockedElement);
@@ -3784,17 +3784,17 @@ EventStateManager::DispatchMouseOrPointe
   if (mPresContext) {
     // Although the primary frame was checked in event callback, it may not be
     // the same object after event dispatch and handling, so refetch it.
     targetFrame = mPresContext->GetPrimaryFrameFor(aTargetContent);
 
     // If we are entering/leaving remote content, dispatch a mouse enter/exit
     // event to the remote frame.
     if (IsRemoteTarget(aTargetContent)) {
-      if (aMessage == NS_MOUSE_OUT) {
+      if (aMessage == eMouseOut) {
         // For remote content, send a "top-level" widget mouse exit event.
         nsAutoPtr<WidgetMouseEvent> remoteEvent;
         CreateMouseOrPointerWidgetEvent(aMouseEvent, eMouseExitFromWidget,
                                         aRelatedContent, remoteEvent);
         remoteEvent->exit = WidgetMouseEvent::eTopLevel;
 
         // mCurrentTarget is set to the new target, so we must reset it to the
         // old target and then dispatch a cross-process event. (mCurrentTarget
@@ -3930,17 +3930,17 @@ EventStateManager::NotifyMouseOut(Widget
                                     ? wrapper->mLastOverElement->GetParent()
                                     : aMovingInto;
 
   EnterLeaveDispatcher leaveDispatcher(this, wrapper->mLastOverElement,
                                        movingInto, aMouseEvent,
                                        isPointer ? NS_POINTER_LEAVE : NS_MOUSELEAVE);
 
   // Fire mouseout
-  DispatchMouseOrPointerEvent(aMouseEvent, isPointer ? NS_POINTER_OUT : NS_MOUSE_OUT,
+  DispatchMouseOrPointerEvent(aMouseEvent, isPointer ? NS_POINTER_OUT : eMouseOut,
                               wrapper->mLastOverElement, aMovingInto);
 
   wrapper->mLastOverFrame = nullptr;
   wrapper->mLastOverElement = nullptr;
 
   // Turn recursion protection back off
   wrapper->mFirstOutEventElement = nullptr;
 }
--- a/dom/html/HTMLButtonElement.cpp
+++ b/dom/html/HTMLButtonElement.cpp
@@ -350,17 +350,17 @@ HTMLButtonElement::PostHandleEvent(Event
         {
           aVisitor.mPresContext->EventStateManager()->
             SetContentState(this, NS_EVENT_STATE_HOVER);
           aVisitor.mEventStatus = nsEventStatus_eConsumeNoDefault;
         }
         break;
 
         // XXX this doesn't seem to do anything yet
-      case NS_MOUSE_OUT:
+      case eMouseOut:
         {
           aVisitor.mPresContext->EventStateManager()->
             SetContentState(nullptr, NS_EVENT_STATE_HOVER);
           aVisitor.mEventStatus = nsEventStatus_eConsumeNoDefault;
         }
         break;
 
       default:
--- a/dom/html/HTMLInputElement.cpp
+++ b/dom/html/HTMLInputElement.cpp
@@ -3024,17 +3024,17 @@ HTMLInputElement::NeedToInitializeEditor
     return false;
   }
 
   switch (aVisitor.mEvent->mMessage) {
   case eMouseMove:
   case eMouseEnterIntoWidget:
   case eMouseExitFromWidget:
   case eMouseOver:
-  case NS_MOUSE_OUT:
+  case eMouseOut:
   case NS_SCROLLPORT_UNDERFLOW:
   case NS_SCROLLPORT_OVERFLOW:
     return false;
   default:
     return true;
   }
 }
 
--- a/dom/plugins/base/nsPluginInstanceOwner.cpp
+++ b/dom/plugins/base/nsPluginInstanceOwner.cpp
@@ -1805,17 +1805,17 @@ CocoaEventTypeForEvent(const WidgetGUIEv
   const NPCocoaEvent* event = static_cast<const NPCocoaEvent*>(anEvent.mPluginEvent);
   if (event) {
     return event->type;
   }
 
   switch (anEvent.mMessage) {
     case eMouseOver:
       return NPCocoaEventMouseEntered;
-    case NS_MOUSE_OUT:
+    case eMouseOut:
       return NPCocoaEventMouseExited;
     case eMouseMove: {
       // We don't know via information on events from the widget code whether or not
       // we're dragging. The widget code just generates mouse move events from native
       // drag events. If anybody is capturing, this is a drag event.
       if (nsIPresShell::GetCapturingContent()) {
         return NPCocoaEventMouseDragged;
       }
@@ -1847,17 +1847,17 @@ TranslateToNPCocoaEvent(WidgetGUIEvent* 
   InitializeNPCocoaEvent(&cocoaEvent);
   cocoaEvent.type = CocoaEventTypeForEvent(*anEvent, aObjectFrame);
 
   if (anEvent->mMessage == eMouseMove ||
       anEvent->mMessage == eMouseDown ||
       anEvent->mMessage == eMouseUp ||
       anEvent->mMessage == NS_MOUSE_SCROLL ||
       anEvent->mMessage == eMouseOver ||
-      anEvent->mMessage == NS_MOUSE_OUT)
+      anEvent->mMessage == eMouseOut)
   {
     nsPoint pt = nsLayoutUtils::GetEventCoordinatesRelativeTo(anEvent, aObjectFrame) -
                  aObjectFrame->GetContentRectRelativeToSelf().TopLeft();
     nsPresContext* presContext = aObjectFrame->PresContext();
     // Plugin event coordinates need to be translated from device pixels
     // into "display pixels" in HiDPI modes.
     double scaleFactor = double(nsPresContext::AppUnitsPerCSSPixel())/
       aObjectFrame->PresContext()->DeviceContext()->AppUnitsPerDevPixelAtUnitFullZoom();
@@ -2103,17 +2103,17 @@ nsEventStatus nsPluginInstanceOwner::Pro
       // 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 == eMouseDown ||
                    anEvent.mMessage == eMouseUp ||
                    anEvent.mMessage == eMouseDoubleClick ||
                    anEvent.mMessage == eMouseOver ||
-                   anEvent.mMessage == NS_MOUSE_OUT ||
+                   anEvent.mMessage == eMouseOut ||
                    anEvent.mMessage == eMouseMove,
                    "Incorrect event type for coordinate translation");
       nsPoint pt =
         nsLayoutUtils::GetEventCoordinatesRelativeTo(&anEvent, mPluginFrame) -
         mPluginFrame->GetContentRectRelativeToSelf().TopLeft();
       nsPresContext* presContext = mPluginFrame->PresContext();
       nsIntPoint ptPx(presContext->AppUnitsToDevPixels(pt.x),
                       presContext->AppUnitsToDevPixels(pt.y));
@@ -2191,17 +2191,17 @@ nsEventStatus nsPluginInstanceOwner::Pro
 #elif defined(MOZ_WIDGET_QT)
         Window root = RootWindowOfScreen(DefaultScreenOfDisplay(mozilla::DefaultXDisplay()));
 #else
         Window root = None; // Could XQueryTree, but this is not important.
 #endif
 
         switch (anEvent.mMessage) {
           case eMouseOver:
-          case NS_MOUSE_OUT:
+          case eMouseOut:
             {
               XCrossingEvent& event = pluginEvent.xcrossing;
               event.type = anEvent.mMessage == eMouseOver ?
                 EnterNotify : LeaveNotify;
               event.root = root;
               event.time = anEvent.time;
               event.x = pluginPoint.x;
               event.y = pluginPoint.y;
--- a/layout/forms/nsListControlFrame.cpp
+++ b/layout/forms/nsListControlFrame.cpp
@@ -886,17 +886,17 @@ nsListControlFrame::HandleEvent(nsPresCo
                           "NS_MOUSE_LEFT_BUTTON_DOWN",
                           "<NA>","<NA>","<NA>","<NA>","<NA>","<NA>","<NA>",
                           "NS_MOUSE_MIDDLE_BUTTON_UP",
                           "NS_MOUSE_MIDDLE_BUTTON_DOWN",
                           "<NA>","<NA>","<NA>","<NA>","<NA>","<NA>","<NA>","<NA>",
                           "NS_MOUSE_RIGHT_BUTTON_UP",
                           "NS_MOUSE_RIGHT_BUTTON_DOWN",
                           "eMouseOver",
-                          "NS_MOUSE_OUT",
+                          "eMouseOut",
                           "NS_MOUSE_LEFT_DOUBLECLICK",
                           "NS_MOUSE_MIDDLE_DOUBLECLICK",
                           "NS_MOUSE_RIGHT_DOUBLECLICK",
                           "NS_MOUSE_LEFT_CLICK",
                           "NS_MOUSE_MIDDLE_CLICK",
                           "NS_MOUSE_RIGHT_CLICK"};
   int inx = aEvent->mMessage - eMouseEventFirst;
   if (inx >= 0 && inx <= (NS_MOUSE_RIGHT_CLICK - eMouseEventFirst)) {
--- a/layout/xul/nsMenuFrame.cpp
+++ b/layout/xul/nsMenuFrame.cpp
@@ -454,17 +454,17 @@ nsMenuFrame::HandleEvent(nsPresContext* 
   }
   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) {
+  else if (aEvent->mMessage == eMouseOut) {
     // Kill our timer if one is active.
     if (mOpenTimer) {
       mOpenTimer->Cancel();
       mOpenTimer = nullptr;
     }
 
     // Deactivate the menu.
     if (menuParent) {
--- a/layout/xul/nsScrollBoxFrame.cpp
+++ b/layout/xul/nsScrollBoxFrame.cpp
@@ -91,17 +91,17 @@ nsAutoRepeatBoxFrame::HandleEvent(nsPres
     case eMouseOver:
       if (IsActivatedOnHover()) {
         StartRepeat();
         mTrustedEvent = aEvent->mFlags.mIsTrusted;
       }
       break;
 
     case eMouseExitFromWidget:
-    case NS_MOUSE_OUT:
+    case eMouseOut:
       // always stop on mouse exit
       StopRepeat();
       // Not really necessary but do this to be safe
       mTrustedEvent = false;
       break;
 
     case eMouseClick: {
       WidgetMouseEvent* mouseEvent = aEvent->AsMouseEvent();
--- a/layout/xul/nsScrollbarButtonFrame.cpp
+++ b/layout/xul/nsScrollbarButtonFrame.cpp
@@ -58,17 +58,17 @@ nsScrollbarButtonFrame::HandleEvent(nsPr
       // if we didn't handle the press ourselves, pass it on to the superclass
       if (HandleButtonPress(aPresContext, aEvent, aEventStatus)) {
         return NS_OK;
       }
       break;
     case eMouseUp:
       HandleRelease(aPresContext, aEvent, aEventStatus);
       break;
-    case NS_MOUSE_OUT:
+    case eMouseOut:
       mCursorOnThis = false;
       break;
     case eMouseMove: {
       nsPoint cursor =
         nsLayoutUtils::GetEventCoordinatesRelativeTo(aEvent, this);
       nsRect frameRect(nsPoint(0, 0), GetSize());
       mCursorOnThis = frameRect.Contains(cursor);
       break;
--- a/layout/xul/nsSliderFrame.cpp
+++ b/layout/xul/nsSliderFrame.cpp
@@ -605,23 +605,23 @@ nsSliderFrame::HandleEvent(nsPresContext
       HandleRelease(aPresContext, aEvent, aEventStatus);
     }
 
     return NS_OK;
   }
 #endif
 
   // XXX hack until handle release is actually called in nsframe.
-  //  if (aEvent->mMessage == NS_MOUSE_OUT ||
+  //  if (aEvent->mMessage == eMouseOut ||
   //      aEvent->mMessage == NS_MOUSE_RIGHT_BUTTON_UP ||
   //      aEvent->mMessage == NS_MOUSE_LEFT_BUTTON_UP) {
   //    HandleRelease(aPresContext, aEvent, aEventStatus);
   //  }
 
-  if (aEvent->mMessage == NS_MOUSE_OUT && mChange)
+  if (aEvent->mMessage == eMouseOut && mChange)
      HandleRelease(aPresContext, aEvent, aEventStatus);
 
   return nsFrame::HandleEvent(aPresContext, aEvent, aEventStatus);
 }
 
 // Helper function to collect the "scroll to click" metric. Beware of
 // caching this, users expect to be able to change the system preference
 // and see the browser change its behavior immediately.
--- a/layout/xul/tree/nsTreeBodyFrame.cpp
+++ b/layout/xul/tree/nsTreeBodyFrame.cpp
@@ -2571,17 +2571,17 @@ nsTreeBodyFrame::HandleEvent(nsPresConte
     if (mMouseOverRow != newrow) {
       // redraw the old and the new row
       if (mMouseOverRow != -1)
         InvalidateRow(mMouseOverRow);
       mMouseOverRow = newrow;
       if (mMouseOverRow != -1)
         InvalidateRow(mMouseOverRow);
     }
-  } else if (aEvent->mMessage == NS_MOUSE_OUT) {
+  } else if (aEvent->mMessage == eMouseOut) {
     if (mMouseOverRow != -1) {
       InvalidateRow(mMouseOverRow);
       mMouseOverRow = -1;
     }
   } else if (aEvent->mMessage == NS_DRAGDROP_ENTER) {
     if (!mSlots)
       mSlots = new Slots();
 
--- a/widget/EventMessageList.h
+++ b/widget/EventMessageList.h
@@ -51,17 +51,17 @@ NS_EVENT_MESSAGE(eMouseUp,              
 NS_EVENT_MESSAGE(eMouseDown,            eMouseEventFirst + 2)
 NS_EVENT_MESSAGE(eMouseEnterIntoWidget, eMouseEventFirst + 22)
 NS_EVENT_MESSAGE(eMouseExitFromWidget,  eMouseEventFirst + 23)
 NS_EVENT_MESSAGE(eMouseDoubleClick,     eMouseEventFirst + 24)
 NS_EVENT_MESSAGE(eMouseClick,           eMouseEventFirst + 27)
 // eMouseActivate is fired when the widget is activated by a click.
 NS_EVENT_MESSAGE(eMouseActivate,        eMouseEventFirst + 30)
 NS_EVENT_MESSAGE(eMouseOver,            eMouseEventFirst + 31)
-NS_EVENT_MESSAGE(NS_MOUSE_OUT,          eMouseEventFirst + 32)
+NS_EVENT_MESSAGE(eMouseOut,             eMouseEventFirst + 32)
 NS_EVENT_MESSAGE(NS_MOUSE_MOZHITTEST,   eMouseEventFirst + 33)
 NS_EVENT_MESSAGE(NS_MOUSEENTER,         eMouseEventFirst + 34)
 NS_EVENT_MESSAGE(NS_MOUSELEAVE,         eMouseEventFirst + 35)
 NS_EVENT_MESSAGE(NS_MOUSE_MOZLONGTAP,   eMouseEventFirst + 36)
 
 // Pointer spec events
 NS_EVENT_MESSAGE(NS_POINTER_EVENT_START,  4400)
 NS_EVENT_MESSAGE(NS_POINTER_MOVE,         NS_POINTER_EVENT_START)
--- a/widget/WidgetEventImpl.cpp
+++ b/widget/WidgetEventImpl.cpp
@@ -81,17 +81,17 @@ WidgetEvent::HasMouseEventMessage() cons
     case eMouseDown:
     case eMouseUp:
     case eMouseClick:
     case eMouseDoubleClick:
     case eMouseEnterIntoWidget:
     case eMouseExitFromWidget:
     case eMouseActivate:
     case eMouseOver:
-    case NS_MOUSE_OUT:
+    case eMouseOut:
     case NS_MOUSE_MOZHITTEST:
     case eMouseMove:
       return true;
     default:
       return false;
   }
 }