Bug 1259664 part.12 Rename WidgetWheelEvent::overflowDeltaY to WidgetWheelEvent::mOverflowDeltaY r?smaug draft
authorMasayuki Nakano <masayuki@d-toybox.com>
Fri, 01 Apr 2016 00:36:55 +0900
changeset 346518 1521457b197a0c3a5a25f735abb717d9d43e18cd
parent 346517 450c6289b4cdc335ee95c3ee411c10811b3b4c18
child 346519 ed951fc1a75081ea90c3f4b63e09fd221130700f
push id14400
push usermasayuki@d-toybox.com
push dateFri, 01 Apr 2016 07:07:56 +0000
reviewerssmaug
bugs1259664
milestone48.0a1
Bug 1259664 part.12 Rename WidgetWheelEvent::overflowDeltaY to WidgetWheelEvent::mOverflowDeltaY r?smaug MozReview-Commit-ID: GGvQZlvc4sl
dom/base/nsDOMWindowUtils.cpp
dom/events/EventStateManager.cpp
layout/generic/nsPluginFrame.cpp
widget/MouseEvents.h
widget/nsGUIEventIPC.h
widget/windows/nsWinGesture.cpp
widget/windows/nsWindow.cpp
--- a/dom/base/nsDOMWindowUtils.cpp
+++ b/dom/base/nsDOMWindowUtils.cpp
@@ -832,37 +832,37 @@ nsDOMWindowUtils::SendWheelEvent(float a
     failedX = true;
   }
   if ((aOptions & WHEEL_EVENT_EXPECTED_OVERFLOW_DELTA_X_NEGATIVE) &&
       wheelEvent.mOverflowDeltaX >= 0) {
     failedX = true;
   }
   bool failedY = false;
   if ((aOptions & WHEEL_EVENT_EXPECTED_OVERFLOW_DELTA_Y_ZERO) &&
-      wheelEvent.overflowDeltaY != 0) {
+      wheelEvent.mOverflowDeltaY != 0) {
     failedY = true;
   }
   if ((aOptions & WHEEL_EVENT_EXPECTED_OVERFLOW_DELTA_Y_POSITIVE) &&
-      wheelEvent.overflowDeltaY <= 0) {
+      wheelEvent.mOverflowDeltaY <= 0) {
     failedY = true;
   }
   if ((aOptions & WHEEL_EVENT_EXPECTED_OVERFLOW_DELTA_Y_NEGATIVE) &&
-      wheelEvent.overflowDeltaY >= 0) {
+      wheelEvent.mOverflowDeltaY >= 0) {
     failedY = true;
   }
 
 #ifdef DEBUG
   if (failedX) {
     nsPrintfCString debugMsg("SendWheelEvent(): unexpected mOverflowDeltaX: %f",
                              wheelEvent.mOverflowDeltaX);
     NS_WARNING(debugMsg.get());
   }
   if (failedY) {
-    nsPrintfCString debugMsg("SendWheelEvent(): unexpected overflowDeltaY: %f",
-                             wheelEvent.overflowDeltaY);
+    nsPrintfCString debugMsg("SendWheelEvent(): unexpected mOverflowDeltaY: %f",
+                             wheelEvent.mOverflowDeltaY);
     NS_WARNING(debugMsg.get());
   }
 #endif
 
   return (!failedX && !failedY) ? NS_OK : NS_ERROR_FAILURE;
 }
 
 NS_IMETHODIMP
