Bug 1268749 part 1 - Add pref to disable unprefixed fullscreen api. r=smaug draft
authorXidorn Quan <quanxunzhen@gmail.com>
Mon, 02 May 2016 14:14:36 +1000
changeset 363168 b2da0b2063a5e2a2af3bdda5dbe26e3fb6aa1935
parent 363162 a099ca32a7eabd3c096ff2394f0dec5fd60525ca
child 363169 cbab63baf387e5f06ad510c51538ee9f8683aed2
child 363182 e059616e5ec853c17614d119d58d3aeb5cb6c7af
push id17123
push userxquan@mozilla.com
push dateWed, 04 May 2016 04:30:15 +0000
reviewerssmaug
bugs1268749
milestone49.0a1
Bug 1268749 part 1 - Add pref to disable unprefixed fullscreen api. r=smaug MozReview-Commit-ID: 4NjbHgDfvBM
dom/html/test/test_fullscreen-api-race.html
dom/html/test/test_fullscreen-api.html
dom/tests/mochitest/pointerlock/test_pointerlock-api.html
modules/libpref/init/all.js
--- a/dom/html/test/test_fullscreen-api-race.html
+++ b/dom/html/test/test_fullscreen-api-race.html
@@ -22,17 +22,20 @@ SimpleTest.waitForExplicitFinish();
 // and in real life, requestFullscreen can only be called inside a user
 // event handler. But we want to fix this race condition at some point,
 // via queuing all exiting request as well as entering request together
 // which we may eventually need to do for bug 1188256.
 SimpleTest.requestFlakyTimeout(
   "Need to wait for potential fullscreen transition");
 addLoadEvent(function () {
   SpecialPowers.pushPrefEnv({
-    "set": [["full-screen-api.allow-trusted-requests-only", false]]
+    "set": [
+      ["full-screen-api.unprefix.enabled", true],
+      ["full-screen-api.allow-trusted-requests-only", false]
+    ]
   }, next);
 });
 
 const OPEN_WINDOW_FUNCS = [
   function openNewTab() {
     return window.open("about:blank");
   },
   function openNewWindow() {
--- a/dom/html/test/test_fullscreen-api.html
+++ b/dom/html/test/test_fullscreen-api.html
@@ -86,16 +86,17 @@ try {
 is(window.fullScreen, false, "Shouldn't be able to set window fullscreen from content");
 // Ensure the full-screen api is enabled, and will be disabled on test exit.
 // Disable the requirement for trusted contexts only, so the tests are easier
 // to write
 addLoadEvent(function() {
   SpecialPowers.pushPrefEnv({
       "set": [
         ["full-screen-api.enabled", true],
+        ["full-screen-api.unprefix.enabled", true],
         ["full-screen-api.allow-trusted-requests-only", false],
         ["full-screen-api.transition-duration.enter", "0 0"],
         ["full-screen-api.transition-duration.leave", "0 0"]
       ]}, nextTest);
 });
 SimpleTest.waitForExplicitFinish();
 </script>
 </pre>
--- a/dom/tests/mochitest/pointerlock/test_pointerlock-api.html
+++ b/dom/tests/mochitest/pointerlock/test_pointerlock-api.html
@@ -25,16 +25,17 @@ https://bugzilla.mozilla.org/show_bug.cg
          * around this, all tests are run in a child window, which can go fullscreen.
          * This method is borrowed from dom/html/test/test_fullscreen-api.html.
          **/
 
         SimpleTest.waitForExplicitFinish();
 
         SpecialPowers.pushPrefEnv({"set": [
           ["full-screen-api.enabled", true],
+          ["full-screen-api.unprefix.enabled", true],
           ["full-screen-api.allow-trusted-requests-only", false],
           ["full-screen-api.transition-duration.enter", "0 0"],
           ["full-screen-api.transition-duration.leave", "0 0"]
         ]}, nextTest);
 
         // Run the tests which go full-screen in new window, as Mochitests
         // normally run in an iframe, which by default will not have the
         // allowfullscreen attribute set, so full-screen won't work.
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
@@ -4565,16 +4565,21 @@ pref("dom.webnotifications.serviceworker
 
 // Alert animation effect, name is disableSlidingEffect for backwards-compat.
 pref("alerts.disableSlidingEffect", false);
 // Show favicons in web notifications.
 pref("alerts.showFavicons", false);
 
 // DOM full-screen API.
 pref("full-screen-api.enabled", false);
+#ifdef RELEASE_BUILD
+pref("full-screen-api.unprefix.enabled", false);
+#else
+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);
 // time for the warning box stays on the screen before sliding out, unit: ms