From d4fae9481d08fcd8cd8e84f66db99c7084a677b3 Mon Sep 17 00:00:00 2001 From: Matt Brubeck Date: Wed, 10 Nov 2010 21:00:09 -0800 Subject: [PATCH] Bug 598331 - Fix pinch zoom regression [r=mfinkle] --- mobile/chrome/content/browser.js | 2 +- mobile/chrome/content/input.js | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/mobile/chrome/content/browser.js b/mobile/chrome/content/browser.js index df7d486681fe..cbedada675f3 100644 --- a/mobile/chrome/content/browser.js +++ b/mobile/chrome/content/browser.js @@ -197,7 +197,7 @@ var Browser = { let keySender = new ContentCustomKeySender(Elements.browsers); let mouseModule = new MouseModule(); - let gestureModule = new GestureModule(); + let gestureModule = new GestureModule(Elements.browsers); let scrollWheelModule = new ScrollwheelModule(Elements.browsers); ContentTouchHandler.init(); diff --git a/mobile/chrome/content/input.js b/mobile/chrome/content/input.js index c635490abbe4..ab12dffaa6d7 100644 --- a/mobile/chrome/content/input.js +++ b/mobile/chrome/content/input.js @@ -981,12 +981,12 @@ ScrollwheelModule.prototype = { // chrome-only, we must listen for the simple gesture events during // the capturing phase and call stopPropagation on every event. -function GestureModule() { - window.addEventListener("MozSwipeGesture", this, true); - window.addEventListener("MozMagnifyGestureStart", this, true); - window.addEventListener("MozMagnifyGestureUpdate", this, true); - window.addEventListener("MozMagnifyGesture", this, true); - window.addEventListener("CancelTouchSequence", this, true); +function GestureModule(aElement) { + aElement.addEventListener("MozSwipeGesture", this, true); + aElement.addEventListener("MozMagnifyGestureStart", this, true); + aElement.addEventListener("MozMagnifyGestureUpdate", this, true); + aElement.addEventListener("MozMagnifyGesture", this, true); + aElement.addEventListener("CancelTouchSequence", this, true); } GestureModule.prototype = { @@ -1072,7 +1072,7 @@ GestureModule.prototype = { event.initEvent("CancelTouchSequence", true, true); let success = aEvent.target.dispatchEvent(event); - if (!success || (aEvent.target instanceof XULElement) || !Browser.selectedTab.allowZoom) + if (!success || !Browser.selectedTab.allowZoom) return; // create the AnimatedZoom object for fast arbitrary zooming