Bug 1394132 - Ensure we only handle focus event once. r=masayuki
authorSamael Wang <freesamael@gmail.com>
Tue, 29 Aug 2017 15:52:14 +0800
changeset 377808 4722bf29a1768a4a55608387ad73c5cdb5f59517
parent 377807 1575ef52aa22187b4cefbea002e19943fc2c7c93
child 377809 3c2a787cc5a20350a5f549217e4dd7706f2bdeef
push id94338
push userkwierso@gmail.com
push dateThu, 31 Aug 2017 02:58:58 +0000
treeherdermozilla-inbound@9ca18987dabb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmasayuki
bugs1394132
milestone57.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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();
             });