Bug 991899 part 2 - Unprefix PointerLock tests. r?smaug draft
authorXidorn Quan <me@upsuper.org>
Wed, 27 Jul 2016 10:22:36 +1000
changeset 393119 8829706f0eb9d07d12f2efafdd570aba825b520e
parent 393118 0def57d1ff71b2861aafb87d3cb9f9c5bcc8fa40
child 393120 a24c0330979ae775b5c34624c7c6ef768114959b
child 393121 498520f98f39147110b8e97be62d2817879b7159
child 393125 f034173204495168da848f2e16f1862b17960025
push id24211
push userxquan@mozilla.com
push dateWed, 27 Jul 2016 00:40:23 +0000
reviewerssmaug
bugs991899
milestone50.0a1
Bug 991899 part 2 - Unprefix PointerLock tests. r?smaug MozReview-Commit-ID: BPAuJWKZgBG
dom/tests/mochitest/pointerlock/file_allowPointerLockSandboxFlag.html
dom/tests/mochitest/pointerlock/file_changeLockElement.html
dom/tests/mochitest/pointerlock/file_childIframe.html
dom/tests/mochitest/pointerlock/file_doubleLock.html
dom/tests/mochitest/pointerlock/file_escapeKey.html
dom/tests/mochitest/pointerlock/file_infiniteMovement.html
dom/tests/mochitest/pointerlock/file_locksvgelement.html
dom/tests/mochitest/pointerlock/file_nestedFullScreen.html
dom/tests/mochitest/pointerlock/file_pointerLockPref.html
dom/tests/mochitest/pointerlock/file_pointerlock-api.html
dom/tests/mochitest/pointerlock/file_pointerlockerror.html
dom/tests/mochitest/pointerlock/file_removedFromDOM.html
dom/tests/mochitest/pointerlock/file_retargetMouseEvents.html
dom/tests/mochitest/pointerlock/file_screenClientXYConst.html
dom/tests/mochitest/pointerlock/file_suppressSomeMouseEvents.html
dom/tests/mochitest/pointerlock/file_targetOutOfFocus.html
dom/tests/mochitest/pointerlock/file_withoutDOM.html
--- a/dom/tests/mochitest/pointerlock/file_allowPointerLockSandboxFlag.html
+++ b/dom/tests/mochitest/pointerlock/file_allowPointerLockSandboxFlag.html
@@ -58,34 +58,34 @@
           SimpleTest.waitForFocus(doStartTest, iframe.contentWindow);
         }
         function doStartTest() {
           contentDocument = iframe.contentDocument;
           iframeDiv = contentDocument.getElementById("div");
 
           numberOfRuns++;
 
-          contentDocument.addEventListener("mozpointerlockchange", function () {
-            if (contentDocument.mozPointerLockElement === iframeDiv) {
+          contentDocument.addEventListener("pointerlockchange", function () {
+            if (contentDocument.pointerLockElement === iframeDiv) {
               pointerLocked++;
               contentDocument.exitFullscreen();
             }
           });
 
-          contentDocument.addEventListener("mozpointerlockerror", function () {
+          contentDocument.addEventListener("pointerlockerror", function () {
             contentDocument.exitFullscreen();
           });
 
           contentDocument.addEventListener("fullscreenchange", function () {
             if (contentDocument.fullscreenElement) {
               ok(contentDocument.fullscreenElement === iframeDiv,
                  "Fullscreen element can only be iframe div");
               // during second run iframe won't have allow-pointer-lock flag and
-              // mozRequestPointerLock will fail, mozpointerlockerror should be fired
-              iframeDiv.mozRequestPointerLock();
+              // requestPointerLock will fail, pointerlockerror should be fired
+              iframeDiv.requestPointerLock();
             } else if (numberOfRuns === 1) {
               resetIframe();
             } else if (numberOfRuns === 2) {
               runTests();
             }
           });
 
         iframeDiv.requestFullscreen();
--- a/dom/tests/mochitest/pointerlock/file_changeLockElement.html
+++ b/dom/tests/mochitest/pointerlock/file_changeLockElement.html
@@ -52,64 +52,64 @@
       var tester = new ClickTester(block3);
       // It would be called in handler of load event in pointerlock_utils.js
       function start() {
         tester.synthesize(firstClick);
       }
 
       function firstClick(e) {
         is(e.target, block3, "Click is triggered inside block3");
-        document.addEventListener("mozpointerlockchange", lockedPointerOnBlock1);
-        block1.mozRequestPointerLock();
+        document.addEventListener("pointerlockchange", lockedPointerOnBlock1);
+        block1.requestPointerLock();
       }
 
       function lockedPointerOnBlock1() {
-        document.removeEventListener("mozpointerlockchange", lockedPointerOnBlock1);
-        is(document.mozPointerLockElement, block1, "Pointer should be locked on #block1");
+        document.removeEventListener("pointerlockchange", lockedPointerOnBlock1);
+        is(document.pointerLockElement, block1, "Pointer should be locked on #block1");
         SimpleTest.executeSoon(() => {
           tester.synthesize(secondClick);
         });
       }
 
       function secondClick(e) {
         is(e.target, block1, "Event should be redirected to block1");
         // Use 2s to ensure that we never consider this as an extension of user input.
         setTimeout(() => {
-          document.addEventListener("mozpointerlockchange", lockedPointerOnBlock2);
-          block2.mozRequestPointerLock();
+          document.addEventListener("pointerlockchange", lockedPointerOnBlock2);
+          block2.requestPointerLock();
         }, 2000);
       }
 
       function lockedPointerOnBlock2() {
-        document.removeEventListener("mozpointerlockchange", lockedPointerOnBlock2);
-        is(document.mozPointerLockElement, block2, "Pointer should be locked on #block2");
+        document.removeEventListener("pointerlockchange", lockedPointerOnBlock2);
+        is(document.pointerLockElement, block2, "Pointer should be locked on #block2");
         SimpleTest.executeSoon(() => {
           tester.synthesize(thirdClick);
         });
       }
 
       function thirdClick(e) {
         is(e.target, block2, "Event should be redirected to block2");
         // Use 2s to ensure that we never consider this as an extension of user input.
         setTimeout(() => {
-          document.addEventListener("mozpointerlockchange", lockedPointerOnBlock1Again);
-          block1.mozRequestPointerLock();
+          document.addEventListener("pointerlockchange", lockedPointerOnBlock1Again);
+          block1.requestPointerLock();
         }, 2000);
       }
 
       function lockedPointerOnBlock1Again() {
-        document.removeEventListener("mozpointerlockchange", lockedPointerOnBlock1Again);
-        is(document.mozPointerLockElement, block1, "Pointer should be locked on #block1 again");
+        document.removeEventListener("pointerlockchange", lockedPointerOnBlock1Again);
+        is(document.pointerLockElement, block1, "Pointer should be locked on #block1 again");
         SimpleTest.executeSoon(() => {
           tester.synthesize(fourthClick);
         });
       }
 
       function fourthClick(e) {
         is(e.target, block1, "Event should be redirected to block1 again");
-        document.addEventListener("mozpointerlockchange", () => SimpleTest.finish());
-        document.mozExitPointerLock();
+        document.addEventListener("pointerlockchange", () => SimpleTest.finish());
+        document.exitPointerLock();
       }
 
     </script>
   </div>
 </body>
 </html>
--- a/dom/tests/mochitest/pointerlock/file_childIframe.html
+++ b/dom/tests/mochitest/pointerlock/file_childIframe.html
@@ -59,76 +59,76 @@ https://bugzilla.mozilla.org/show_bug.cg
        */
 
       SimpleTest.waitForExplicitFinish();
 
       var parent = document.getElementById("parent")
         , childDiv = document.getElementById("childDiv")
         , iframe = document.getElementById("iframe");
 
-      function MozMovementStats() {
-        this.mozMovementX = false;
-        this.mozMovementY = false;
+      function MovementStats() {
+        this.movementX = false;
+        this.movementY = false;
       }
 
-      var firstMove = new MozMovementStats()
-        , secondMove = new MozMovementStats()
+      var firstMove = new MovementStats()
+        , secondMove = new MovementStats()
         , hoverIframe = false;
 
       function runTests () {
         ok(hoverIframe, "Pointer should be locked even when pointer " +
           "hovers over a child iframe");
-        is(firstMove.mozMovementX, secondMove.mozMovementX, "MovementX of first " +
+        is(firstMove.movementX, secondMove.movementX, "MovementX of first " +
           "move to childDiv should be equal to movementX of second move " +
           "to child div");
-        is(firstMove.mozMovementY, secondMove.mozMovementY, "MovementY of first " +
+        is(firstMove.movementY, secondMove.movementY, "MovementY of first " +
           "move to childDiv should be equal to movementY of second move " +
           "to child div");
       }
 
       var firstMoveChild = function (e) {
-        firstMove.mozMovementX = e.mozMovementX;
-        firstMove.mozMovementY = e.mozMovementY;
+        firstMove.movementX = e.movementX;
+        firstMove.movementY = e.movementY;
 
         parent.removeEventListener("mousemove", firstMoveChild);
         parent.addEventListener("mousemove", moveIframe);
 
         synthesizeMouseAtCenter(iframe, {type: "mousemove"}, window);
       };
 
       var moveIframe = function (e) {
-        hoverIframe = !!document.mozPointerLockElement;
+        hoverIframe = !!document.pointerLockElement;
 
         parent.removeEventListener("mousemove", moveIframe);
         parent.addEventListener("mousemove", secondMoveChild);
 
         synthesizeMouseAtCenter(childDiv, {type: "mousemove"}, window);
       };
 
       var secondMoveChild = function (e) {
-        secondMove.mozMovementX = e.mozMovementX;
-        secondMove.mozMovementY = e.mozMovementY;
+        secondMove.movementX = e.movementX;
+        secondMove.movementY = e.movementY;
         parent.removeEventListener("mousemove", secondMoveChild);
 
         addFullscreenChangeContinuation("exit", function() {
           runTests();
           SimpleTest.finish();
         });
         document.exitFullscreen();
       };
 
-      document.addEventListener("mozpointerlockchange", function () {
-        if (document.mozPointerLockElement === parent) {
+      document.addEventListener("pointerlockchange", function () {
+        if (document.pointerLockElement === parent) {
           parent.addEventListener("mousemove", firstMoveChild);
           synthesizeMouseAtCenter(childDiv, {type: "mousemove"}, window);
         }
       }, false);
 
       function start() {
         addFullscreenChangeContinuation("enter", function() {
-          parent.mozRequestPointerLock();
+          parent.requestPointerLock();
         });
         parent.requestFullscreen();
       }
     </script>
   </pre>
 </body>
 </html>
--- a/dom/tests/mochitest/pointerlock/file_doubleLock.html
+++ b/dom/tests/mochitest/pointerlock/file_doubleLock.html
@@ -19,48 +19,48 @@ https://bugzilla.mozilla.org/show_bug.cg
   <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=633602">
     Mozilla Bug 633602</a>
   <div id="div"></div>
   <pre id="test">
     <script type="text/javascript">
       /*
        * Test for Bug 633602
        * If element requests pointerlock on itself while in pointerlock state
-       * mozpointerlockchange event should be dispatched
+       * pointerlockchange event should be dispatched
        */
 
       SimpleTest.waitForExplicitFinish();
 
       var div = document.getElementById("div")
         , numberOfLocks = 0;
 
       function runTests () {
         is(numberOfLocks, 2, "Requesting pointer lock on a locked element " +
-          "should dispatch mozpointerlockchange event");
+          "should dispatch pointerlockchange event");
       }
 
-      document.addEventListener("mozpointerlockchange", function (e) {
-        if (document.mozPointerLockElement === div) {
+      document.addEventListener("pointerlockchange", function (e) {
+        if (document.pointerLockElement === div) {
           if (numberOfLocks === 2) {
             addFullscreenChangeContinuation("exit", function() {
               runTests();
               SimpleTest.finish();
             });
             document.exitFullscreen();
           }
           else {
             numberOfLocks++;
-            div.mozRequestPointerLock();
+            div.requestPointerLock();
           }
         }
       }, false);
 
       function start() {
         console.log('started');
         addFullscreenChangeContinuation("enter", function() {
-          div.mozRequestPointerLock();
+          div.requestPointerLock();
         });
         div.requestFullscreen();
       }
     </script>
   </pre>
 </body>
 </html>
--- a/dom/tests/mochitest/pointerlock/file_escapeKey.html
+++ b/dom/tests/mochitest/pointerlock/file_escapeKey.html
@@ -30,36 +30,36 @@
 
       function start() {
         addFullscreenChangeContinuation("enter", enteredFullscreen);
         div.requestFullscreen();
       }
 
       function enteredFullscreen(e) {
         is(document.fullscreenElement, div, "Element #div should entered fullscreen");
-        ok(!document.mozPointerLockElement, "Pointer shouldn't have been locked");
-        document.addEventListener("mozpointerlockchange", lockedPointer);
-        div.mozRequestPointerLock();
+        ok(!document.pointerLockElement, "Pointer shouldn't have been locked");
+        document.addEventListener("pointerlockchange", lockedPointer);
+        div.requestPointerLock();
       }
 
       function lockedPointer(e) {
-        document.removeEventListener("mozpointerlockchange", lockedPointer);
-        is(document.mozPointerLockElement, div, "Pointer should have been locked on #div");
-        document.addEventListener("mozpointerlockchange", unlockedPointer);
+        document.removeEventListener("pointerlockchange", lockedPointer);
+        is(document.pointerLockElement, div, "Pointer should have been locked on #div");
+        document.addEventListener("pointerlockchange", unlockedPointer);
         addFullscreenChangeContinuation("exit", leavedFullscreen);
         SimpleTest.executeSoon(() => synthesizeKey("VK_ESCAPE", {}));
       }
 
       var pointerUnlocked = false;
       var exitedFullscreen = false;
 
       function unlockedPointer() {
-        document.removeEventListener("mozpointerlockchange", unlockedPointer);
+        document.removeEventListener("pointerlockchange", unlockedPointer);
         ok(!pointerUnlocked, "Shouldn't have unlocked pointer before");
-        ok(!document.mozPointerLockElement, "Pointer should have been unlocked now");
+        ok(!document.pointerLockElement, "Pointer should have been unlocked now");
         pointerUnlocked = true;
         finishTest();
       }
 
       function leavedFullscreen() {
         ok(!exitedFullscreen, "Shouldn't have exited fullscreen before");
         ok(!document.fullscreenElement, "Should have exited fullscreen now");
         exitedFullscreen = true;
--- a/dom/tests/mochitest/pointerlock/file_infiniteMovement.html
+++ b/dom/tests/mochitest/pointerlock/file_infiniteMovement.html
@@ -17,19 +17,19 @@ https://bugzilla.mozilla.org/show_bug.cg
       href="https://bugzilla.mozilla.org/show_bug.cgi?id=633602">
       Mozilla Bug 633602
     </a>
     <div id="div"></div>
     <pre id="test">
       <script type="application/javascript">
         /*
          * Test for Bug 633602
-         * This test checks if mozMovementX and mozMovementY
+         * This test checks if movementX and movementY
          * are present in a mouse event object.
-         * It also checks the values for mozMovementXY.
+         * It also checks the values for movementXY.
          * They should be equal to the current screenXY minus
          * the last screenXY
          * This test will also test that the incremental movement is
          * not constrained to the width of the screen.
          */
 
         SimpleTest.waitForExplicitFinish();
 
@@ -68,36 +68,36 @@ https://bugzilla.mozilla.org/show_bug.cg
           addFullscreenChangeContinuation("exit", function() {
             info("Got fullscreenchange for exiting");
             runTests();
             SimpleTest.finish();
           });
           document.exitFullscreen();
         }
 
-        document.addEventListener("mozpointerlockchange", function (e) {
-          if (document.mozPointerLockElement === div) {
-            info("Got mozpointerlockchange for entering");
+        document.addEventListener("pointerlockchange", function (e) {
+          if (document.pointerLockElement === div) {
+            info("Got pointerlockchange for entering");
             div.addEventListener("mousemove", firstMoveListener, false);
 
             divCenterWidth = Math.round(div.getBoundingClientRect().width / 2);
             divCenterHeight = Math.round(div.getBoundingClientRect().height / 2);
 
             synthesizeMouse(div, divCenterWidth, divCenterHeight, {
               type: "mousemove"
             }, window);
           } else {
-            info("Got mozpointerlockchange for exiting");
+            info("Got pointerlockchange for exiting");
           }
         }, false);
 
         function start() {
           info("Requesting fullscreen on parent");
           addFullscreenChangeContinuation("enter", function() {
             info("Got fullscreenchange for entering");
-            div.mozRequestPointerLock();
+            div.requestPointerLock();
           });
           div.requestFullscreen();
         }
       </script>
     </pre>
   </body>
 </html>
--- a/dom/tests/mochitest/pointerlock/file_locksvgelement.html
+++ b/dom/tests/mochitest/pointerlock/file_locksvgelement.html
@@ -30,33 +30,33 @@
          * Test locking non-html element.
          */
 
         SimpleTest.waitForExplicitFinish(1);
 
         var elem,
           elemWasLocked = false;
 
-        document.addEventListener("mozpointerlockchange", function (e) {
+        document.addEventListener("pointerlockchange", function (e) {
           if (document.fullscreenElement &&
-              document.mozPointerLockElement === elem) {
+              document.pointerLockElement === elem) {
             elemWasLocked = true;
-            document.mozExitPointerLock();
+            document.exitPointerLock();
           } else {
             addFullscreenChangeContinuation("exit", function() {
               ok(elemWasLocked, "Expected SVG elem to become locked.");
               SimpleTest.finish();
             });
             document.exitFullscreen();
           }
         }, false);
 
         function start() {
           elem = document.getElementById("svg-elem");
           addFullscreenChangeContinuation("enter", function() {
-            elem.mozRequestPointerLock();
+            elem.requestPointerLock();
           });
           elem.requestFullscreen();
         }
       </script>
     </pre>
   </body>
 </html>
--- a/dom/tests/mochitest/pointerlock/file_nestedFullScreen.html
+++ b/dom/tests/mochitest/pointerlock/file_nestedFullScreen.html
@@ -34,43 +34,43 @@
       var parentDiv = document.getElementById("parentDiv")
         , childDiv = document.getElementById("childDiv")
         , parentDivLocked = false
         , parentDivFullScreen = false
         , pointerLocked = false;
 
       function runTests () {
         ok(parentDivLocked, "After requesting pointerlock on parentDiv " +
-          "document.mozPointerLockElement should be equal to " +
+          "document.pointerLockElement should be equal to " +
           " parentDiv element");
         isnot(pointerLocked, true, "Requesting fullscreen on " +
           "childDiv while parentDiv still in fullscreen should " +
           "unlock the pointer");
       }
 
-      document.addEventListener("mozpointerlockchange", function (e) {
-        if (document.mozPointerLockElement === parentDiv) {
+      document.addEventListener("pointerlockchange", function (e) {
+        if (document.pointerLockElement === parentDiv) {
           parentDivLocked = true;
           addFullscreenChangeContinuation("enter", function() {
-            pointerLocked = !!document.mozPointerLockElement;
+            pointerLocked = !!document.pointerLockElement;
             addFullscreenChangeContinuation("exit", function() {
               addFullscreenChangeContinuation("exit", function() {
                 runTests();
                 SimpleTest.finish();
               });
               document.exitFullscreen();
             });
             document.exitFullscreen();
           });
           childDiv.requestFullscreen();
         }
       }, false);
 
       function start() {
         addFullscreenChangeContinuation("enter", function() {
           parentDivFullScreen = true;
-          parentDiv.mozRequestPointerLock();
+          parentDiv.requestPointerLock();
         });
         parentDiv.requestFullscreen();
       }
     </script>
   </body>
 </html>
--- a/dom/tests/mochitest/pointerlock/file_pointerLockPref.html
+++ b/dom/tests/mochitest/pointerlock/file_pointerLockPref.html
@@ -33,43 +33,43 @@
 
         function runTests () {
           ok(prefEnabled, "Element should be able to lock the pointer " +
             "if pointer-lock pref is set to TRUE");
           ok(prefDisabled, "Element should NOT be able to lock the pointer " +
             "if pointer-lock pref is set to FALSE");
         }
 
-        document.addEventListener("mozpointerlockchange", function (e) {
-          if (document.mozPointerLockElement === div) {
+        document.addEventListener("pointerlockchange", function (e) {
+          if (document.pointerLockElement === div) {
             prefEnabled = true;
-            document.mozExitPointerLock();
+            document.exitPointerLock();
           }
           else {
             SpecialPowers.setBoolPref("full-screen-api.pointer-lock.enabled",
                                       false );
-            div.mozRequestPointerLock();
+            div.requestPointerLock();
           }
         }, false);
 
-        document.addEventListener("mozpointerlockerror", function (e) {
+        document.addEventListener("pointerlockerror", function (e) {
           prefDisabled = true;
           addFullscreenChangeContinuation("exit", function() {
             SpecialPowers.setBoolPref("full-screen-api.pointer-lock.enabled",
                                        true );
             runTests();
             SimpleTest.finish();
           });
           document.exitFullscreen();
         }, false);
 
         function start() {
           addFullscreenChangeContinuation("enter", function() {
             SpecialPowers.setBoolPref("full-screen-api.pointer-lock.enabled",
                                       true );
-            div.mozRequestPointerLock();
+            div.requestPointerLock();
           });
           div.requestFullscreen();
         }
       </script>
     </pre>
   </body>
 </html>
--- a/dom/tests/mochitest/pointerlock/file_pointerlock-api.html
+++ b/dom/tests/mochitest/pointerlock/file_pointerlock-api.html
@@ -32,73 +32,73 @@
         pointerLocked = false,
         hasExitPointerLock = false,
         pointerLockElement = false,
         hasMovementX = false,
         hasMovementY = false;
         gotContextMenuEvent = false;
 
       function runTests () {
-        ok(hasRequestPointerLock, "Element should have mozRequestPointerLock.");
+        ok(hasRequestPointerLock, "Element should have requestPointerLock.");
         ok(pointerLockChangeEventFired, "pointerlockchange event should fire.");
         ok(pointerUnlocked, "Should be able to unlock pointer locked element.");
         ok(pointerLocked, "Requested element should be able to lock.");
-        ok(hasExitPointerLock, "Document should have mozExitPointerLock");
+        ok(hasExitPointerLock, "Document should have exitPointerLock");
         ok(pointerLockElement, "Document should keep track of correct pointer locked element");
-        ok(hasMovementX, "Mouse Event should have mozMovementX.");
-        ok(hasMovementY, "Mouse Event should have mozMovementY.");
+        ok(hasMovementX, "Mouse Event should have movementX.");
+        ok(hasMovementY, "Mouse Event should have movementY.");
         ok(!gotContextMenuEvent, "Shouldn't have got a contextmenu event.");
       }
 
       function mouseMoveHandler(e) {
         info("Got mousemove");
         document.removeEventListener("mousemove", mouseMoveHandler, false);
 
-        hasMovementX = "mozMovementX" in e;
-        hasMovementY = "mozMovementY" in e;
+        hasMovementX = "movementX" in e;
+        hasMovementY = "movementY" in e;
 
-        hasExitPointerLock = "mozExitPointerLock" in document;
-        document.mozExitPointerLock();
+        hasExitPointerLock = "exitPointerLock" in document;
+        document.exitPointerLock();
       }
 
-      document.addEventListener("mozpointerlockchange", function (e) {
+      document.addEventListener("pointerlockchange", function (e) {
         pointerLockChangeEventFired = true;
 
-        if (document.mozPointerLockElement) {
-          info("Got mozpointerlockchange for entering");
+        if (document.pointerLockElement) {
+          info("Got pointerlockchange for entering");
           pointerLocked = true;
-          pointerLockElement = document.mozPointerLockElement === div;
+          pointerLockElement = document.pointerLockElement === div;
  
           window.addEventListener("contextmenu",
                                   function() { gotContextMenuEvent = true; },
                                   true);
           synthesizeMouse(document.body, 4, 4,
                           { type: "contextmenu", button: 2 },
                           window);
 
           document.addEventListener("mousemove", mouseMoveHandler, false);
           synthesizeMouseAtCenter(div, {type: "mousemove"}, window);
         } else {
-          info("Got mozpointerlockchange for exiting");
+          info("Got pointerlockchange for exiting");
           pointerUnlocked = true;
           addFullscreenChangeContinuation("exit", function() {
             info("Got fullscreenchange for exiting");
             runTests();
             SimpleTest.finish();
           });
           document.exitFullscreen();
         }
       }, false);
 
       function start() {
         div = document.getElementById("div");
         info("Requesting fullscreen on parent");
         addFullscreenChangeContinuation("enter", function() {
           info("Got fullscreenchange for entering");
-          hasRequestPointerLock = "mozRequestPointerLock" in div;
-          div.mozRequestPointerLock();
+          hasRequestPointerLock = "requestPointerLock" in div;
+          div.requestPointerLock();
         });
         div.requestFullscreen();
       }
     </script>
   </pre>
 </body>
 </html>
--- a/dom/tests/mochitest/pointerlock/file_pointerlockerror.html
+++ b/dom/tests/mochitest/pointerlock/file_pointerlockerror.html
@@ -20,22 +20,22 @@
     <script type="text/javascript">
       /*
        * Test for Bug 633602
        * Make sure pointerlockerror event fires.
        */
 
       SimpleTest.waitForExplicitFinish();
 
-      document.addEventListener("mozpointerlockerror", function (e) {
+      document.addEventListener("pointerlockerror", function (e) {
         ok(true, "pointerlockerror event should fire.");
         SimpleTest.finish();
       }, false);
 
       function start() {
         // element not in the DOM, not fullscreen, should fail to lock
         div = document.createElement("div");
-        div.mozRequestPointerLock();
+        div.requestPointerLock();
       }
     </script>
   </pre>
 </body>
 </html>
--- a/dom/tests/mochitest/pointerlock/file_removedFromDOM.html
+++ b/dom/tests/mochitest/pointerlock/file_removedFromDOM.html
@@ -38,50 +38,50 @@ function listenOneDocEvent(type, handler
     document.removeEventListener(type, callback);
     SimpleTest.executeSoon(() => handler(event));
   }
   document.addEventListener(type, callback);
 }
 
 function checkPointerLockElement(elem) {
   if (elem) {
-    is(document.mozPointerLockElement, elem,
+    is(document.pointerLockElement, elem,
        `#${elem.id} should have locked the pointer`);
   } else {
-    ok(!document.mozPointerLockElement, "Pointer should have been unlocked");
+    ok(!document.pointerLockElement, "Pointer should have been unlocked");
   }
 }
 
 function start() {
   addFullscreenChangeContinuation("enter", enteredFullscreen);
   document.documentElement.requestFullscreen();
 }
 
 function enteredFullscreen() {
   is(document.fullscreenElement, document.documentElement,
      "Root element should have entered fullscreen");
-  listenOneDocEvent("mozpointerlockchange", lockedPointerOnDiv);
-  div.mozRequestPointerLock();
+  listenOneDocEvent("pointerlockchange", lockedPointerOnDiv);
+  div.requestPointerLock();
 }
 
 function lockedPointerOnDiv() {
   checkPointerLockElement(div);
-  listenOneDocEvent("mozpointerlockchange", unlockedPointerFromDiv);
+  listenOneDocEvent("pointerlockchange", unlockedPointerFromDiv);
   document.body.removeChild(div);
 }
 
 function unlockedPointerFromDiv() {
   checkPointerLockElement(null);
-  listenOneDocEvent("mozpointerlockchange", lockedPointerOnInner);
-  inner.mozRequestPointerLock();
+  listenOneDocEvent("pointerlockchange", lockedPointerOnInner);
+  inner.requestPointerLock();
 }
 
 function lockedPointerOnInner() {
   checkPointerLockElement(inner);
-  listenOneDocEvent("mozpointerlockchange", unlockedPointerFromInner);
+  listenOneDocEvent("pointerlockchange", unlockedPointerFromInner);
   document.body.removeChild(outer);
 }
 
 function unlockedPointerFromInner() {
   checkPointerLockElement(null);
   addFullscreenChangeContinuation("exit", exitedFullscreen);
   document.exitFullscreen();
 }
--- a/dom/tests/mochitest/pointerlock/file_retargetMouseEvents.html
+++ b/dom/tests/mochitest/pointerlock/file_retargetMouseEvents.html
@@ -175,33 +175,33 @@ https://bugzilla.mozilla.org/show_bug.cg
             info("Got fullscreenchange for exiting");
             runTests();
             SimpleTest.finish();
           });
           document.exitFullscreen();
         });
       }
 
-      document.addEventListener("mozpointerlockchange", function (e) {
-        if (document.mozPointerLockElement === parent) {
-          info("Got mozpointerlockchange for entering");
+      document.addEventListener("pointerlockchange", function (e) {
+        if (document.pointerLockElement === parent) {
+          info("Got pointerlockchange for entering");
           parent.addEventListener("mousemove", startMouseTests);
           child.addEventListener("mousemove", childMoveTest);
           SimpleTest.executeSoon(function () {
             synthesizeMouseAtCenter(parent, {type: "mousemove"}, window);
           });
         } else {
-          info("Got mozpointerlockchange for exiting");
+          info("Got pointerlockchange for exiting");
         }
       }, false);
 
       function start() {
         info("Requesting fullscreen on parent");
         addFullscreenChangeContinuation("enter", function() {
           info("Got fullscreenchange for entering");
-          parent.mozRequestPointerLock();
+          parent.requestPointerLock();
         });
         parent.requestFullscreen();
       }
     </script>
   </pre>
 </body>
 </html>
--- a/dom/tests/mochitest/pointerlock/file_screenClientXYConst.html
+++ b/dom/tests/mochitest/pointerlock/file_screenClientXYConst.html
@@ -61,50 +61,50 @@ https://bugzilla.mozilla.org/show_bug.cg
           clientX: e.clientX,
           clientY: e.clientY
         };
 
         if (!firstCall) {
           return;
         }
 
-        isUnlocked = !document.mozPointerLockElement;
-        div.mozRequestPointerLock();
+        isUnlocked = !document.pointerLockElement;
+        div.requestPointerLock();
       }
 
       function moveLocked(e) {
         info("Got mousemove via moveLocked");
         div.removeEventListener("mousemove", moveLocked, false);
 
-        isLocked = !!document.mozPointerLockElement;
+        isLocked = !!document.pointerLockElement;
         lockedCoords = {
           screenX: e.screenX,
           screenY: e.screenY,
           clientX: e.clientX,
           clientY: e.clientY
         };
 
         addFullscreenChangeContinuation("exit", function() {
           info("Got fullscreenchange for exiting");
           runTests();
           SimpleTest.finish();
         });
         document.exitFullscreen();
       }
 
-      document.addEventListener("mozpointerlockchange", function (e) {
-        if (document.mozPointerLockElement === div) {
-          info("Got mozpointerlockchange for entering");
+      document.addEventListener("pointerlockchange", function (e) {
+        if (document.pointerLockElement === div) {
+          info("Got pointerlockchange for entering");
           div.removeEventListener("mousemove", moveUnlocked, false);
           div.addEventListener("mousemove", moveLocked, false);
           divRect = div.getBoundingClientRect();
           synthesizeNativeMouseMove(div, (divRect.width / 4) * 3,
                                     (divRect.height / 4) * 3);
         } else {
-          info("Got mozpointerlockchange for exiting");
+          info("Got pointerlockchange for exiting");
         }
       }, false);
 
       function start() {
         div = document.getElementById("div");
         info("Requesting fullscreen on parent");
         addFullscreenChangeContinuation("enter", function() {
           info("Got fullscreenchange for entering");
--- a/dom/tests/mochitest/pointerlock/file_suppressSomeMouseEvents.html
+++ b/dom/tests/mochitest/pointerlock/file_suppressSomeMouseEvents.html
@@ -67,19 +67,19 @@ https://bugzilla.mozilla.org/show_bug.cg
            "parent's mouseover should not be firing in Full Screen and Pointer Lock.");
         is(parentStats.mouseLeave, false,
            "parent's mouseleave should not be firing in Full Screen and Pointer Lock.");
         is(parentStats.mouseOut, false,
            "parent's mouseout should not be firing in Full Screen and Pointer Lock.");
       }
 
       var parentMoveListener = function () {
-        isPointerLocked = !!document.mozPointerLockElement;
+        isPointerLocked = !!document.pointerLockElement;
         removeEventListeners();
-        document.mozExitPointerLock();
+        document.exitPointerLock();
       };
 
       var parentOutListener = function (e) {
           parentStats.mouseOut = true;
       };
       var parentLeaveListener = function (e) {
           parentStats.mouseLeave = true;
       };
@@ -126,33 +126,33 @@ https://bugzilla.mozilla.org/show_bug.cg
         parent.removeEventListener("mouseenter", parentEnterListener, false);
 
         child.removeEventListener("mouseout", childOutListener, false);
         child.removeEventListener("mouseleave", childLeaveListener, false);
         child.removeEventListener("mouseover"  , childOverListener, false);
         child.removeEventListener("mouseenter", childEnterListener, false);
       }
 
-      document.addEventListener("mozpointerlockchange", function (e) {
-        if (document.mozPointerLockElement === parent) {
+      document.addEventListener("pointerlockchange", function (e) {
+        if (document.pointerLockElement === parent) {
           addEventListeners();
           synthesizeMouseAtCenter(child, { type: "mousemove" }, window);
         }
         else {
           addFullscreenChangeContinuation("exit", function() {
             runTests();
             SimpleTest.finish();
           });
           document.exitFullscreen();
         }
       }, false);
 
       function start() {
         parent = document.getElementById("parent");
         child = document.getElementById("child");
         addFullscreenChangeContinuation("enter", function() {
-          parent.mozRequestPointerLock();
+          parent.requestPointerLock();
         });
         parent.requestFullscreen();
       }
   </script>
 </body>
 </html>
--- a/dom/tests/mochitest/pointerlock/file_targetOutOfFocus.html
+++ b/dom/tests/mochitest/pointerlock/file_targetOutOfFocus.html
@@ -37,21 +37,21 @@
           , divPointerLock = false;
 
         function runTests () {
           ok(divPointerLock, "Pointer should be locked even if " +
             "the element being locked is not focused");
         }
 
         input.addEventListener("focus", function() {
-          div.mozRequestPointerLock();
+          div.requestPointerLock();
         }, false);
 
-        document.addEventListener("mozpointerlockchange", function (e) {
-          if (document.mozPointerLockElement === div) {
+        document.addEventListener("pointerlockchange", function (e) {
+          if (document.pointerLockElement === div) {
             divPointerLock = true;
             addFullscreenChangeContinuation("exit", function() {
               runTests();
               SimpleTest.finish();
             });
             document.exitFullscreen();
           }
         }, false);
--- a/dom/tests/mochitest/pointerlock/file_withoutDOM.html
+++ b/dom/tests/mochitest/pointerlock/file_withoutDOM.html
@@ -34,21 +34,21 @@
         var div = document.createElement("div")
           , withouthDOM = false;
 
         function runTests () {
           ok(withouthDOM, "If an element is NOT in the " +
             "DOM Tree pointer should NOT be locked");
         }
 
-        document.addEventListener("mozpointerlockerror", function (e) {
+        document.addEventListener("pointerlockerror", function (e) {
           withouthDOM = true;
           runTests();
           SimpleTest.finish();
         }, false);
 
         function start() {
-          div.mozRequestPointerLock();
+          div.requestPointerLock();
         }
       </script>
     </pre>
   </body>
 </html>