Bug 1266799 - Increase DOM fullscreen timeout length to 1000ms. r?xidorn draft
authorMike Conley <mconley@mozilla.com>
Thu, 02 Jun 2016 14:49:56 -0400
changeset 374674 ca9cb9cbb8e2b5b1a84f6ebeef2e6d2272226359
parent 374673 da9fb79c7271b4fae8633e8c287ebdb4248d49f6
child 522664 8f3658bd7c8a19328589cb3f9c64d05f897d3f5f
push id20055
push usermconley@mozilla.com
push dateThu, 02 Jun 2016 19:00:42 +0000
reviewersxidorn
bugs1266799, 1271160
milestone49.0a1
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
dom/base/nsGlobalWindow.cpp
modules/libpref/init/all.js
--- 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);