Bug 1259664 part.12 Rename WidgetWheelEvent::overflowDeltaY to WidgetWheelEvent::mOverflowDeltaY r=smaug

MozReview-Commit-ID: GGvQZlvc4sl

--HG--
extra : rebase_source : 9673aea11cbc752cfbc3c7b48fa68e2a4143266f
This commit is contained in:
Masayuki Nakano 2016-04-01 00:36:55 +09:00
parent a597026bd6
commit e6be470f50
7 changed files with 28 additions and 27 deletions

View File

@ -837,15 +837,15 @@ nsDOMWindowUtils::SendWheelEvent(float aX,
}
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;
}
@ -856,8 +856,8 @@ nsDOMWindowUtils::SendWheelEvent(float aX,
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

View File

@ -2638,14 +2638,14 @@ EventStateManager::DoScrollText(nsIScrollableFrame* aScrollableFrame,
// 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;
}
@ -2666,16 +2666,16 @@ EventStateManager::DoScrollText(nsIScrollableFrame* aScrollableFrame,
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);
}
@ -3219,7 +3219,7 @@ EventStateManager::PostHandleEvent(nsPresContext* aPresContext,
wheelEvent->mViewPortIsOverscrolled = true;
}
wheelEvent->mOverflowDeltaX = wheelEvent->mDeltaX;
wheelEvent->overflowDeltaY = wheelEvent->mDeltaY;
wheelEvent->mOverflowDeltaY = wheelEvent->mDeltaY;
WheelPrefs::GetInstance()->
CancelApplyingUserPrefsFromOverflowDelta(wheelEvent);
if (scrollTarget) {
@ -3290,7 +3290,7 @@ EventStateManager::PostHandleEvent(nsPresContext* aPresContext,
break;
}
wheelEvent->mOverflowDeltaX = wheelEvent->mDeltaX;
wheelEvent->overflowDeltaY = wheelEvent->mDeltaY;
wheelEvent->mOverflowDeltaY = wheelEvent->mDeltaY;
WheelPrefs::GetInstance()->
CancelApplyingUserPrefsFromOverflowDelta(wheelEvent);
wheelEvent->mViewPortIsOverscrolled = true;
@ -5677,7 +5677,7 @@ EventStateManager::WheelPrefs::CancelApplyingUserPrefsFromOverflowDelta(
aEvent->mOverflowDeltaX /= mMultiplierX[index];
}
if (mMultiplierY[index]) {
aEvent->overflowDeltaY /= mMultiplierY[index];
aEvent->mOverflowDeltaY /= mMultiplierY[index];
}
}

View File

@ -1730,7 +1730,7 @@ nsPluginFrame::HandleWheelEventAsDefaultAction(WidgetWheelEvent* aWheelEvent)
// 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();
}

View File

@ -459,7 +459,7 @@ private:
, mLineOrPageDeltaY(0)
, mScrollType(SCROLL_DEFAULT)
, mOverflowDeltaX(0.0)
, overflowDeltaY(0.0)
, mOverflowDeltaY(0.0)
, mViewPortIsOverscrolled(false)
, mCanTriggerSwipe(false)
, mAllowToOverrideSystemScrollSpeed(false)
@ -483,7 +483,7 @@ public:
, mLineOrPageDeltaY(0)
, mScrollType(SCROLL_DEFAULT)
, mOverflowDeltaX(0.0)
, overflowDeltaY(0.0)
, mOverflowDeltaY(0.0)
, mViewPortIsOverscrolled(false)
, mCanTriggerSwipe(false)
, mAllowToOverrideSystemScrollSpeed(true)
@ -584,12 +584,12 @@ public:
// 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
@ -622,7 +622,7 @@ public:
mLineOrPageDeltaY = aEvent.mLineOrPageDeltaY;
mScrollType = aEvent.mScrollType;
mOverflowDeltaX = aEvent.mOverflowDeltaX;
overflowDeltaY = aEvent.overflowDeltaY;
mOverflowDeltaY = aEvent.mOverflowDeltaY;
mViewPortIsOverscrolled = aEvent.mViewPortIsOverscrolled;
mCanTriggerSwipe = aEvent.mCanTriggerSwipe;
mAllowToOverrideSystemScrollSpeed =

View File

@ -172,7 +172,7 @@ struct ParamTraits<mozilla::WidgetWheelEvent>
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);
@ -196,7 +196,7 @@ struct ParamTraits<mozilla::WidgetWheelEvent>
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);

View File

@ -575,7 +575,7 @@ nsWinGesture::PanDeltaToPixelScroll(WidgetWheelEvent& aWheelEvent)
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

View File

@ -6530,9 +6530,10 @@ bool nsWindow::OnGesture(WPARAM wParam, LPARAM lParam)
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);
}