Bug 587951 - Fix loop in escape/back key handling [r=mfinkle]
authorMatt Brubeck <mbrubeck@mozilla.com>
Tue, 17 Aug 2010 09:38:45 -0700
changeset 66449 80d4ad06e4038fe5228be18db6a1669f9d1bfc53
parent 66448 1b7ae6166091ffb00e0c154d32edd72d30eb25c2
child 66450 94614ab5efdef30566cef2d56dbfaf09404b797d
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmfinkle
bugs587951
Bug 587951 - Fix loop in escape/back key handling [r=mfinkle]
mobile/chrome/content/browser-ui.js
--- a/mobile/chrome/content/browser-ui.js
+++ b/mobile/chrome/content/browser-ui.js
@@ -644,17 +644,19 @@ var BrowserUI = {
 
   switchTask: function switchTask() {
     try {
       let phone = Cc["@mozilla.org/phone/support;1"].createInstance(Ci.nsIPhoneSupport);
       phone.switchTask();
     } catch(e) { }
   },
 
-  handleEscape: function () {
+  handleEscape: function (aEvent) {
+    aEvent.stopPropagation();
+
     // Check open dialogs
     let dialog = this.activeDialog;
     if (dialog) {
       dialog.close();
       return;
     }
 
     // Check open popups
@@ -705,17 +707,17 @@ var BrowserUI = {
         if (tabsVisibility > 0.0 && tabsVisibility < 1.0)
           Browser.hideSidebars();
 
         break;
       }
       // Window events
       case "keypress":
         if (aEvent.keyCode == aEvent.DOM_VK_ESCAPE)
-          this.handleEscape();
+          this.handleEscape(aEvent);
         break;
       case "AppCommand":
         aEvent.stopPropagation();
         switch (aEvent.command) {
           case "Menu":
             this.doCommand("cmd_menu");
             break;
           case "Search":