Bug 1326686 - Only use the most recent refresh time as the start time of an AsyncScroll when the refresh driver is under test control. r=kip
MozReview-Commit-ID: FkyJfbaPPVl
--- a/layout/generic/nsGfxScrollFrame.cpp
+++ b/layout/generic/nsGfxScrollFrame.cpp
@@ -2277,17 +2277,19 @@ ScrollFrameHelper::ScrollToWithOrigin(ns
if (aMode == nsIScrollableFrame::INSTANT) {
// Asynchronous scrolling is not allowed, so we'll kill any existing
// async-scrolling process and do an instant scroll.
CompleteAsyncScroll(range, aOrigin);
return;
}
nsPresContext* presContext = mOuter->PresContext();
- TimeStamp now = presContext->RefreshDriver()->MostRecentRefresh();
+ TimeStamp now = presContext->RefreshDriver()->IsTestControllingRefreshesEnabled()
+ ? presContext->RefreshDriver()->MostRecentRefresh()
+ : TimeStamp::Now();
bool isSmoothScroll = (aMode == nsIScrollableFrame::SMOOTH) &&
IsSmoothScrollingEnabled();
nsSize currentVelocity(0, 0);
if (gfxPrefs::ScrollBehaviorEnabled()) {
if (aMode == nsIScrollableFrame::SMOOTH_MSD) {
mIgnoreMomentumScroll = true;