Bug 895274 part.185 Rename NS_WHEEL_START to eWheelOperationStart r=smaug
authorMasayuki Nakano <masayuki@d-toybox.com>
Fri, 11 Sep 2015 01:59:55 +0900
changeset 296139 dd0a5b24d93ccd9dcec8cea76127a564ff9eaf02
parent 296138 e777173540407236c2b24357c854920757748f74
child 296140 0f99a111de0a20e77d6de0a688860f0107f4e755
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.185 Rename NS_WHEEL_START to eWheelOperationStart r=smaug
dom/events/EventStateManager.cpp
dom/events/WheelHandlingHelper.cpp
dom/events/WheelHandlingHelper.h
layout/base/AccessibleCaretEventHub.cpp
layout/base/TouchCaret.cpp
layout/base/gtest/TestAccessibleCaretEventHub.cpp
widget/EventMessageList.h
widget/cocoa/nsChildView.mm
--- a/dom/events/EventStateManager.cpp
+++ b/dom/events/EventStateManager.cpp
@@ -707,17 +707,17 @@ EventStateManager::PreHandleEvent(nsPres
       //       compositionend if there is no composing string.
       WidgetKeyboardEvent* keyEvent = aEvent->AsKeyboardEvent();
       nsRefPtr<TextComposition> composition =
         IMEStateManager::GetTextCompositionFor(keyEvent);
       keyEvent->mIsComposing = !!composition;
     }
     break;
   case eWheel:
