Bug 1259664 part.11 Rename WidgetWheelEvent::overflowDeltaX to WidgetWheelEvent::mOverflowDeltaX r=smaug
authorMasayuki Nakano <masayuki@d-toybox.com>
Fri, 01 Apr 2016 00:27:45 +0900
changeset 291207 c74f3d40659cda4e8d70ee012f8ed4fec4bfb779
parent 291206 32a1b458e8d8ed2209cbda81646ba855a541a70c
child 291208 1cbdd0ffeee45dc70d8bbaceedb8947bb54f8006
push id30130
push userkwierso@gmail.com
push dateFri, 01 Apr 2016 22:29:37 +0000
treeherdermozilla-central@b6ea6a3bb8a6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1259664
milestone48.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 1259664 part.11 Rename WidgetWheelEvent::overflowDeltaX to WidgetWheelEvent::mOverflowDeltaX r=smaug MozReview-Commit-ID: CVKbougU4uT
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
@@ -819,25 +819,25 @@ nsDOMWindowUtils::SendWheelEvent(float a
   if (widget->AsyncPanZoomEnabled()) {
     // Computing overflow deltas is not compatible with APZ, so if APZ is
     // enabled, we skip testing it.
     return NS_OK;
   }
 
   bool failedX = false;
   if ((aOptions & WHEEL_EVENT_EXPECTED_OVERFLOW_DELTA_X_ZERO) &&
-      wheelEvent.overflowDeltaX != 0) {
+      wheelEvent.mOverflowDeltaX != 0) {
     failedX = true;
   }
   if ((aOptions & WHEEL_EVENT_EXPECTED_OVERFLOW_DELTA_X_POSITIVE) &&
-      wheelEvent.overflowDeltaX <= 0) {
+      wheelEvent.mOverflowDeltaX <= 0) {
     failedX = true;
   }
   if ((aOptions & WHEEL_EVENT_EXPECTED_OVERFLOW_DELTA_X_NEGATIVE) &&
-      wheelEvent.overflowDeltaX >= 0) {
+      wheelEvent.mOverflowDeltaX >= 0) {
     failedX = true;
   }
   bool failedY = false;
   if ((aOptions & WHEEL_EVENT_EXPECTED_OVERFLOW_DELTA_Y_ZERO) &&
       wheelEvent.overflowDeltaY != 0) {
     failedY = true;
   }
   if ((aOptions & WHEEL_EVENT_EXPECTED_OVERFLOW_DELTA_Y_POSITIVE) &&
@@ -846,18 +846,18 @@ nsDOMWindowUtils::SendWheelEvent(float a
   }
   if ((aOptions & WHEEL_EVENT_EXPECTED_OVERFLOW_DELTA_Y_NEGATIVE) &&
       wheelEvent.overflowDeltaY >= 0) {
     failedY = true;
   }
 
 #ifdef DEBUG
   if (failedX) {
-    nsPrintfCString debugMsg("SendWheelEvent(): unexpected overflowDeltaX: %f",
-                             wheelEvent.overflowDeltaX);
+    nsPrintfCString debugMsg("SendWheelEvent(): unexpected mOverflowDeltaX: %f",
+                             wheelEvent.mOverflowDeltaX);
     NS_WARNING(debugMsg.get());
   }
   if (failedY) {
     nsPrintfCString debugMsg("SendWheelEvent(): unexpected overflowDeltaY: %f",
                              wheelEvent.overflowDeltaY);
     NS_WARNING(debugMsg.get());
   }
 #endif
--- a/dom/events/EventStateManager.cpp
+++ b/dom/events/EventStateManager.cpp
@@ -2633,51 +2633,51 @@ 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->overflowDeltaX = aEvent->overflowDeltaY = 0;
+    aEvent->mOverflowDeltaX = aEvent->overflowDeltaY = 0;
   } else if (isDeltaModePixel) {
-    aEvent->overflowDeltaX = overflow.x;
+    aEvent->mOverflowDeltaX = overflow.x;
     aEvent->overflowDeltaY = overflow.y;
   } else {
-    aEvent->overflowDeltaX =
+    aEvent->mOverflowDeltaX =
       static_cast<double>(overflow.x) / scrollAmountInDevPixels.width;
     aEvent->overflowDeltaY =
       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
   // values should stay zero.
   if (scrollFrameWeak.IsAlive()) {
     if (aEvent->mDeltaX &&
         overflowStyle.mHorizontal == NS_STYLE_OVERFLOW_HIDDEN &&
         !ComputeScrollTarget(scrollFrame, aEvent,
                              COMPUTE_SCROLLABLE_ANCESTOR_ALONG_X_AXIS)) {
-      aEvent->overflowDeltaX = aEvent->mDeltaX;
+      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;
     }
   }
 
-  NS_ASSERTION(aEvent->overflowDeltaX == 0 ||
-    (aEvent->overflowDeltaX > 0) == (aEvent->mDeltaX > 0),
-    "The sign of overflowDeltaX is different from the scroll direction");
+  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");
 
   WheelPrefs::GetInstance()->CancelApplyingUserPrefsFromOverflowDelta(aEvent);
 }
 
 void
@@ -3213,17 +3213,17 @@ EventStateManager::PostHandleEvent(nsPre
             aTargetFrame->PresContext()->PresShell()->GetRootScrollFrame();
           nsIScrollableFrame* rootScrollableFrame = nullptr;
           if (rootScrollFrame) {
             rootScrollableFrame = do_QueryFrame(rootScrollFrame);
           }
           if (!scrollTarget || scrollTarget == rootScrollableFrame) {
             wheelEvent->mViewPortIsOverscrolled = true;
           }
-          wheelEvent->overflowDeltaX = wheelEvent->mDeltaX;
+          wheelEvent->mOverflowDeltaX = wheelEvent->mDeltaX;
           wheelEvent->overflowDeltaY = wheelEvent->mDeltaY;
           WheelPrefs::GetInstance()->
             CancelApplyingUserPrefsFromOverflowDelta(wheelEvent);
           if (scrollTarget) {
             DoScrollText(scrollTarget, wheelEvent);
           } else {
             WheelTransaction::EndTransaction();
             ScrollbarsForWheel::Inactivate();
@@ -3284,17 +3284,17 @@ EventStateManager::PostHandleEvent(nsPre
             // The event was processed neither by APZ nor by us, so all of the
             // delta values must be overflown delta values.
             allDeltaOverflown = true;
           }
 
           if (!allDeltaOverflown) {
             break;
           }
-          wheelEvent->overflowDeltaX = wheelEvent->mDeltaX;
+          wheelEvent->mOverflowDeltaX = wheelEvent->mDeltaX;
           wheelEvent->overflowDeltaY = wheelEvent->mDeltaY;
           WheelPrefs::GetInstance()->
             CancelApplyingUserPrefsFromOverflowDelta(wheelEvent);
           wheelEvent->mViewPortIsOverscrolled = true;
           break;
       }
       *aStatus = nsEventStatus_eConsumeNoDefault;
     }
@@ -5669,17 +5669,17 @@ EventStateManager::WheelPrefs::CancelApp
 
   // XXX If the multiplier pref value is negative, the scroll direction was
   //     changed and caused to scroll different direction.  In such case,
   //     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->overflowDeltaX /= mMultiplierX[index];
+    aEvent->mOverflowDeltaX /= mMultiplierX[index];
   }
   if (mMultiplierY[index]) {
     aEvent->overflowDeltaY /= mMultiplierY[index];
   }
 }
 
 EventStateManager::WheelPrefs::Action
 EventStateManager::WheelPrefs::ComputeActionFor(WidgetWheelEvent* aEvent)
