зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1521786 - Keep RefreshDriver ticking before first contentful paint, r=farre
--HG-- extra : rebase_source : 51e9d056b7ec7874e76a746740de5e2bb965f4e3
This commit is contained in:
Родитель
f658ec7c25
Коммит
a3dd58ad75
|
@ -1773,7 +1773,23 @@ void nsRefreshDriver::Tick(VsyncId aId, TimeStamp aNowTime) {
|
||||||
// situation we don't want to thrash our timer. So instead we
|
// situation we don't want to thrash our timer. So instead we
|
||||||
// wait until we get a Notify() call when we have no observers
|
// wait until we get a Notify() call when we have no observers
|
||||||
// before stopping the timer.
|
// before stopping the timer.
|
||||||
|
// On top level content pages keep the timer running initially so that we
|
||||||
|
// paint the page soon enough.
|
||||||
|
if (!XRE_IsContentProcess() || !presShell || mTestControllingRefreshes ||
|
||||||
|
!mPresContext->Document()->IsTopLevelContentDocument() || mThrottled ||
|
||||||
|
gfxPlatform::IsInLayoutAsapMode()) {
|
||||||
StopTimer();
|
StopTimer();
|
||||||
|
} else if (mPresContext->Document()->GetReadyStateEnum() <
|
||||||
|
Document::READYSTATE_COMPLETE &&
|
||||||
|
!mPresContext->HadContentfulPaint()) {
|
||||||
|
if (mInitialTimerRunningLimit.IsNull()) {
|
||||||
|
mInitialTimerRunningLimit =
|
||||||
|
TimeStamp::Now() + TimeDuration::FromSeconds(4.0f);
|
||||||
|
// Don't let the timer to run forever, so limit to 4s for now.
|
||||||
|
} else if (mInitialTimerRunningLimit < TimeStamp::Now()) {
|
||||||
|
StopTimer();
|
||||||
|
}
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -539,6 +539,7 @@ class nsRefreshDriver final : public mozilla::layers::TransactionIdAllocator,
|
||||||
mozilla::TimeStamp mTickVsyncTime;
|
mozilla::TimeStamp mTickVsyncTime;
|
||||||
mozilla::TimeStamp mNextThrottledFrameRequestTick;
|
mozilla::TimeStamp mNextThrottledFrameRequestTick;
|
||||||
mozilla::TimeStamp mNextRecomputeVisibilityTick;
|
mozilla::TimeStamp mNextRecomputeVisibilityTick;
|
||||||
|
mozilla::TimeStamp mInitialTimerRunningLimit;
|
||||||
|
|
||||||
// separate arrays for each flush type we support
|
// separate arrays for each flush type we support
|
||||||
ObserverArray mObservers[4];
|
ObserverArray mObservers[4];
|
||||||
|
|
Загрузка…
Ссылка в новой задаче