--- a/dom/events/EventStateManager.cpp
+++ b/dom/events/EventStateManager.cpp
@@ -2633,24 +2633,24 @@ EventStateManager::DoScrollText(nsIScrol
   aScrollableFrame->ScrollBy(actualDevPixelScrollAmount,
                              nsIScrollableFrame::DEVICE_PIXELS,
                              mode, &overflow, origin, momentum, snapMode);
 
   if (!scrollFrameWeak.IsAlive()) {
     // If the scroll causes changing the layout, we can think that the event
     // has been completely consumed by the content.  Then, users probably don't
     // want additional action.
-    aEvent->mOverflowDeltaX = aEvent->overflowDeltaY = 0;
+    aEvent->mOverflowDeltaX = aEvent->mOverflowDeltaY = 0;
   } else if (isDeltaModePixel) {
     aEvent->mOverflowDeltaX = overflow.x;
-    aEvent->overflowDeltaY = overflow.y;
+    aEvent->mOverflowDeltaY = overflow.y;
   } else {
     aEvent->mOverflowDeltaX =
       static_cast<double>(overflow.x) / scrollAmountInDevPixels.width;
-    aEvent->overflowDeltaY =
+    aEvent->mOverflowDeltaY =
       static_cast<double>(overflow.y) / scrollAmountInDevPixels.height;
   }
 
   // If CSS overflow properties caused not to scroll, the overflowDelta* values
   // should be same as delta* values since they may be used as gesture event by
   // widget.  However, if there is another scrollable element in the ancestor
   // along the axis, probably users don't want the operation to cause
   // additional action such as moving history.  In such case, overflowDelta
@@ -2661,26 +2661,26 @@ EventStateManager::DoScrollText(nsIScrol
         !ComputeScrollTarget(scrollFrame, aEvent,
                              COMPUTE_SCROLLABLE_ANCESTOR_ALONG_X_AXIS)) {
       aEvent->mOverflowDeltaX = aEvent->mDeltaX;
     }
     if (aEvent->mDeltaY &&
         overflowStyle.mVertical == NS_STYLE_OVERFLOW_HIDDEN &&
         !ComputeScrollTarget(scrollFrame, aEvent,
                              COMPUTE_SCROLLABLE_ANCESTOR_ALONG_Y_AXIS)) {
-      aEvent->overflowDeltaY = aEvent->mDeltaY;
+      aEvent->mOverflowDeltaY = aEvent->mDeltaY;
     }
   }
 
   NS_ASSERTION(aEvent->mOverflowDeltaX == 0 ||
     (aEvent->mOverflowDeltaX > 0) == (aEvent->mDeltaX > 0),
     "The sign of mOverflowDeltaX is different from the scroll direction");
-  NS_ASSERTION(aEvent->overflowDeltaY == 0 ||
-    (aEvent->overflowDeltaY > 0) == (aEvent->mDeltaY > 0),
-    "The sign of overflowDeltaY is different from the scroll direction");
+  NS_ASSERTION(aEvent->mOverflowDeltaY == 0 ||
+    (aEvent->mOverflowDeltaY > 0) == (aEvent->mDeltaY > 0),
+    "The sign of mOverflowDeltaY is different from the scroll direction");
 
   WheelPrefs::GetInstance()->CancelApplyingUserPrefsFromOverflowDelta(aEvent);
 }
 
 void
 EventStateManager::DecideGestureEvent(WidgetGestureNotifyEvent* aEvent,
                                       nsIFrame* targetFrame)
 {
@@ -3214,17 +3214,17 @@ EventStateManager::PostHandleEvent(nsPre
           nsIScrollableFrame* rootScrollableFrame = nullptr;
           if (rootScrollFrame) {
             rootScrollableFrame = do_QueryFrame(rootScrollFrame);
           }
           if (!scrollTarget || scrollTarget == rootScrollableFrame) {
             wheelEvent->mViewPortIsOverscrolled = true;
           }
           wheelEvent->mOverflowDeltaX = wheelEvent->mDeltaX;
-          wheelEvent->overflowDeltaY = wheelEvent->mDeltaY;
+          wheelEvent->mOverflowDeltaY = wheelEvent->mDeltaY;
           WheelPrefs::GetInstance()->
             CancelApplyingUserPrefsFromOverflowDelta(wheelEvent);
           if (scrollTarget) {
             DoScrollText(scrollTarget, wheelEvent);
           } else {
             WheelTransaction::EndTransaction();
             ScrollbarsForWheel::Inactivate();
           }
@@ -3285,17 +3285,17 @@ EventStateManager::PostHandleEvent(nsPre
             // delta values must be overflown delta values.
             allDeltaOverflown = true;
           }
 
           if (!allDeltaOverflown) {
             break;
           }
           wheelEvent->mOverflowDeltaX = wheelEvent->mDeltaX;
-          wheelEvent->overflowDeltaY = wheelEvent->mDeltaY;
+          wheelEvent->mOverflowDeltaY = wheelEvent->mDeltaY;
           WheelPrefs::GetInstance()->
             CancelApplyingUserPrefsFromOverflowDelta(wheelEvent);
           wheelEvent->mViewPortIsOverscrolled = true;
           break;
       }
       *aStatus = nsEventStatus_eConsumeNoDefault;
     }
     break;
