Bug 1394132 - Ensure we only handle focus event once. r?masayuki draft
authorSamael Wang <freesamael@gmail.com>
Tue, 29 Aug 2017 15:52:14 +0800
changeset 654844 9156cfe769704199f062e821cfe8b8c34c7888bd
parent 654592 1b4c59eef820b46eb0037aca68f83a15088db45f
child 728681 d8afb70296f86534d6945db71e6ff43394a93033
push id76702
push userbmo:sawang@mozilla.com
push dateTue, 29 Aug 2017 10:04:35 +0000
reviewersmasayuki
bugs1394132
milestone57.0a1
Bug 1394132 - Ensure we only handle focus event once. r?masayuki MozReview-Commit-ID: 6VoRMXpNco4
dom/tests/mochitest/pointerlock/file_targetOutOfFocus.html
--- a/dom/tests/mochitest/pointerlock/file_targetOutOfFocus.html
+++ b/dom/tests/mochitest/pointerlock/file_targetOutOfFocus.html
@@ -38,17 +38,17 @@
 
         function runTests () {
           ok(divPointerLock, "Pointer should be locked even if " +
             "the element being locked is not focused");
         }
 
         input.addEventListener("focus", function() {
           div.requestPointerLock();
-        });
+        }, { once: true });
 
         document.addEventListener("pointerlockchange", function (e) {
           if (document.pointerLockElement === div) {
             divPointerLock = true;
             addFullscreenChangeContinuation("exit", function() {
               runTests();
               SimpleTest.finish();
             });