b=767710 don't let additional events with the same destination restart smooth scrolling r=mstange

--HG--
extra : transplant_source : _%BA%CE%F1A%B7%40N%14VMZ%1D%2C%98Lg%40%F7%AF
This commit is contained in:
Karl Tomlinson 2013-04-18 12:05:10 +12:00
Родитель 61fd583b40
Коммит 0b5112e494
1 изменённых файлов: 10 добавлений и 2 удалений

Просмотреть файл

@ -1345,15 +1345,23 @@ nsGfxScrollFrameInner::AsyncScroll::InitSmoothScroll(TimeStamp aTime,
nsPoint aDestination,
nsIAtom *aOrigin,
const nsRect& aRange) {
mRange = aRange;
TimeDuration duration = CalcDurationForEventTime(aTime, aOrigin);
nsSize currentVelocity(0, 0);
if (!mIsFirstIteration) {
// If an additional event has not changed the destination, then do not let
// another minimum duration reset slow things down. If it would then
// instead continue with the existing timing function.
if (aDestination == mDestination &&
aTime + duration > mStartTime + mDuration)
return;
currentVelocity = VelocityAt(aTime);
mStartPos = PositionAt(aTime);
}
mStartTime = aTime;
mDuration = CalcDurationForEventTime(aTime, aOrigin);
mDuration = duration;
mDestination = aDestination;
mRange = aRange;
InitTimingFunction(mTimingFunctionX, mStartPos.x, currentVelocity.width,
aDestination.x);
InitTimingFunction(mTimingFunctionY, mStartPos.y, currentVelocity.height,