@@ -5672,17 +5672,17 @@ EventStateManager::WheelPrefs::CancelApp
   //     this method reverts the sign of overflowDelta.  Does it make widget
   //     happy?  Although, widget can know the pref applied delta values by
   //     referrencing the deltaX and deltaY of the event.
 
   if (mMultiplierX[index]) {
     aEvent->mOverflowDeltaX /= mMultiplierX[index];
   }
   if (mMultiplierY[index]) {
-    aEvent->overflowDeltaY /= mMultiplierY[index];
+    aEvent->mOverflowDeltaY /= mMultiplierY[index];
   }
 }
 
 EventStateManager::WheelPrefs::Action
 EventStateManager::WheelPrefs::ComputeActionFor(WidgetWheelEvent* aEvent)
 {
   Index index = GetIndexFor(aEvent);
   Init(index);
--- a/layout/generic/nsPluginFrame.cpp
+++ b/layout/generic/nsPluginFrame.cpp
@@ -1725,17 +1725,17 @@ nsPluginFrame::HandleWheelEventAsDefault
     return;
   }
 
   mInstanceOwner->ProcessEvent(*aWheelEvent);
   // We need to assume that the event is always consumed/handled by the
   // plugin.  There is no way to know if it's actually consumed/handled.
   aWheelEvent->mViewPortIsOverscrolled = false;
   aWheelEvent->mOverflowDeltaX = 0;
