Bug 522240: Fix syntax errors in DOMWillOpenModalDialog handler [r=stechz]
authorMark Finkle <mfinkle@mozilla.com>
Wed, 14 Oct 2009 16:44:09 -0400
changeset 65668 57329841859c0ab1ee81bd4a69e7f2bf7a59a847
parent 65667 2a4e08db433654b9e58fcb387af4fd4b80fb21c2
child 65669 2aa41ed85084737ad439403eb39b7811ce665c15
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)
reviewersstechz
bugs522240
Bug 522240: Fix syntax errors in DOMWillOpenModalDialog handler [r=stechz]
mobile/chrome/content/browser-ui.js
--- a/mobile/chrome/content/browser-ui.js
+++ b/mobile/chrome/content/browser-ui.js
@@ -92,20 +92,21 @@ var BrowserUI = {
 
   _domWillOpenModalDialog: function(e) {
     if (!e.isTrusted)
       return;
 
     // We're about to open a modal dialog, make sure the opening
     // tab is brought to the front.
 
-    let aWindow = e.target.top;
-    for (let i = 0; i <= Browser._tabs.length; i++) {
-      if (Browser._tabs[i].browser.contentWindow == aWindow) {
+    let window = e.target.top;
+    for (let i = 0; i < Browser._tabs.length; i++) {
+      if (Browser._tabs[i].browser.contentWindow == window) {
         Browser.selectedTab = Browser._tabs[i];
+        break;
       }
     }
   },
 
   _titleChanged : function(aDocument) {
     var browser = Browser.selectedBrowser;
     if (browser && aDocument != browser.contentDocument)
       return;