Bug 895274 part.33 Rename NS_MOUSE_OVER to eMouseOver r=smaug
authorMasayuki Nakano <masayuki@d-toybox.com>
Sat, 29 Aug 2015 08:58:32 +0900
changeset 259901 b8fe1dac71aeb337dbdb084297b25071d03cf1a0
parent 259900 ce720f26f58cd3a808c4af314582d21a39e77a70
child 259902 4bcb03faecc6d51c09068243a4b73240b7af80a2
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.33 Rename NS_MOUSE_OVER to eMouseOver 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/nsScrollBoxFrame.cpp
layout/xul/tree/nsTreeBodyFrame.cpp
widget/EventMessageList.h
widget/WidgetEventImpl.cpp
--- a/dom/base/Element.cpp
+++ b/dom/base/Element.cpp
@@ -2863,17 +2863,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 NS_MOUSE_OVER:
+  case eMouseOver:
   case NS_FOCUS_CONTENT:
   case NS_MOUSE_OUT:
   case NS_BLUR_CONTENT:
     break;
   default:
     return NS_OK;
   }
 
@@ -2884,17 +2884,17 @@ Element::PreHandleEventForLinks(EventCha
   }
 
   nsresult rv = NS_OK;
 
   // We do the status bar updates in PreHandleEvent so that the status bar gets
   // updated even if the event is consumed before we have a chance to set it.
   switch (aVisitor.mEvent->mMessage) {
   // Set the status bar similarly for mouseover and focus
-  case NS_MOUSE_OVER:
+  case eMouseOver:
     aVisitor.mEventStatus = nsEventStatus_eConsumeNoDefault;
     // FALL THROUGH
   case NS_FOCUS_CONTENT: {
     InternalFocusEvent* focusEvent = aVisitor.mEvent->AsFocusEvent();
     if (!focusEvent || !focusEvent->isRefocus) {
       nsAutoString target;
       GetLinkTarget(target);
       nsContentUtils::TriggerLink(this, aVisitor.mPresContext, absURI, target,
--- a/dom/base/FragmentOrElement.cpp
+++ b/dom/base/FragmentOrElement.cpp
@@ -672,17 +672,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 == NS_MOUSE_OVER ||
+  if ((aVisitor.mEvent->mMessage == eMouseOver ||
        aVisitor.mEvent->mMessage == NS_MOUSE_OUT ||
        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 &&
@@ -734,17 +734,17 @@ nsIContent::PreHandleEvent(EventChainPre
               if (originalTarget) {
                 originalTarget->NodeInfo()->NameAtom()->ToString(ot);
               }
               NodeInfo()->NameAtom()->ToString(ct);
               relatedTarget->NodeInfo()->NameAtom()->ToString(rt);
               printf("Stopping %s propagation:"
                      "\n\toriginalTarget=%s \n\tcurrentTarget=%s %s"
                      "\n\trelatedTarget=%s %s \n%s",
-                     (aVisitor.mEvent->mMessage == NS_MOUSE_OVER)
+                     (aVisitor.mEvent->mMessage == eMouseOver)
                        ? "mouseover" : "mouseout",
                      NS_ConvertUTF16toUTF8(ot).get(),
                      NS_ConvertUTF16toUTF8(ct).get(),
                      isAnonForEvents
                        ? "(is native anonymous)"
                        : (ChromeOnlyAccess()
                            ? "(is in native anonymous subtree)" : ""),
                      NS_ConvertUTF16toUTF8(rt).get(),
--- a/dom/events/EventNameList.h
+++ b/dom/events/EventNameList.h
@@ -282,17 +282,17 @@ EVENT(mousemove,
       eMouseMove,
       EventNameType_All,
       eMouseEventClass)
 EVENT(mouseout,
       NS_MOUSE_OUT,
       EventNameType_All,
       eMouseEventClass)
 EVENT(mouseover,
-      NS_MOUSE_OVER,
+      eMouseOver,
       EventNameType_All,
       eMouseEventClass)
 EVENT(mouseup,
       eMouseUp,
       EventNameType_All,
       eMouseEventClass)
 EVENT(mozfullscreenchange,
       NS_FULLSCREENCHANGE,
--- a/dom/events/EventStateManager.cpp
+++ b/dom/events/EventStateManager.cpp
@@ -3738,17 +3738,17 @@ EventStateManager::DispatchMouseOrPointe
                                                nsIContent* aRelatedContent)
 {
   // 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 == NS_MOUSE_OVER ||
+       aMessage == eMouseOver ||
        aMessage == NS_MOUSE_OUT)) {
     mCurrentTargetContent = nullptr;
     nsCOMPtr<Element> pointerLockedElement =
       do_QueryReferent(EventStateManager::sPointerLockedElement);
     if (!pointerLockedElement) {
       NS_WARNING("Should have pointer locked element, but didn't.");
       return nullptr;
     }
@@ -3797,17 +3797,17 @@ EventStateManager::DispatchMouseOrPointe
         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
         // will be set back below.) HandleCrossProcessEvent will query for the
         // proper target via GetEventTarget which will return mCurrentTarget.
         mCurrentTarget = targetFrame;
         HandleCrossProcessEvent(remoteEvent, &status);
-      } else if (aMessage == NS_MOUSE_OVER) {
+      } else if (aMessage == eMouseOver) {
         nsAutoPtr<WidgetMouseEvent> remoteEvent;
         CreateMouseOrPointerWidgetEvent(aMouseEvent, eMouseEnterIntoWidget,
                                         aRelatedContent, remoteEvent);
         HandleCrossProcessEvent(remoteEvent, &status);
       }
     }
   }
 
@@ -4003,17 +4003,17 @@ EventStateManager::NotifyMouseOver(Widge
   if (!isPointer) {
     SetContentState(aContent, NS_EVENT_STATE_HOVER);
   }
 
   if (dispatch) {
     // Fire mouseover
     wrapper->mLastOverFrame = 
       DispatchMouseOrPointerEvent(aMouseEvent,
-                                  isPointer ? NS_POINTER_OVER : NS_MOUSE_OVER,
+                                  isPointer ? NS_POINTER_OVER : eMouseOver,
                                   aContent, lastOverElement);
     wrapper->mLastOverElement = aContent;
   } else {
     wrapper->mLastOverFrame = nullptr;
     wrapper->mLastOverElement = nullptr;
   }
 
   // Turn recursion protection back off
--- a/dom/html/HTMLButtonElement.cpp
+++ b/dom/html/HTMLButtonElement.cpp
@@ -341,17 +341,17 @@ HTMLButtonElement::PostHandleEvent(Event
           if (aVisitor.mDOMEvent &&
               (mouseEvent->button == WidgetMouseEvent::eMiddleButton ||
                mouseEvent->button == WidgetMouseEvent::eRightButton)) {
             aVisitor.mDOMEvent->StopPropagation();
           }
         }
         break;
 
-      case NS_MOUSE_OVER:
+      case eMouseOver:
         {
           aVisitor.mPresContext->EventStateManager()->
             SetContentState(this, NS_EVENT_STATE_HOVER);
           aVisitor.mEventStatus = nsEventStatus_eConsumeNoDefault;
         }
         break;
 
         // XXX this doesn't seem to do anything yet
--- a/dom/html/HTMLInputElement.cpp
+++ b/dom/html/HTMLInputElement.cpp
@@ -3023,17 +3023,17 @@ HTMLInputElement::NeedToInitializeEditor
       aVisitor.mEvent->mClass == eMutationEventClass) {
     return false;
   }
 
   switch (aVisitor.mEvent->mMessage) {
   case eMouseMove:
   case eMouseEnterIntoWidget:
   case eMouseExitFromWidget:
-  case NS_MOUSE_OVER:
+  case eMouseOver:
   case NS_MOUSE_OUT:
   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
@@ -1803,17 +1803,17 @@ static NPCocoaEventType
 CocoaEventTypeForEvent(const WidgetGUIEvent& anEvent, nsIFrame* aObjectFrame)
 {
   const NPCocoaEvent* event = static_cast<const NPCocoaEvent*>(anEvent.mPluginEvent);
   if (event) {
     return event->type;
   }
 
   switch (anEvent.mMessage) {
-    case NS_MOUSE_OVER:
+    case eMouseOver:
       return NPCocoaEventMouseEntered;
     case NS_MOUSE_OUT:
       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()) {
@@ -1846,17 +1846,17 @@ TranslateToNPCocoaEvent(WidgetGUIEvent* 
   NPCocoaEvent cocoaEvent;
   InitializeNPCocoaEvent(&cocoaEvent);
   cocoaEvent.type = CocoaEventTypeForEvent(*anEvent, aObjectFrame);
 
   if (anEvent->mMessage == eMouseMove ||
       anEvent->mMessage == eMouseDown ||
       anEvent->mMessage == eMouseUp ||
       anEvent->mMessage == NS_MOUSE_SCROLL ||
-      anEvent->mMessage == NS_MOUSE_OVER ||
+      anEvent->mMessage == eMouseOver ||
       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
     // into "display pixels" in HiDPI modes.
     double scaleFactor = double(nsPresContext::AppUnitsPerCSSPixel())/
@@ -2102,17 +2102,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 == eMouseDown ||
                    anEvent.mMessage == eMouseUp ||
                    anEvent.mMessage == eMouseDoubleClick ||
-                   anEvent.mMessage == NS_MOUSE_OVER ||
+                   anEvent.mMessage == eMouseOver ||
                    anEvent.mMessage == NS_MOUSE_OUT ||
                    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),
@@ -2189,23 +2189,22 @@ nsEventStatus nsPluginInstanceOwner::Pro
 #ifdef MOZ_WIDGET_GTK
         Window root = GDK_ROOT_WINDOW();
 #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 NS_MOUSE_OVER:
+        switch (anEvent.mMessage) {
+          case eMouseOver:
           case NS_MOUSE_OUT:
             {
               XCrossingEvent& event = pluginEvent.xcrossing;
-              event.type = anEvent.mMessage == NS_MOUSE_OVER ?
+              event.type = anEvent.mMessage == eMouseOver ?
                 EnterNotify : LeaveNotify;
               event.root = root;
               event.time = anEvent.time;
               event.x = pluginPoint.x;
               event.y = pluginPoint.y;
               event.x_root = rootPoint.x;
               event.y_root = rootPoint.y;
               event.state = XInputEventState(mouseEvent);
--- a/layout/forms/nsListControlFrame.cpp
+++ b/layout/forms/nsListControlFrame.cpp
@@ -885,17 +885,17 @@ nsListControlFrame::HandleEvent(nsPresCo
                           "NS_MOUSE_LEFT_BUTTON_UP",
                           "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",
-                          "NS_MOUSE_OVER",
+                          "eMouseOver",
                           "NS_MOUSE_OUT",
                           "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;
--- a/layout/xul/nsScrollBoxFrame.cpp
+++ b/layout/xul/nsScrollBoxFrame.cpp
@@ -83,17 +83,17 @@ nsAutoRepeatBoxFrame::HandleEvent(nsPres
     return NS_OK;
   }
 
   switch(aEvent->mMessage) {
     // repeat mode may be "hover" for repeating while the mouse is hovering
     // over the element, otherwise repetition is done while the element is
     // active (pressed).
     case eMouseEnterIntoWidget:
-    case NS_MOUSE_OVER:
+    case eMouseOver:
       if (IsActivatedOnHover()) {
         StartRepeat();
         mTrustedEvent = aEvent->mFlags.mIsTrusted;
       }
       break;
 
     case eMouseExitFromWidget:
     case NS_MOUSE_OUT:
--- a/layout/xul/tree/nsTreeBodyFrame.cpp
+++ b/layout/xul/tree/nsTreeBodyFrame.cpp
@@ -2558,17 +2558,17 @@ static uint32_t GetDropEffect(WidgetGUIE
   return action;
 }
 
 nsresult
 nsTreeBodyFrame::HandleEvent(nsPresContext* aPresContext,
                              WidgetGUIEvent* aEvent,
                              nsEventStatus* aEventStatus)
 {
-  if (aEvent->mMessage == NS_MOUSE_OVER || aEvent->mMessage == eMouseMove) {
+  if (aEvent->mMessage == eMouseOver || aEvent->mMessage == eMouseMove) {
     nsPoint pt = nsLayoutUtils::GetEventCoordinatesRelativeTo(aEvent, this);
     int32_t xTwips = pt.x - mInnerBox.x;
     int32_t yTwips = pt.y - mInnerBox.y;
     int32_t newrow = GetRowAt(xTwips, yTwips);
     if (mMouseOverRow != newrow) {
       // redraw the old and the new row
       if (mMouseOverRow != -1)
         InvalidateRow(mMouseOverRow);
--- a/widget/EventMessageList.h
+++ b/widget/EventMessageList.h
@@ -50,17 +50,17 @@ NS_EVENT_MESSAGE(eMouseMove,            
 NS_EVENT_MESSAGE(eMouseUp,              eMouseEventFirst + 1)
 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(NS_MOUSE_OVER,         eMouseEventFirst + 31)
+NS_EVENT_MESSAGE(eMouseOver,            eMouseEventFirst + 31)
 NS_EVENT_MESSAGE(NS_MOUSE_OUT,          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)
--- a/widget/WidgetEventImpl.cpp
+++ b/widget/WidgetEventImpl.cpp
@@ -80,17 +80,17 @@ WidgetEvent::HasMouseEventMessage() cons
   switch (mMessage) {
     case eMouseDown:
     case eMouseUp:
     case eMouseClick:
     case eMouseDoubleClick:
     case eMouseEnterIntoWidget:
     case eMouseExitFromWidget:
     case eMouseActivate:
-    case NS_MOUSE_OVER:
+    case eMouseOver:
     case NS_MOUSE_OUT:
     case NS_MOUSE_MOZHITTEST:
     case eMouseMove:
       return true;
     default:
       return false;
   }
 }