Bug 463363 - ctrlTab event handler should ignore events from nested popups, e.g. context menus. r=gavin
authorDão Gottwald <dao@mozilla.com>
Thu, 06 Nov 2008 19:45:48 +0100
changeset 21386 bd37f61d0b0bacf82739776d93d29984a5a84b7b
parent 21385 a4343d61f6ee3f7014a061c5fc8823636c6cae21
child 21387 40d02210c6c57b8003f3019e4a6db4af0383f881
push id3522
push userdgottwald@mozilla.com
push dateThu, 06 Nov 2008 18:46:04 +0000
treeherdermozilla-central@bd37f61d0b0b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgavin
bugs463363
milestone1.9.1b2pre
Bug 463363 - ctrlTab event handler should ignore events from nested popups, e.g. context menus. r=gavin
browser/base/content/browser-tabPreviews.js
--- a/browser/base/content/browser-tabPreviews.js
+++ b/browser/base/content/browser-tabPreviews.js
@@ -626,22 +626,25 @@ var ctrlTab = {
         }
 
         if (!this.sticky &&
             event.type == "keyup" &&
             event.keyCode == event.DOM_VK_CONTROL)
           this.selectThumbnail();
         break;
       case "popupshown":
-        if (this.sticky)
+        if (this.sticky && event.target == this.panel)
           this.searchField.focus();
         break;
       case "popuphiding":
-        this.onPopupHiding();
+        if (event.target == this.panel)
+          this.onPopupHiding();
         break;
       case "popuphidden":
-        // Destroy the widget in order to prevent outdated content
-        // when re-opening the panel.
-        this.panel.hidden = true;
+        if (event.target == this.panel) {
+          // Destroy the widget in order to prevent outdated content
+          // when re-opening the panel.
+          this.panel.hidden = true;
+        }
         break;
     }
   }
 };