--- a/layout/generic/nsPluginFrame.cpp
+++ b/layout/generic/nsPluginFrame.cpp
@@ -1724,17 +1724,17 @@ nsPluginFrame::HandleWheelEventAsDefault
   if (NS_WARN_IF(!!aWheelEvent->mPluginEvent)) {
     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->overflowDeltaX = 0;
+  aWheelEvent->mOverflowDeltaX = 0;
   aWheelEvent->overflowDeltaY = 0;
   // Consume the event explicitly.
   aWheelEvent->PreventDefault();
 }
 
 bool
 nsPluginFrame::WantsToHandleWheelEventAsDefaultAction() const
 {
--- a/widget/MouseEvents.h
+++ b/widget/MouseEvents.h
@@ -453,17 +453,17 @@ private:
     , mDeltaZ(0.0)
     , mDeltaMode(nsIDOMWheelEvent::DOM_DELTA_PIXEL)
     , mCustomizedByUserPrefs(false)
     , mIsMomentum(false)
     , mIsNoLineOrPageDelta(false)
     , mLineOrPageDeltaX(0)
     , mLineOrPageDeltaY(0)
     , mScrollType(SCROLL_DEFAULT)
-    , overflowDeltaX(0.0)
+    , mOverflowDeltaX(0.0)
     , overflowDeltaY(0.0)
     , mViewPortIsOverscrolled(false)
     , mCanTriggerSwipe(false)
     , mAllowToOverrideSystemScrollSpeed(false)
   {
   }
 
 public:
@@ -477,17 +477,17 @@ public:
     , mDeltaMode(nsIDOMWheelEvent::DOM_DELTA_PIXEL)
     , mCustomizedByUserPrefs(false)
     , mMayHaveMomentum(false)
     , mIsMomentum(false)
     , mIsNoLineOrPageDelta(false)
     , mLineOrPageDeltaX(0)
     , mLineOrPageDeltaY(0)
     , mScrollType(SCROLL_DEFAULT)
-    , overflowDeltaX(0.0)
+    , mOverflowDeltaX(0.0)
     , overflowDeltaY(0.0)
     , mViewPortIsOverscrolled(false)
     , mCanTriggerSwipe(false)
     , mAllowToOverrideSystemScrollSpeed(true)
   {
   }
 
   virtual WidgetEvent* Duplicate() const override
@@ -503,17 +503,17 @@ public:
 
   // On OS X, scroll gestures that start at the edge of the scrollable range
   // can result in a swipe gesture. For the first wheel event of such a
   // gesture, call TriggersSwipe() after the event has been processed
   // in order to find out whether a swipe should be started.
   bool TriggersSwipe() const
   {
     return mCanTriggerSwipe && mViewPortIsOverscrolled &&
-           this->overflowDeltaX != 0.0;
+           this->mOverflowDeltaX != 0.0;
   }
 
   // NOTE: mDeltaX, mDeltaY and mDeltaZ may be customized by
   //       mousewheel.*.delta_multiplier_* prefs which are applied by
   //       EventStateManager.  So, after widget dispatches this event,
   //       these delta values may have different values than before.
   double mDeltaX;
   double mDeltaY;
@@ -579,21 +579,21 @@ 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, overflowDeltaX and overflowDeltaY indicate unused original
+  //       However, mOverflowDeltaX and overflowDeltaY 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 overflowDeltaX;
+  double mOverflowDeltaX;
   double overflowDeltaY;
 
   // 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;
 
@@ -616,17 +616,17 @@ public:
     mDeltaMode = aEvent.mDeltaMode;
     mCustomizedByUserPrefs = aEvent.mCustomizedByUserPrefs;
     mMayHaveMomentum = aEvent.mMayHaveMomentum;
     mIsMomentum = aEvent.mIsMomentum;
     mIsNoLineOrPageDelta = aEvent.mIsNoLineOrPageDelta;
     mLineOrPageDeltaX = aEvent.mLineOrPageDeltaX;
     mLineOrPageDeltaY = aEvent.mLineOrPageDeltaY;
     mScrollType = aEvent.mScrollType;
-    overflowDeltaX = aEvent.overflowDeltaX;
+    mOverflowDeltaX = aEvent.mOverflowDeltaX;
     overflowDeltaY = aEvent.overflowDeltaY;
     mViewPortIsOverscrolled = aEvent.mViewPortIsOverscrolled;
     mCanTriggerSwipe = aEvent.mCanTriggerSwipe;
     mAllowToOverrideSystemScrollSpeed =
       aEvent.mAllowToOverrideSystemScrollSpeed;
   }
 
   // System scroll speed settings may be too slow at using Gecko.  In such
