From 9b4696db565bbaa64b56956b7e535186247038e5 Mon Sep 17 00:00:00 2001 From: Olli Pettay Date: Sun, 24 Mar 2013 14:45:38 +0200 Subject: [PATCH] Bug 737100 - Extend Pointer Lock (Mouse Lock) for non-fullscreen elements, use capture phase for event listener, and add listener to browser --- browser/components/nsBrowserGlue.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/browser/components/nsBrowserGlue.js b/browser/components/nsBrowserGlue.js index f0f8a4cfe24..80b55fdd4ed 100644 --- a/browser/components/nsBrowserGlue.js +++ b/browser/components/nsBrowserGlue.js @@ -1647,7 +1647,6 @@ ContentPermissionPrompt.prototype = { var browserBundle = Services.strings.createBundle("chrome://browser/locale/browser.properties"); var requestingWindow = aRequest.window.top; - var topDoc = requestingWindow.document; var chromeWin = this._getChromeWindow(requestingWindow).wrappedJSObject; var browser = chromeWin.gBrowser.getBrowserForDocument(requestingWindow.document); var requestPrincipal = aRequest.principal; @@ -1701,7 +1700,7 @@ ContentPermissionPrompt.prototype = { options = { removeOnDismissal: autoAllow, eventCallback: function (type) { if (type == "removed") { - topDoc.removeEventListener("mozfullscreenchange", onFullScreen); + browser.removeEventListener("mozfullscreenchange", onFullScreen, true); if (autoAllow) aRequest.allow(); } @@ -1716,7 +1715,7 @@ ContentPermissionPrompt.prototype = { // upon exit), so if the page enters fullscreen mode after requesting // pointerLock (but before the user has granted permission), we should // remove the now-impotent notification. - topDoc.addEventListener("mozfullscreenchange", onFullScreen); + browser.addEventListener("mozfullscreenchange", onFullScreen, true); } },