Backed out changeset 2e519e843706 (bug 1139220)

This commit is contained in:
Carsten "Tomcat" Book 2015-04-02 09:13:13 +02:00
parent f17aaa31b2
commit 069f2a686b

View File

@ -683,7 +683,12 @@ public:
aSpringConstant, aDampingRatio)
, mYAxisModel(aInitialPosition.y, aDestination.y, aInitialVelocity.y,
aSpringConstant, aDampingRatio)
, mSource(aSource)
, mAllowOverscroll(true)
{
if (mSource == ScrollSource::Wheel) {
mAllowOverscroll = mApzc.AllowScrollHandoffInWheelTransaction();
}
}
/**
@ -728,7 +733,11 @@ public:
ParentLayerPoint overscroll;
ParentLayerPoint adjustedOffset;
mApzc.mX.AdjustDisplacement(displacement.x, adjustedOffset.x, overscroll.x);
mApzc.mY.AdjustDisplacement(displacement.y, adjustedOffset.y, overscroll.y);
bool forceVerticalOverscroll = mSource == ScrollSource::Wheel &&
!aFrameMetrics.AllowVerticalScrollWithWheel();
mApzc.mY.AdjustDisplacement(displacement.y, adjustedOffset.y, overscroll.y,
forceVerticalOverscroll);
aFrameMetrics.ScrollBy(adjustedOffset / zoom);
@ -736,7 +745,7 @@ public:
// This can happen if either the layout.css.scroll-behavior.damping-ratio
// preference is set to less than 1 (underdamped) or if a smooth scroll
// inherits velocity from a fling gesture.
if (!IsZero(overscroll)) {
if (!IsZero(overscroll) && mAllowOverscroll) {
// Hand off a fling with the remaining momentum to the next APZC in the
// overscroll handoff chain.
@ -773,6 +782,8 @@ public:
private:
AsyncPanZoomController& mApzc;
AxisPhysicsMSDModel mXAxisModel, mYAxisModel;
ScrollSource mSource;
bool mAllowOverscroll;
};
void