Bug 1259664 part.3 Rename WidgetWheelEvent::deltaZ to WidgetWheelEvent::mDeltaZ r?smaug draft
authorMasayuki Nakano <masayuki@d-toybox.com>
Thu, 31 Mar 2016 18:18:34 +0900
changeset 346509 d89f88d4456ee0bf6a463e3b020af75e7bbfae5d
parent 346508 57eaf51bef91576220b17b635d0a08c3352b0b1e
child 346510 93483f38b2fedd932853dd23bf4dfe6fa40aa5ba
push id14400
push usermasayuki@d-toybox.com
push dateFri, 01 Apr 2016 07:07:56 +0000
reviewerssmaug
bugs1259664
milestone48.0a1
Bug 1259664 part.3 Rename WidgetWheelEvent::deltaZ to WidgetWheelEvent::mDeltaZ r?smaug MozReview-Commit-ID: BbxTrLko8kp
dom/base/nsDOMWindowUtils.cpp
dom/events/EventStateManager.cpp
dom/events/WheelEvent.cpp
widget/MouseEvents.h
widget/WidgetEventImpl.cpp
widget/nsGUIEventIPC.h
widget/windows/nsWinGesture.cpp
--- a/dom/base/nsDOMWindowUtils.cpp
+++ b/dom/base/nsDOMWindowUtils.cpp
@@ -790,17 +790,17 @@ nsDOMWindowUtils::SendWheelEvent(float a
   if (!widget) {
     return NS_ERROR_NULL_POINTER;
   }
 
   WidgetWheelEvent wheelEvent(true, eWheel, widget);
   wheelEvent.mModifiers = nsContentUtils::GetWidgetModifiers(aModifiers);
   wheelEvent.mDeltaX = aDeltaX;
   wheelEvent.mDeltaY = aDeltaY;
-  wheelEvent.deltaZ = aDeltaZ;
+  wheelEvent.mDeltaZ = aDeltaZ;
   wheelEvent.deltaMode = aDeltaMode;
   wheelEvent.isMomentum =
     (aOptions & WHEEL_EVENT_CAUSED_BY_MOMENTUM) != 0;
   wheelEvent.mIsNoLineOrPageDelta =
     (aOptions & WHEEL_EVENT_CAUSED_BY_NO_LINE_OR_PAGE_DELTA_DEVICE) != 0;
   wheelEvent.customizedByUserPrefs =
     (aOptions & WHEEL_EVENT_CUSTOMIZED_BY_USER_PREFS) != 0;
   wheelEvent.lineOrPageDeltaX = aLineOrPageDeltaX;
--- a/dom/events/EventStateManager.cpp
+++ b/dom/events/EventStateManager.cpp
@@ -5637,17 +5637,17 @@ EventStateManager::WheelPrefs::ApplyUser
     return;
   }
 
   Index index = GetIndexFor(aEvent);
   Init(index);
 
   aEvent->mDeltaX *= mMultiplierX[index];
   aEvent->mDeltaY *= mMultiplierY[index];
