Bug 1235478 - Part 2: Don't update mMostRecentRefresh when nsRefreshDriver::ScheduleViewManagerFlush is called. r=mchang

--HG--
extra : transplant_source : %86e%80%9D%07%B0K%16%EB%FC%5D%9B%CA%D6%A1_%D2y%A0%7E
This commit is contained in:
Hiroyuki Ikezoe 2016-01-05 12:50:59 +09:00
Родитель 155e16e777
Коммит 3614d255d8
2 изменённых файлов: 12 добавлений и 2 удалений

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

@ -1184,6 +1184,15 @@ nsRefreshDriver::EnsureTimerStarted(EnsureTimerStartedFlags aFlags)
mActiveTimer->AddRefreshDriver(this); mActiveTimer->AddRefreshDriver(this);
} }
// When switching from an inactive timer to an active timer, the root
// refresh driver is skipped due to being set to the content refresh
// driver's timestamp. In case of EnsureTimerStarted is called from
// ScheduleViewManagerFlush, we should avoid this behavior to flush
// a paint in the same tick on the root refresh driver.
if (aFlags & eNeverAdjustTimer) {
return;
}
// Since the different timers are sampled at different rates, when switching // Since the different timers are sampled at different rates, when switching
// timers, the most recent refresh of the new timer may be *before* the // timers, the most recent refresh of the new timer may be *before* the
// most recent refresh of the old timer. However, the refresh driver time // most recent refresh of the old timer. However, the refresh driver time
@ -2108,7 +2117,7 @@ nsRefreshDriver::ScheduleViewManagerFlush()
NS_ASSERTION(mPresContext->IsRoot(), NS_ASSERTION(mPresContext->IsRoot(),
"Should only schedule view manager flush on root prescontexts"); "Should only schedule view manager flush on root prescontexts");
mViewManagerFlushIsPending = true; mViewManagerFlushIsPending = true;
EnsureTimerStarted(); EnsureTimerStarted(eNeverAdjustTimer);
} }
void void

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

@ -330,7 +330,8 @@ private:
enum EnsureTimerStartedFlags { enum EnsureTimerStartedFlags {
eNone = 0, eNone = 0,
eForceAdjustTimer = 1 << 0, eForceAdjustTimer = 1 << 0,
eAllowTimeToGoBackwards = 1 << 1 eAllowTimeToGoBackwards = 1 << 1,
eNeverAdjustTimer = 1 << 2,
}; };
void EnsureTimerStarted(EnsureTimerStartedFlags aFlags = eNone); void EnsureTimerStarted(EnsureTimerStartedFlags aFlags = eNone);
void StopTimer(); void StopTimer();