--- a/widget/nsGUIEventIPC.h
+++ b/widget/nsGUIEventIPC.h
@@ -166,17 +166,17 @@ struct ParamTraits<mozilla::WidgetWheelE
     WriteParam(aMsg, aParam.mDeltaMode);
     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.overflowDeltaX);
+    WriteParam(aMsg, aParam.mOverflowDeltaX);
     WriteParam(aMsg, aParam.overflowDeltaY);
     WriteParam(aMsg, aParam.mViewPortIsOverscrolled);
     WriteParam(aMsg, aParam.mCanTriggerSwipe);
     WriteParam(aMsg, aParam.mAllowToOverrideSystemScrollSpeed);
   }
 
   static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
   {
@@ -190,17 +190,17 @@ struct ParamTraits<mozilla::WidgetWheelE
       ReadParam(aMsg, aIter, &aResult->mDeltaMode) &&
       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->overflowDeltaX) &&
+      ReadParam(aMsg, aIter, &aResult->mOverflowDeltaX) &&
       ReadParam(aMsg, aIter, &aResult->overflowDeltaY) &&
       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
@@ -569,17 +569,17 @@ nsWinGesture::PanDeltaToPixelScroll(Widg
   aWheelEvent.mLineOrPageDeltaX = aWheelEvent.mLineOrPageDeltaY = 0;
 
   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.overflowDeltaX = 0.0;
+  aWheelEvent.mOverflowDeltaX = 0.0;
   aWheelEvent.overflowDeltaY = 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;
   }
--- a/widget/windows/nsWindow.cpp
+++ b/widget/windows/nsWindow.cpp
@@ -6521,19 +6521,20 @@ bool nsWindow::OnGesture(WPARAM wParam, 
 
     if (mGesture.PanDeltaToPixelScroll(wheelEvent)) {
       mozilla::Telemetry::Accumulate(mozilla::Telemetry::SCROLL_INPUT_METHODS,
           (uint32_t) ScrollInputMethod::MainThreadTouch);
       DispatchEvent(&wheelEvent, status);
     }
 
     if (mDisplayPanFeedback) {
-      mGesture.UpdatePanFeedbackX(mWnd,
-                                  DeprecatedAbs(RoundDown(wheelEvent.overflowDeltaX)),
-                                  endFeedback);
+      mGesture.UpdatePanFeedbackX(
+                 mWnd,
+                 DeprecatedAbs(RoundDown(wheelEvent.mOverflowDeltaX)),
+                 endFeedback);
       mGesture.UpdatePanFeedbackY(mWnd,
                                   DeprecatedAbs(RoundDown(wheelEvent.overflowDeltaY)),
                                   endFeedback);
       mGesture.PanFeedbackFinalize(mWnd, endFeedback);
     }
 
     mGesture.CloseGestureInfoHandle((HGESTUREINFO)lParam);