-  aWheelEvent->overflowDeltaY = 0;
+  aWheelEvent->mOverflowDeltaY = 0;
   // Consume the event explicitly.
   aWheelEvent->PreventDefault();
 }
 
 bool
 nsPluginFrame::WantsToHandleWheelEventAsDefaultAction() const
 {
 #ifdef XP_WIN
--- a/widget/MouseEvents.h
+++ b/widget/MouseEvents.h
@@ -454,17 +454,17 @@ private:
     , mDeltaMode(nsIDOMWheelEvent::DOM_DELTA_PIXEL)
     , mCustomizedByUserPrefs(false)
     , mIsMomentum(false)
     , mIsNoLineOrPageDelta(false)
     , mLineOrPageDeltaX(0)
     , mLineOrPageDeltaY(0)
     , mScrollType(SCROLL_DEFAULT)
     , mOverflowDeltaX(0.0)
-    , overflowDeltaY(0.0)
+    , mOverflowDeltaY(0.0)
     , mViewPortIsOverscrolled(false)
     , mCanTriggerSwipe(false)
     , mAllowToOverrideSystemScrollSpeed(false)
   {
   }
 
 public:
   virtual WidgetWheelEvent* AsWheelEvent() override { return this; }
@@ -478,17 +478,17 @@ public:
     , mCustomizedByUserPrefs(false)
     , mMayHaveMomentum(false)
     , mIsMomentum(false)
     , mIsNoLineOrPageDelta(false)
     , mLineOrPageDeltaX(0)
     , mLineOrPageDeltaY(0)
     , mScrollType(SCROLL_DEFAULT)
     , mOverflowDeltaX(0.0)
-    , overflowDeltaY(0.0)
+    , mOverflowDeltaY(0.0)
     , mViewPortIsOverscrolled(false)
     , mCanTriggerSwipe(false)
     , mAllowToOverrideSystemScrollSpeed(true)
   {
   }
 
   virtual WidgetEvent* Duplicate() const override
   {
@@ -579,22 +579,22 @@ public:
   };
   ScrollType mScrollType;
 
   // overflowed delta values for scroll, these values are set by
   // nsEventStateManger.  If the default action of the wheel event isn't scroll,
   // these values always zero.  Otherwise, remaning delta values which are
   // not used by scroll are set.
   // NOTE: mDeltaX, mDeltaY and mDeltaZ may be modified by EventStateManager.
-  //       However, mOverflowDeltaX and overflowDeltaY indicate unused original
+  //       However, mOverflowDeltaX and mOverflowDeltaY indicate unused original
   //       delta values which are not applied the delta_multiplier prefs.
   //       So, if widget wanted to know the actual direction to be scrolled,
   //       it would need to check the mDeltaX and mDeltaY.
   double mOverflowDeltaX;
-  double overflowDeltaY;
+  double mOverflowDeltaY;
 
   // Whether or not the parent of the currently overscrolled frame is the
   // ViewPort. This is false in situations when an element on the page is being
   // overscrolled (such as a text field), but true when the 'page' is being
   // overscrolled.
   bool mViewPortIsOverscrolled;
 
   // The wheel event can trigger a swipe to start if it's overscrolling the
@@ -617,17 +617,17 @@ public:
     mCustomizedByUserPrefs = aEvent.mCustomizedByUserPrefs;
     mMayHaveMomentum = aEvent.mMayHaveMomentum;
     mIsMomentum = aEvent.mIsMomentum;
     mIsNoLineOrPageDelta = aEvent.mIsNoLineOrPageDelta;
     mLineOrPageDeltaX = aEvent.mLineOrPageDeltaX;
     mLineOrPageDeltaY = aEvent.mLineOrPageDeltaY;
     mScrollType = aEvent.mScrollType;
     mOverflowDeltaX = aEvent.mOverflowDeltaX;
-    overflowDeltaY = aEvent.overflowDeltaY;
+    mOverflowDeltaY = aEvent.mOverflowDeltaY;
     mViewPortIsOverscrolled = aEvent.mViewPortIsOverscrolled;
     mCanTriggerSwipe = aEvent.mCanTriggerSwipe;
     mAllowToOverrideSystemScrollSpeed =
       aEvent.mAllowToOverrideSystemScrollSpeed;
   }
 
   // System scroll speed settings may be too slow at using Gecko.  In such
   // case, we should override the scroll speed computed with system settings.
--- a/widget/nsGUIEventIPC.h
+++ b/widget/nsGUIEventIPC.h
@@ -167,17 +167,17 @@ struct ParamTraits<mozilla::WidgetWheelE
     WriteParam(aMsg, aParam.mCustomizedByUserPrefs);
     WriteParam(aMsg, aParam.mMayHaveMomentum);
     WriteParam(aMsg, aParam.mIsMomentum);
     WriteParam(aMsg, aParam.mIsNoLineOrPageDelta);
     WriteParam(aMsg, aParam.mLineOrPageDeltaX);
     WriteParam(aMsg, aParam.mLineOrPageDeltaY);
     WriteParam(aMsg, static_cast<int32_t>(aParam.mScrollType));
     WriteParam(aMsg, aParam.mOverflowDeltaX);