-  aEvent->deltaZ *= mMultiplierZ[index];
+  aEvent->mDeltaZ *= mMultiplierZ[index];
 
   // If the multiplier is 1.0 or -1.0, i.e., it doesn't change the absolute
   // value, we should use lineOrPageDelta values which were set by widget.
   // Otherwise, we need to compute them from accumulated delta values.
   if (!NeedToComputeLineOrPageDelta(aEvent)) {
     aEvent->lineOrPageDeltaX *= static_cast<int32_t>(mMultiplierX[index]);
     aEvent->lineOrPageDeltaY *= static_cast<int32_t>(mMultiplierY[index]);
   } else {
@@ -5684,17 +5684,17 @@ EventStateManager::WheelPrefs::CancelApp
 EventStateManager::WheelPrefs::Action
 EventStateManager::WheelPrefs::ComputeActionFor(WidgetWheelEvent* aEvent)
 {
   Index index = GetIndexFor(aEvent);
   Init(index);
 
   bool deltaXPreferred =
     (Abs(aEvent->mDeltaX) > Abs(aEvent->mDeltaY) &&
-     Abs(aEvent->mDeltaX) > Abs(aEvent->deltaZ));
+     Abs(aEvent->mDeltaX) > Abs(aEvent->mDeltaZ));
   Action* actions = deltaXPreferred ? mOverriddenActionsX : mActions;
   if (actions[index] == ACTION_NONE || actions[index] == ACTION_SCROLL) {
     return actions[index];
   }
 
   // Momentum events shouldn't run special actions.
   if (aEvent->isMomentum) {
     // Use the default action.  Note that user might kill the wheel scrolling.
--- a/dom/events/WheelEvent.cpp
+++ b/dom/events/WheelEvent.cpp
@@ -62,17 +62,17 @@ WheelEvent::InitWheelEvent(const nsAStri
 {
   MouseEvent::InitMouseEvent(aType, aCanBubble, aCancelable, aView, aDetail,
                              aScreenX, aScreenY, aClientX, aClientY, aButton,
                              aRelatedTarget, aModifiersList);
 
   WidgetWheelEvent* wheelEvent = mEvent->AsWheelEvent();
   wheelEvent->mDeltaX = aDeltaX;
   wheelEvent->mDeltaY = aDeltaY;
-  wheelEvent->deltaZ = aDeltaZ;
+  wheelEvent->mDeltaZ = aDeltaZ;
   wheelEvent->deltaMode = aDeltaMode;
 }
 
 double
 WheelEvent::DeltaX()
 {
   if (!mAppUnitsPerDevPixel) {
     return mEvent->AsWheelEvent()->mDeltaX;
@@ -90,19 +90,19 @@ WheelEvent::DeltaY()
   return mEvent->AsWheelEvent()->mDeltaY *
     mAppUnitsPerDevPixel / nsPresContext::AppUnitsPerCSSPixel();
 }
 
 double
 WheelEvent::DeltaZ()
 {
   if (!mAppUnitsPerDevPixel) {
-    return mEvent->AsWheelEvent()->deltaZ;
+    return mEvent->AsWheelEvent()->mDeltaZ;
   }
-  return mEvent->AsWheelEvent()->deltaZ *
+  return mEvent->AsWheelEvent()->mDeltaZ *
     mAppUnitsPerDevPixel / nsPresContext::AppUnitsPerCSSPixel();
 }
 
 uint32_t
 WheelEvent::DeltaMode()
 {
   return mEvent->AsWheelEvent()->deltaMode;
 }
--- a/widget/MouseEvents.h
+++ b/widget/MouseEvents.h
@@ -445,17 +445,17 @@ class WidgetWheelEvent : public WidgetMo
 {
 private:
   friend class mozilla::dom::PBrowserParent;
   friend class mozilla::dom::PBrowserChild;
 
   WidgetWheelEvent()
     : mDeltaX(0.0)
     , mDeltaY(0.0)
-    , deltaZ(0.0)
+    , mDeltaZ(0.0)
     , deltaMode(nsIDOMWheelEvent::DOM_DELTA_PIXEL)
     , customizedByUserPrefs(false)
     , isMomentum(false)
     , mIsNoLineOrPageDelta(false)
     , lineOrPageDeltaX(0)
     , lineOrPageDeltaY(0)
     , scrollType(SCROLL_DEFAULT)
     , overflowDeltaX(0.0)
@@ -468,17 +468,17 @@ private:
 
 public:
   virtual WidgetWheelEvent* AsWheelEvent() override { return this; }
 
   WidgetWheelEvent(bool aIsTrusted, EventMessage aMessage, nsIWidget* aWidget)
     : WidgetMouseEventBase(aIsTrusted, aMessage, aWidget, eWheelEventClass)
     , mDeltaX(0.0)
     , mDeltaY(0.0)
-    , deltaZ(0.0)
+    , mDeltaZ(0.0)
     , deltaMode(nsIDOMWheelEvent::DOM_DELTA_PIXEL)
     , customizedByUserPrefs(false)
     , mayHaveMomentum(false)
     , isMomentum(false)
     , mIsNoLineOrPageDelta(false)
     , lineOrPageDeltaX(0)
     , lineOrPageDeltaY(0)
     , scrollType(SCROLL_DEFAULT)
@@ -506,23 +506,23 @@ public:
   // 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;
   }
 
-  // NOTE: mDeltaX, mDeltaY and deltaZ may be customized by
+  // 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;
-  double deltaZ;
+  double mDeltaZ;
 
   // Should be one of nsIDOMWheelEvent::DOM_DELTA_*
   uint32_t deltaMode;
 
   // Following members are for internal use only, not for DOM event.
 
   // If the delta values are computed from prefs, this value is true.
   // Otherwise, i.e., they are computed from native events, false.
@@ -578,17 +578,17 @@ public:
     SCROLL_SMOOTHLY
   };
   ScrollType scrollType;
 
   // 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 deltaZ may be modified by EventStateManager.
+  // NOTE: mDeltaX, mDeltaY and mDeltaZ may be modified by EventStateManager.
   //       However, overflowDeltaX 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 overflowDeltaY;
 
   // Whether or not the parent of the currently overscrolled frame is the
@@ -607,17 +607,17 @@ public:
   bool mAllowToOverrideSystemScrollSpeed;
 
   void AssignWheelEventData(const WidgetWheelEvent& aEvent, bool aCopyTargets)
   {
     AssignMouseEventBaseData(aEvent, aCopyTargets);
 
     mDeltaX = aEvent.mDeltaX;
     mDeltaY = aEvent.mDeltaY;
-    deltaZ = aEvent.deltaZ;
+    mDeltaZ = aEvent.mDeltaZ;
     deltaMode = aEvent.deltaMode;
     customizedByUserPrefs = aEvent.customizedByUserPrefs;
     mayHaveMomentum = aEvent.mayHaveMomentum;
     isMomentum = aEvent.isMomentum;
     mIsNoLineOrPageDelta = aEvent.mIsNoLineOrPageDelta;
     lineOrPageDeltaX = aEvent.lineOrPageDeltaX;
     lineOrPageDeltaY = aEvent.lineOrPageDeltaY;
     scrollType = aEvent.scrollType;
--- a/widget/WidgetEventImpl.cpp
+++ b/widget/WidgetEventImpl.cpp
@@ -273,17 +273,17 @@ WidgetEvent::IsAllowedToDispatchDOMEvent
       // do not have a reliable refPoint.
       return AsMouseEvent()->reason == WidgetMouseEvent::eReal;
 
     case eWheelEventClass: {
       // wheel event whose all delta values are zero by user pref applied, it
       // shouldn't cause a DOM event.
       const WidgetWheelEvent* wheelEvent = AsWheelEvent();
       return wheelEvent->mDeltaX != 0.0 || wheelEvent->mDeltaY != 0.0 ||
-             wheelEvent->deltaZ != 0.0;
+             wheelEvent->mDeltaZ != 0.0;
     }
 
     // Following events are handled in EventStateManager, so, we don't need to
     // dispatch DOM event for them into the DOM tree.
     case eQueryContentEventClass:
     case eSelectionEventClass:
     case eContentCommandEventClass:
       return false;
--- a/widget/nsGUIEventIPC.h
+++ b/widget/nsGUIEventIPC.h
@@ -157,17 +157,17 @@ struct ParamTraits<mozilla::WidgetWheelE
 {
   typedef mozilla::WidgetWheelEvent paramType;
 
   static void Write(Message* aMsg, const paramType& aParam)
   {
     WriteParam(aMsg, static_cast<mozilla::WidgetMouseEventBase>(aParam));
     WriteParam(aMsg, aParam.mDeltaX);
     WriteParam(aMsg, aParam.mDeltaY);
-    WriteParam(aMsg, aParam.deltaZ);
+    WriteParam(aMsg, aParam.mDeltaZ);
     WriteParam(aMsg, aParam.deltaMode);
     WriteParam(aMsg, aParam.customizedByUserPrefs);
     WriteParam(aMsg, aParam.mayHaveMomentum);
     WriteParam(aMsg, aParam.isMomentum);
     WriteParam(aMsg, aParam.mIsNoLineOrPageDelta);
     WriteParam(aMsg, aParam.lineOrPageDeltaX);
     WriteParam(aMsg, aParam.lineOrPageDeltaY);
     WriteParam(aMsg, static_cast<int32_t>(aParam.scrollType));
@@ -181,17 +181,17 @@ struct ParamTraits<mozilla::WidgetWheelE
   static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
   {
     int32_t scrollType = 0;
     bool rv =
       ReadParam(aMsg, aIter,
                 static_cast<mozilla::WidgetMouseEventBase*>(aResult)) &&
       ReadParam(aMsg, aIter, &aResult->mDeltaX) &&
       ReadParam(aMsg, aIter, &aResult->mDeltaY) &&
-      ReadParam(aMsg, aIter, &aResult->deltaZ) &&
+      ReadParam(aMsg, aIter, &aResult->mDeltaZ) &&
       ReadParam(aMsg, aIter, &aResult->deltaMode) &&
       ReadParam(aMsg, aIter, &aResult->customizedByUserPrefs) &&
       ReadParam(aMsg, aIter, &aResult->mayHaveMomentum) &&
       ReadParam(aMsg, aIter, &aResult->isMomentum) &&
       ReadParam(aMsg, aIter, &aResult->mIsNoLineOrPageDelta) &&
       ReadParam(aMsg, aIter, &aResult->lineOrPageDeltaX) &&
       ReadParam(aMsg, aIter, &aResult->lineOrPageDeltaY) &&
       ReadParam(aMsg, aIter, &scrollType) &&
--- a/widget/windows/nsWinGesture.cpp
+++ b/widget/windows/nsWinGesture.cpp
@@ -560,17 +560,17 @@ nsWinGesture::PanFeedbackFinalize(HWND h
   }
 
   UpdatePanningFeedback(hWnd, mPixelScrollOverflow.x, mPixelScrollOverflow.y, mPanInertiaActive);
 }
 
 bool
 nsWinGesture::PanDeltaToPixelScroll(WidgetWheelEvent& aWheelEvent)
 {
-  aWheelEvent.mDeltaX = aWheelEvent.mDeltaY = aWheelEvent.deltaZ = 0.0;
+  aWheelEvent.mDeltaX = aWheelEvent.mDeltaY = aWheelEvent.mDeltaZ = 0.0;
   aWheelEvent.lineOrPageDeltaX = aWheelEvent.lineOrPageDeltaY = 0;
 
   aWheelEvent.refPoint.x = mPanRefPoint.x;
   aWheelEvent.refPoint.y = mPanRefPoint.y;
   aWheelEvent.deltaMode = nsIDOMWheelEvent::DOM_DELTA_PIXEL;
   aWheelEvent.scrollType = WidgetWheelEvent::SCROLL_SYNCHRONOUSLY;
   aWheelEvent.mIsNoLineOrPageDelta = true;