Bug 895274 part.242 Rename NS_TOUCH_MOVE to eTouchMove r=smaug
authorMasayuki Nakano <masayuki@d-toybox.com>
Tue, 15 Sep 2015 00:14:35 +0900
changeset 262346 79b8d374b4fd3c310e3504831c188db145e30a17
parent 262345 a92cec9902d70d52289ee2205b3f5f925c332e3c
child 262347 aa8e1b6f6753c7f5d8413944b353bc2b18570a04
push id29371
push userkwierso@gmail.com
push dateTue, 15 Sep 2015 00:13:11 +0000
treeherdermozilla-central@3eb37530c627 [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.242 Rename NS_TOUCH_MOVE to eTouchMove r=smaug
dom/base/nsDOMWindowUtils.cpp
dom/events/EventNameList.h
dom/events/EventStateManager.cpp
dom/html/HTMLInputElement.cpp
dom/ipc/TabChild.cpp
dom/ipc/TabParent.cpp
gfx/layers/apz/util/APZEventState.cpp
layout/base/AccessibleCaretEventHub.cpp
layout/base/SelectionCarets.cpp
layout/base/TouchCaret.cpp
layout/base/TouchManager.cpp
layout/base/gtest/TestAccessibleCaretEventHub.cpp
layout/base/nsPresShell.cpp
layout/xul/nsResizerFrame.cpp
layout/xul/nsSliderFrame.cpp
widget/EventMessageList.h
widget/InputData.cpp
widget/android/AndroidJavaWrappers.cpp
widget/uikit/nsWindow.mm
--- a/dom/base/nsDOMWindowUtils.cpp
+++ b/dom/base/nsDOMWindowUtils.cpp
@@ -959,17 +959,17 @@ nsDOMWindowUtils::SendTouchEventCommon(c
   nsCOMPtr<nsIWidget> widget = GetWidget(&offset);
   if (!widget) {
     return NS_ERROR_NULL_POINTER;
   }
   EventMessage msg;
   if (aType.EqualsLiteral("touchstart")) {
     msg = eTouchStart;
   } else if (aType.EqualsLiteral("touchmove")) {
-    msg = NS_TOUCH_MOVE;
+    msg = eTouchMove;
   } else if (aType.EqualsLiteral("touchend")) {
     msg = NS_TOUCH_END;
   } else if (aType.EqualsLiteral("touchcancel")) {
     msg = NS_TOUCH_CANCEL;
   } else {
     return NS_ERROR_UNEXPECTED;
   }
   WidgetTouchEvent event(true, msg, widget);
--- a/dom/events/EventNameList.h
+++ b/dom/events/EventNameList.h
@@ -571,17 +571,17 @@ TOUCH_EVENT(touchstart,
             eTouchStart,
             EventNameType_All,
             eTouchEventClass)
 TOUCH_EVENT(touchend,
             NS_TOUCH_END,
             EventNameType_All,
             eTouchEventClass)
 TOUCH_EVENT(touchmove,
-            NS_TOUCH_MOVE,
+            eTouchMove,
             EventNameType_All,
             eTouchEventClass )
 TOUCH_EVENT(touchcancel,
             NS_TOUCH_CANCEL,
             EventNameType_All,
             eTouchEventClass)
 
 DOCUMENT_ONLY_EVENT(readystatechange,
--- a/dom/events/EventStateManager.cpp
+++ b/dom/events/EventStateManager.cpp
@@ -1149,17 +1149,17 @@ CrossProcessSafeEvent(const WidgetEvent&
     case eMouseExitFromWidget:
       return true;
     default:
       return false;
     }
   case eTouchEventClass:
     switch (aEvent.mMessage) {
     case eTouchStart:
-    case NS_TOUCH_MOVE:
+    case eTouchMove:
     case NS_TOUCH_END:
     case NS_TOUCH_CANCEL:
       return true;
     default:
       return false;
     }
   case eDragEventClass:
     switch (aEvent.mMessage) {
--- a/dom/html/HTMLInputElement.cpp
+++ b/dom/html/HTMLInputElement.cpp
@@ -4114,17 +4114,17 @@ HTMLInputElement::PostHandleEventForRang
         } else if (mIsDraggingRange) {
           CancelRangeThumbDrag();
         }
       }
       aVisitor.mEvent->mFlags.mMultipleActionsPrevented = true;
     } break;
 
     case eMouseMove:
-    case NS_TOUCH_MOVE:
+    case eTouchMove:
       if (!mIsDraggingRange) {
         break;
       }
       if (nsIPresShell::GetCapturingContent() != this) {
         // Someone else grabbed capture.
         CancelRangeThumbDrag();
         break;
       }
--- a/dom/ipc/TabChild.cpp
+++ b/dom/ipc/TabChild.cpp
@@ -2039,17 +2039,17 @@ TabChild::UpdateTapState(const WidgetTou
   Touch* trackedTouch = GetTouchForIdentifier(aEvent, mActivePointerId);
   if (!trackedTouch) {
     return;
   }
 
   LayoutDevicePoint currentPoint = LayoutDevicePoint(trackedTouch->mRefPoint.x, trackedTouch->mRefPoint.y);
   int64_t time = aEvent.time;
   switch (aEvent.mMessage) {
-  case NS_TOUCH_MOVE:
+  case eTouchMove:
     if (std::abs(currentPoint.x - mGestureDownPoint.x) > sDragThreshold.width ||
         std::abs(currentPoint.y - mGestureDownPoint.y) > sDragThreshold.height) {
       CancelTapTracking();
     }
     return;
 
   case NS_TOUCH_END:
     if (!TouchManager::gPreventMouseEvents) {
--- a/dom/ipc/TabParent.cpp
+++ b/dom/ipc/TabParent.cpp
@@ -1851,17 +1851,17 @@ bool TabParent::SendRealTouchEvent(Widge
     return false;
   }
 
   LayoutDeviceIntPoint offset = GetChildProcessOffset();
   for (uint32_t i = 0; i < event.touches.Length(); i++) {
     event.touches[i]->mRefPoint += offset;
   }
 
-  return (event.mMessage == NS_TOUCH_MOVE) ?
+  return (event.mMessage == eTouchMove) ?
     PBrowserParent::SendRealTouchMoveEvent(event, guid, blockId, apzResponse) :
     PBrowserParent::SendRealTouchEvent(event, guid, blockId, apzResponse);
 }
 
 bool
 TabParent::RecvSyncMessage(const nsString& aMessage,
                            const ClonedMessageData& aData,
                            InfallibleTArray<CpowEntry>&& aCpows,
@@ -2984,17 +2984,17 @@ TabParent::InjectTouchEvent(const nsAStr
                             uint32_t* aRys,
                             float* aRotationAngles,
                             float* aForces,
                             uint32_t aCount,
                             int32_t aModifiers)
 {
   EventMessage msg;
   nsContentUtils::GetEventMessageAndAtom(aType, eTouchEventClass, &msg);
-  if (msg != eTouchStart && msg != NS_TOUCH_MOVE &&
+  if (msg != eTouchStart && msg != eTouchMove &&
       msg != NS_TOUCH_END && msg != NS_TOUCH_CANCEL) {
     return NS_ERROR_FAILURE;
   }
 
   nsCOMPtr<nsIWidget> widget = GetWidget();
   if (!widget) {
     return NS_ERROR_FAILURE;
   }
--- a/gfx/layers/apz/util/APZEventState.cpp
+++ b/gfx/layers/apz/util/APZEventState.cpp
@@ -287,17 +287,17 @@ APZEventState::ProcessTouchEvent(const W
     if (isTouchPrevented) {
       mTouchEndCancelled = true;
       mEndTouchIsClick = false;
     }
     // fall through
   case NS_TOUCH_CANCEL:
     mActiveElementManager->HandleTouchEndEvent(mEndTouchIsClick);
     // fall through
-  case NS_TOUCH_MOVE: {
+  case eTouchMove: {
     if (mPendingTouchPreventedResponse) {
       MOZ_ASSERT(aGuid == mPendingTouchPreventedGuid);
     }
     sentContentResponse = SendPendingTouchPreventedResponse(isTouchPrevented);
     break;
   }
 
   default:
--- a/layout/base/AccessibleCaretEventHub.cpp
+++ b/layout/base/AccessibleCaretEventHub.cpp
@@ -570,20 +570,20 @@ AccessibleCaretEventHub::HandleTouchEven
 
   switch (aEvent->mMessage) {
   case eTouchStart:
     AC_LOGV("Before eTouchStart, state: %s", mState->Name());
     rv = mState->OnPress(this, point, id);
     AC_LOGV("After eTouchStart, state: %s, consume: %d", mState->Name(), rv);
     break;
 
-  case NS_TOUCH_MOVE:
-    AC_LOGV("Before NS_TOUCH_MOVE, state: %s", mState->Name());
+  case eTouchMove:
+    AC_LOGV("Before eTouchMove, state: %s", mState->Name());
     rv = mState->OnMove(this, point);
-    AC_LOGV("After NS_TOUCH_MOVE, state: %s, consume: %d", mState->Name(), rv);
+    AC_LOGV("After eTouchMove, state: %s, consume: %d", mState->Name(), rv);
     break;
 
   case NS_TOUCH_END:
     AC_LOGV("Before NS_TOUCH_END, state: %s", mState->Name());
     rv = mState->OnRelease(this);
     AC_LOGV("After NS_TOUCH_END, state: %s, consume: %d", mState->Name(), rv);
     break;
 
--- a/layout/base/SelectionCarets.cpp
+++ b/layout/base/SelectionCarets.cpp
@@ -239,18 +239,17 @@ SelectionCarets::HandleEvent(WidgetEvent
       // Only care about same id
       if (mActiveTouchId == nowTouchId) {
         SetSelectionDragState(false);
         mDragMode = NONE;
         mActiveTouchId = -1;
       }
       return nsEventStatus_eConsumeNoDefault;
     }
-  } else if (aEvent->mMessage == NS_TOUCH_MOVE ||
-             aEvent->mMessage == eMouseMove) {
+  } else if (aEvent->mMessage == eTouchMove || aEvent->mMessage == eMouseMove) {
     if (mDragMode == START_FRAME || mDragMode == END_FRAME) {
       if (mActiveTouchId == nowTouchId) {
         ptInRoot.y += mCaretCenterToDownPointOffsetY;
 
         if (mDragMode == START_FRAME) {
           if (ptInRoot.y > mDragDownYBoundary) {
             ptInRoot.y = mDragDownYBoundary;
           }
--- a/layout/base/TouchCaret.cpp
+++ b/layout/base/TouchCaret.cpp
@@ -767,17 +767,17 @@ TouchCaret::HandleEvent(WidgetEvent* aEv
       status = HandleMouseDownEvent(aEvent->AsMouseEvent());
       break;
     case NS_TOUCH_END:
       status = HandleTouchUpEvent(aEvent->AsTouchEvent());
       break;
     case eMouseUp:
       status = HandleMouseUpEvent(aEvent->AsMouseEvent());
       break;
-    case NS_TOUCH_MOVE:
+    case eTouchMove:
       status = HandleTouchMoveEvent(aEvent->AsTouchEvent());
       break;
     case eMouseMove:
       status = HandleMouseMoveEvent(aEvent->AsMouseEvent());
       break;
     case NS_TOUCH_CANCEL:
       mTouchesId.Clear();
       SetState(TOUCHCARET_NONE);
@@ -890,17 +890,17 @@ TouchCaret::HandleTouchMoveEvent(WidgetT
 
         MoveCaret(movePoint);
         mIsValidTap = false;
         status = nsEventStatus_eConsumeNoDefault;
       }
       break;
 
     case TOUCHCARET_TOUCHDRAG_INACTIVE:
-      // Consume NS_TOUCH_MOVE event in TOUCHCARET_TOUCHDRAG_INACTIVE state.
+      // Consume eTouchMove event in TOUCHCARET_TOUCHDRAG_INACTIVE state.
       status = nsEventStatus_eConsumeNoDefault;
       break;
   }
 
   return status;
 }
 
 nsEventStatus
--- a/layout/base/TouchManager.cpp
+++ b/layout/base/TouchManager.cpp
@@ -123,17 +123,17 @@ TouchManager::PreHandleEvent(WidgetEvent
           // If it is not already in the queue, it is a new touch
           touch->mChanged = true;
         }
         touch->mMessage = aEvent->mMessage;
         gCaptureTouchList->Put(id, touch);
       }
       break;
     }
-    case NS_TOUCH_MOVE: {
+    case eTouchMove: {
       // Check for touches that changed. Mark them add to queue
       WidgetTouchEvent* touchEvent = aEvent->AsTouchEvent();
       WidgetTouchEvent::TouchArray& touches = touchEvent->touches;
       bool haveChanged = false;
       for (int32_t i = touches.Length(); i; ) {
         --i;
         dom::Touch* touch = touches[i];
         if (!touch) {
--- a/layout/base/gtest/TestAccessibleCaretEventHub.cpp
+++ b/layout/base/gtest/TestAccessibleCaretEventHub.cpp
@@ -163,17 +163,17 @@ public:
 
   static UniquePtr<WidgetEvent> CreateTouchPressEvent(nscoord aX, nscoord aY)
   {
     return CreateTouchEvent(eTouchStart, aX, aY);
   }
 
   static UniquePtr<WidgetEvent> CreateTouchMoveEvent(nscoord aX, nscoord aY)
   {
-    return CreateTouchEvent(NS_TOUCH_MOVE, aX, aY);
+    return CreateTouchEvent(eTouchMove, aX, aY);
   }
 
   static UniquePtr<WidgetEvent> CreateTouchReleaseEvent(nscoord aX, nscoord aY)
   {
     return CreateTouchEvent(NS_TOUCH_END, aX, aY);
   }
 
   static UniquePtr<WidgetEvent> CreateWheelEvent(EventMessage aMessage)
--- a/layout/base/nsPresShell.cpp
+++ b/layout/base/nsPresShell.cpp
@@ -6672,17 +6672,17 @@ DispatchPointerFromMouseOrTouch(PresShel
                      0.0f;
     event.convertToPointer = mouseEvent->convertToPointer = false;
     aShell->HandleEvent(aFrame, &event, aDontRetargetEvents, aStatus, aTargetContent);
   } else if (aEvent->mClass == eTouchEventClass) {
     WidgetTouchEvent* touchEvent = aEvent->AsTouchEvent();
     // loop over all touches and dispatch pointer events on each touch
     // copy the event
     switch (touchEvent->mMessage) {
-    case NS_TOUCH_MOVE:
+    case eTouchMove:
       pointerMessage = ePointerMove;
       break;
     case NS_TOUCH_END:
       pointerMessage = ePointerUp;
       break;
     case eTouchStart:
       pointerMessage = ePointerDown;
       break;
@@ -7473,17 +7473,17 @@ PresShell::HandleEvent(nsIFrame* aFrame,
     if (!frame) {
       NS_WARNING("Nothing to handle this event!");
       return NS_OK;
     }
 
     PresShell* shell =
         static_cast<PresShell*>(frame->PresContext()->PresShell());
     switch (aEvent->mMessage) {
-      case NS_TOUCH_MOVE:
+      case eTouchMove:
       case NS_TOUCH_CANCEL:
       case NS_TOUCH_END: {
         // get the correct shell to dispatch to
         WidgetTouchEvent* touchEvent = aEvent->AsTouchEvent();
         for (dom::Touch* touch : touchEvent->touches) {
           if (!touch) {
             break;
           }
@@ -8058,17 +8058,17 @@ PresShell::DispatchTouchEventToDOM(Widge
                                    nsEventStatus* aStatus,
                                    nsPresShellEventCB* aEventCB,
                                    bool aTouchIsNew)
 {
   // calling preventDefault on touchstart or the first touchmove for a
   // point prevents mouse events. calling it on the touchend should
   // prevent click dispatching.
   bool canPrevent = (aEvent->mMessage == eTouchStart) ||
-                    (aEvent->mMessage == NS_TOUCH_MOVE && aTouchIsNew) ||
+                    (aEvent->mMessage == eTouchMove && aTouchIsNew) ||
                     (aEvent->mMessage == NS_TOUCH_END);
   bool preventDefault = false;
   nsEventStatus tmpStatus = nsEventStatus_eIgnore;
   WidgetTouchEvent* touchEvent = aEvent->AsTouchEvent();
 
   // loop over all touches and dispatch events on any that have changed
   for (dom::Touch* touch : touchEvent->touches) {
     if (!touch || !touch->mChanged) {
--- a/layout/xul/nsResizerFrame.cpp
+++ b/layout/xul/nsResizerFrame.cpp
@@ -138,17 +138,17 @@ nsResizerFrame::HandleEvent(nsPresContex
 
       nsIPresShell::SetCapturingContent(nullptr, 0);
 
       doDefault = false;
     }
   }
   break;
 
-  case NS_TOUCH_MOVE:
+  case eTouchMove:
   case eMouseMove: {
     if (mTrackingMouseMove)
     {
       nsCOMPtr<nsIBaseWindow> window;
       nsIPresShell* presShell = aPresContext->GetPresShell();
       nsCOMPtr<nsIContent> contentToResize =
         GetContentToResize(presShell, getter_AddRefs(window));
 
--- a/layout/xul/nsSliderFrame.cpp
+++ b/layout/xul/nsSliderFrame.cpp
@@ -473,17 +473,17 @@ nsSliderFrame::HandleEvent(nsPresContext
   nsIFrame* scrollbarBox = GetScrollbar();
   nsCOMPtr<nsIContent> scrollbar;
   scrollbar = GetContentOfBox(scrollbarBox);
   bool isHorizontal = IsHorizontal();
 
   if (isDraggingThumb())
   {
     switch (aEvent->mMessage) {
-    case NS_TOUCH_MOVE:
+    case eTouchMove:
     case eMouseMove: {
       nsPoint eventPoint;
       if (!GetEventPoint(aEvent, eventPoint)) {
         break;
       }
       if (mChange) {
         // On Linux the destination point is determined by the initial click
         // on the scrollbar track and doesn't change until the mouse button
--- a/widget/EventMessageList.h
+++ b/widget/EventMessageList.h
@@ -366,17 +366,17 @@ NS_EVENT_MESSAGE(NS_SHOW_EVENT,         
 
 // Fullscreen DOM API
 NS_EVENT_MESSAGE(eFullscreenEventFirst,  5100)
 NS_EVENT_MESSAGE(eFullscreenChange,      eFullscreenEventFirst)
 NS_EVENT_MESSAGE(eFullscreenError,       eFullscreenEventFirst + 1)
 
 NS_EVENT_MESSAGE(eTouchEventFirst,       5200)
 NS_EVENT_MESSAGE(eTouchStart,            eTouchEventFirst)
-NS_EVENT_MESSAGE(NS_TOUCH_MOVE,          eTouchEventFirst + 1)
+NS_EVENT_MESSAGE(eTouchMove,             eTouchEventFirst + 1)
 NS_EVENT_MESSAGE(NS_TOUCH_END,           eTouchEventFirst + 2)
 NS_EVENT_MESSAGE(NS_TOUCH_CANCEL,        eTouchEventFirst + 3)
 
 // Pointerlock DOM API
 NS_EVENT_MESSAGE(ePointerLockEventFirst, 5300)
 NS_EVENT_MESSAGE(ePointerLockChange,     ePointerLockEventFirst)
 NS_EVENT_MESSAGE(ePointerLockError,      ePointerLockEventFirst + 1)
 
--- a/widget/InputData.cpp
+++ b/widget/InputData.cpp
@@ -34,17 +34,17 @@ MultiTouchInput::MultiTouchInput(const W
 {
   MOZ_ASSERT(NS_IsMainThread(),
              "Can only copy from WidgetTouchEvent on main thread");
 
   switch (aTouchEvent.mMessage) {
     case eTouchStart:
       mType = MULTITOUCH_START;
       break;
-    case NS_TOUCH_MOVE:
+    case eTouchMove:
       mType = MULTITOUCH_MOVE;
       break;
     case NS_TOUCH_END:
       mType = MULTITOUCH_END;
       break;
     case NS_TOUCH_CANCEL:
       mType = MULTITOUCH_CANCEL;
       break;
@@ -82,17 +82,17 @@ MultiTouchInput::ToWidgetTouchEvent(nsIW
              "Can only convert To WidgetTouchEvent on main thread");
 
   EventMessage touchEventMessage = eVoidEvent;
   switch (mType) {
   case MULTITOUCH_START:
     touchEventMessage = eTouchStart;
     break;
   case MULTITOUCH_MOVE:
-    touchEventMessage = NS_TOUCH_MOVE;
+    touchEventMessage = eTouchMove;
     break;
   case MULTITOUCH_END:
     touchEventMessage = NS_TOUCH_END;
     break;
   case MULTITOUCH_CANCEL:
     touchEventMessage = NS_TOUCH_CANCEL;
     break;
   default:
--- a/widget/android/AndroidJavaWrappers.cpp
+++ b/widget/android/AndroidJavaWrappers.cpp
@@ -705,17 +705,17 @@ AndroidGeckoEvent::MakeTouchEvent(nsIWid
             break;
         }
         case AndroidMotionEvent::ACTION_HOVER_MOVE: {
             if (ToolTypes()[0] == AndroidMotionEvent::TOOL_TYPE_MOUSE) {
                 break;
             }
         }
         case AndroidMotionEvent::ACTION_MOVE: {
-            type = NS_TOUCH_MOVE;
+            type = eTouchMove;
             break;
         }
         case AndroidMotionEvent::ACTION_HOVER_EXIT: {
             if (ToolTypes()[0] == AndroidMotionEvent::TOOL_TYPE_MOUSE) {
                 break;
             }
         }
         case AndroidMotionEvent::ACTION_UP:
--- a/widget/uikit/nsWindow.mm
+++ b/widget/uikit/nsWindow.mm
@@ -234,17 +234,19 @@ private:
 }
 
 - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
 {
     ALOG("[ChildView[%p] touchesMoved", self);
     if (!mGeckoChild)
         return;
 
-    [self sendTouchEvent:NS_TOUCH_MOVE touches:[event allTouches] widget:mGeckoChild];
+    [self sendTouchEvent:eTouchMove
+                 touches:[event allTouches]
+                  widget:mGeckoChild];
 }
 
 - (void)setNeedsDisplayInRect:(CGRect)aRect
 {
     if ([self isUsingMainThreadOpenGL]) {
     // Draw without calling drawRect. This prevent us from
     // needing to access the normal window buffer surface unnecessarily, so we
     // waste less time synchronizing the two surfaces.