-    WriteParam(aMsg, aParam.overflowDeltaY);
+    WriteParam(aMsg, aParam.mOverflowDeltaY);
     WriteParam(aMsg, aParam.mViewPortIsOverscrolled);
     WriteParam(aMsg, aParam.mCanTriggerSwipe);
     WriteParam(aMsg, aParam.mAllowToOverrideSystemScrollSpeed);
   }
 
   static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
   {
     int32_t scrollType = 0;
@@ -191,17 +191,17 @@ struct ParamTraits<mozilla::WidgetWheelE
       ReadParam(aMsg, aIter, &aResult->mCustomizedByUserPrefs) &&
       ReadParam(aMsg, aIter, &aResult->mMayHaveMomentum) &&
       ReadParam(aMsg, aIter, &aResult->mIsMomentum) &&
       ReadParam(aMsg, aIter, &aResult->mIsNoLineOrPageDelta) &&
       ReadParam(aMsg, aIter, &aResult->mLineOrPageDeltaX) &&
       ReadParam(aMsg, aIter, &aResult->mLineOrPageDeltaY) &&
       ReadParam(aMsg, aIter, &scrollType) &&
       ReadParam(aMsg, aIter, &aResult->mOverflowDeltaX) &&
-      ReadParam(aMsg, aIter, &aResult->overflowDeltaY) &&
+      ReadParam(aMsg, aIter, &aResult->mOverflowDeltaY) &&
       ReadParam(aMsg, aIter, &aResult->mViewPortIsOverscrolled) &&
       ReadParam(aMsg, aIter, &aResult->mCanTriggerSwipe) &&
       ReadParam(aMsg, aIter, &aResult->mAllowToOverrideSystemScrollSpeed);
     aResult->mScrollType =
       static_cast<mozilla::WidgetWheelEvent::ScrollType>(scrollType);
     return rv;
   }
 };
--- a/widget/windows/nsWinGesture.cpp
+++ b/widget/windows/nsWinGesture.cpp
@@ -570,17 +570,17 @@ nsWinGesture::PanDeltaToPixelScroll(Widg
 
   aWheelEvent.refPoint.x = mPanRefPoint.x;
   aWheelEvent.refPoint.y = mPanRefPoint.y;
   aWheelEvent.mDeltaMode = nsIDOMWheelEvent::DOM_DELTA_PIXEL;
   aWheelEvent.mScrollType = WidgetWheelEvent::SCROLL_SYNCHRONOUSLY;
   aWheelEvent.mIsNoLineOrPageDelta = true;
 
   aWheelEvent.mOverflowDeltaX = 0.0;
-  aWheelEvent.overflowDeltaY = 0.0;
+  aWheelEvent.mOverflowDeltaY = 0.0;
 
   // Don't scroll the view if we are currently at a bounds, or, if we are
   // panning back from a max feedback position. This keeps the original drag point
   // constant.
   if (!mXAxisFeedback) {
     aWheelEvent.mDeltaX = mPixelScrollDelta.x;
   }
   if (!mYAxisFeedback) {
--- a/widget/windows/nsWindow.cpp
+++ b/widget/windows/nsWindow.cpp
@@ -6525,19 +6525,20 @@ bool nsWindow::OnGesture(WPARAM wParam, 
       DispatchEvent(&wheelEvent, status);
     }
 
     if (mDisplayPanFeedback) {
       mGesture.UpdatePanFeedbackX(
                  mWnd,
                  DeprecatedAbs(RoundDown(wheelEvent.mOverflowDeltaX)),
                  endFeedback);
-      mGesture.UpdatePanFeedbackY(mWnd,
-                                  DeprecatedAbs(RoundDown(wheelEvent.overflowDeltaY)),
-                                  endFeedback);
+      mGesture.UpdatePanFeedbackY(
+                 mWnd,
+                 DeprecatedAbs(RoundDown(wheelEvent.mOverflowDeltaY)),
+                 endFeedback);
       mGesture.PanFeedbackFinalize(mWnd, endFeedback);
     }
 
     mGesture.CloseGestureInfoHandle((HGESTUREINFO)lParam);
 
     return true;
   }