-  case NS_WHEEL_START:
+  case eWheelOperationStart:
   case NS_WHEEL_STOP:
     {
       NS_ASSERTION(aEvent->mFlags.mIsTrusted,
                    "Untrusted wheel event shouldn't be here");
 
       nsIContent* content = GetFocusedContent();
       if (content) {
         mCurrentTargetContent = content;
@@ -3017,17 +3017,17 @@ EventStateManager::PostHandleEvent(nsPre
         ComputeScrollTarget(aTargetFrame, wheelEvent,
                             COMPUTE_DEFAULT_ACTION_TARGET);
       if (scrollTarget) {
         scrollTarget->ScrollSnap();
       }
     }
     break;
   case eWheel:
-  case NS_WHEEL_START:
+  case eWheelOperationStart:
     {
       MOZ_ASSERT(aEvent->mFlags.mIsTrusted);
 
       if (*aStatus == nsEventStatus_eConsumeNoDefault) {
         ScrollbarsForWheel::Inactivate();
         break;
       }
 
--- a/dom/events/WheelHandlingHelper.cpp
+++ b/dom/events/WheelHandlingHelper.cpp
@@ -410,17 +410,17 @@ nsWeakFrame ScrollbarsForWheel::sActivat
 bool ScrollbarsForWheel::sHadWheelStart = false;
 bool ScrollbarsForWheel::sOwnWheelTransaction = false;
 
 /* static */ void
 ScrollbarsForWheel::PrepareToScrollText(EventStateManager* aESM,
                                         nsIFrame* aTargetFrame,
                                         WidgetWheelEvent* aEvent)
 {
-  if (aEvent->mMessage == NS_WHEEL_START) {
+  if (aEvent->mMessage == eWheelOperationStart) {
     WheelTransaction::OwnScrollbars(false);
     if (!IsActive()) {
       TemporarilyActivateAllPossibleScrollTargets(aESM, aTargetFrame, aEvent);
       sHadWheelStart = true;
     }
   } else {
     DeactivateAllTemporarilyActivatedScrollTargets();
   }
--- a/dom/events/WheelHandlingHelper.h
+++ b/dom/events/WheelHandlingHelper.h
@@ -90,17 +90,17 @@ protected:
   static const DeltaValues directions[kNumberOfTargets];
   static nsWeakFrame sActiveOwner;
   static nsWeakFrame sActivatedScrollTargets[kNumberOfTargets];
   static bool sHadWheelStart;
   static bool sOwnWheelTransaction;
 
 
   /**
-   * These two methods are called upon NS_WHEEL_START/NS_WHEEL_STOP events
+   * These two methods are called upon eWheelOperationStart/NS_WHEEL_STOP events
    * to show/hide the right scrollbars.
    */
   static void TemporarilyActivateAllPossibleScrollTargets(
                 EventStateManager* aESM,
                 nsIFrame* aTargetFrame,
                 WidgetWheelEvent* aEvent);
   static void DeactivateAllTemporarilyActivatedScrollTargets();
 };
--- a/layout/base/AccessibleCaretEventHub.cpp
+++ b/layout/base/AccessibleCaretEventHub.cpp
@@ -535,18 +535,18 @@ AccessibleCaretEventHub::HandleWheelEven
 {
   switch (aEvent->mMessage) {
   case eWheel:
     AC_LOGV("eWheel, isMomentum %d, state: %s", aEvent->isMomentum,
             mState->Name());
     mState->OnScrolling(this);
     break;
 
-  case NS_WHEEL_START:
-    AC_LOGV("NS_WHEEL_START, state: %s", mState->Name());
+  case eWheelOperationStart:
+    AC_LOGV("eWheelOperationStart, state: %s", mState->Name());
     mState->OnScrollStart(this);
     break;
 
   case NS_WHEEL_STOP:
     AC_LOGV("NS_WHEEL_STOP, state: %s", mState->Name());
     mState->OnScrollEnd(this);
     break;
 
--- a/layout/base/TouchCaret.cpp
+++ b/layout/base/TouchCaret.cpp
@@ -782,17 +782,17 @@ TouchCaret::HandleEvent(WidgetEvent* aEv
       mTouchesId.Clear();
       SetState(TOUCHCARET_NONE);
       LaunchExpirationTimer();
       break;
     case eKeyUp:
     case eKeyDown:
     case eKeyPress:
     case eWheel:
-    case NS_WHEEL_START:
+    case eWheelOperationStart:
     case NS_WHEEL_STOP:
       // Disable touch caret while key/wheel event is received.
       TOUCHCARET_LOG("Receive key/wheel event %d", aEvent->mMessage);
       SetVisibility(false);
       break;
     case eMouseLongTap:
       if (mState == TOUCHCARET_TOUCHDRAG_ACTIVE) {
         // Disable long tap event from APZ while dragging the touch caret.
--- a/layout/base/gtest/TestAccessibleCaretEventHub.cpp
+++ b/layout/base/gtest/TestAccessibleCaretEventHub.cpp
@@ -727,17 +727,17 @@ TEST_F(AccessibleCaretEventHubTester, Te
     EXPECT_CALL(*mHub->GetMockAccessibleCaretManager(), OnScrollStart());
 
     EXPECT_CALL(check, Call("2"));
     EXPECT_CALL(*mHub->GetMockAccessibleCaretManager(), OnScrollEnd());
   }
 
   check.Call("1");
 
-  HandleEventAndCheckState(CreateWheelEvent(NS_WHEEL_START),
+  HandleEventAndCheckState(CreateWheelEvent(eWheelOperationStart),
                            MockAccessibleCaretEventHub::ScrollState(),
                            nsEventStatus_eIgnore);
 
   HandleEventAndCheckState(CreateWheelEvent(eWheel),
                            MockAccessibleCaretEventHub::ScrollState(),
                            nsEventStatus_eIgnore);
 
   mHub->ScrollPositionChanged();
--- a/widget/EventMessageList.h
+++ b/widget/EventMessageList.h
@@ -380,17 +380,20 @@ NS_EVENT_MESSAGE(NS_TOUCH_CANCEL,       
 // Pointerlock DOM API
 NS_EVENT_MESSAGE(NS_POINTERLOCK_START,   5300)
 NS_EVENT_MESSAGE(NS_POINTERLOCKCHANGE,   NS_POINTERLOCK_START)
 NS_EVENT_MESSAGE(NS_POINTERLOCKERROR,    NS_POINTERLOCK_START + 1)
 
 NS_EVENT_MESSAGE(eWheelEventFirst,       5400)
 // eWheel is the event message of DOM wheel event.
 NS_EVENT_MESSAGE(eWheel,                 eWheelEventFirst)
-NS_EVENT_MESSAGE(NS_WHEEL_START,         eWheelEventFirst + 1)
+// eWheelOperationStart may be dispatched when user starts to operate mouse
+// wheel.  This won't be fired on some platforms which don't have corresponding
+// native event.
+NS_EVENT_MESSAGE(eWheelOperationStart,   eWheelEventFirst + 1)
 NS_EVENT_MESSAGE(NS_WHEEL_STOP,          eWheelEventFirst + 2)
 
 //System time is changed
 NS_EVENT_MESSAGE(NS_MOZ_TIME_CHANGE_EVENT, 5500)
 
 // Network packet events.
 NS_EVENT_MESSAGE(NS_NETWORK_EVENT_START,    5600)
 NS_EVENT_MESSAGE(NS_NETWORK_UPLOAD_EVENT,   NS_NETWORK_EVENT_START + 1)
--- a/widget/cocoa/nsChildView.mm
+++ b/widget/cocoa/nsChildView.mm
@@ -4821,17 +4821,17 @@ static int32_t RoundUp(double aDouble)
   return aDouble < 0 ? static_cast<int32_t>(floor(aDouble)) :
                        static_cast<int32_t>(ceil(aDouble));
 }
 
 - (void)sendWheelStartOrStop:(EventMessage)msg forEvent:(NSEvent *)theEvent
 {
   WidgetWheelEvent wheelEvent(true, msg, mGeckoChild);
   [self convertCocoaMouseWheelEvent:theEvent toGeckoEvent:&wheelEvent];
-  mExpectingWheelStop = (msg == NS_WHEEL_START);
+  mExpectingWheelStop = (msg == eWheelOperationStart);
   mGeckoChild->DispatchAPZAwareEvent(wheelEvent.AsInputEvent());
 }
 
 - (void)sendWheelCondition:(BOOL)condition
                      first:(EventMessage)first
                     second:(EventMessage)second
                   forEvent:(NSEvent *)theEvent
 {
@@ -4891,21 +4891,28 @@ PanGestureTypeForEvent(NSEvent* aEvent)
     return;
   }
 
   if (!mGeckoChild) {
     return;
   }
 
   NSEventPhase phase = nsCocoaUtils::EventPhase(theEvent);
-  // Fire NS_WHEEL_START/STOP events when 2 fingers touch/release the touchpad.
+  // Fire eWheelOperationStart/STOP events when 2 fingers touch/release the
+  // touchpad.
   if (phase & NSEventPhaseMayBegin) {
-    [self sendWheelCondition:YES first:NS_WHEEL_STOP second:NS_WHEEL_START forEvent:theEvent];
+    [self sendWheelCondition:YES
+                       first:NS_WHEEL_STOP
+                      second:eWheelOperationStart
+                    forEvent:theEvent];
   } else if (phase & (NSEventPhaseEnded | NSEventPhaseCancelled)) {
-    [self sendWheelCondition:NO first:NS_WHEEL_START second:NS_WHEEL_STOP forEvent:theEvent];
+    [self sendWheelCondition:NO
+                       first:eWheelOperationStart
+                      second:NS_WHEEL_STOP
+                    forEvent:theEvent];
   }
 
   NSPoint locationInWindow = nsCocoaUtils::EventLocationForWindow(theEvent, [self window]);
 
   ScreenPoint position = ScreenPoint::FromUntyped(
     [self convertWindowCoordinates:locationInWindow]);
 
   bool usePreciseDeltas = nsCocoaUtils::HasPreciseScrollingDeltas(theEvent) &&