Bug 1266799 - Increase DOM fullscreen timeout length to 1000ms. r?xidorn
According to the Telemetry probes added in
Bug 1271160, 1000ms should
account for ~94% of fullscreen transitions. The remaining ~6% tail is where
users might see the transition end and then content re-organize itself.
I think this is a big improvement over the original 500ms, which covers only
about ~80% of cases, according to Telemetry.
MozReview-Commit-ID: 3Vb9qQ7yDx5
--- a/dom/base/nsGlobalWindow.cpp
+++ b/dom/base/nsGlobalWindow.cpp
@@ -6306,17 +6306,17 @@ FullscreenTransitionTask::Run()
// should rarely happen, it probably isn't worth to fix. Hence we
// simply add a timeout here to ensure we never hang forever.
// In addition, if the page is complicated or the machine is less
// powerful, layout could take a long time, in which case, staying
// in black screen for that long could hurt user experience even
// more than exposing an intermediate state.
mTimer = do_CreateInstance(NS_TIMER_CONTRACTID);
uint32_t timeout =
- Preferences::GetUint("full-screen-api.transition.timeout", 500);
+ Preferences::GetUint("full-screen-api.transition.timeout", 1000);
mTimer->Init(observer, timeout, nsITimer::TYPE_ONE_SHOT);
} else if (stage == eAfterToggle) {
Telemetry::AccumulateTimeDelta(Telemetry::FULLSCREEN_TRANSITION_BLACK_MS,
mFullscreenChangeStartTime);
mWidget->PerformFullscreenTransition(nsIWidget::eAfterFullscreenToggle,
mDuration.mFadeOut, mTransitionData,
this);
} else if (stage == eEnd) {
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
@@ -4639,17 +4639,17 @@ pref("full-screen-api.unprefix.enabled",
pref("full-screen-api.unprefix.enabled", true);
#endif
pref("full-screen-api.allow-trusted-requests-only", true);
pref("full-screen-api.pointer-lock.enabled", true);
// transition duration of fade-to-black and fade-from-black, unit: ms
pref("full-screen-api.transition-duration.enter", "200 200");
pref("full-screen-api.transition-duration.leave", "200 200");
// timeout for black screen in fullscreen transition, unit: ms
-pref("full-screen-api.transition.timeout", 500);
+pref("full-screen-api.transition.timeout", 1000);
// time for the warning box stays on the screen before sliding out, unit: ms
pref("full-screen-api.warning.timeout", 3000);
// delay for the warning box to show when pointer stays on the top, unit: ms
pref("full-screen-api.warning.delay", 500);
// DOM idle observers API
pref("dom.idle-observers-api.enabled", true);