Bug 1190903 - Make swapped browser docshell active. r=Gijs, a=ritu
authorBill McCloskey <billm@mozilla.com>
Tue, 18 Aug 2015 10:27:34 -0700
changeset 288926 a51a59900ffc722907248dffbc51816348baef85
parent 288925 ab92db58d5e8aa6545683fa16849f6e70877c78e
child 288927 d84ae094ebaf66830cbe1892e9daac1864cf9a7f
push id5067
push userraliiev@mozilla.com
push dateMon, 21 Sep 2015 14:04:52 +0000
treeherdermozilla-beta@14221ffe5b2f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersGijs, ritu
bugs1190903
milestone42.0a2
Bug 1190903 - Make swapped browser docshell active. r=Gijs, a=ritu
browser/base/content/tabbrowser.xml
--- a/browser/base/content/tabbrowser.xml
+++ b/browser/base/content/tabbrowser.xml
@@ -2557,16 +2557,19 @@
 
             // Unmap old outerWindowIDs.
             this._outerWindowIDBrowserMap.delete(ourBrowser.outerWindowID);
             let remoteBrowser = aOtherBrowser.ownerDocument.defaultView.gBrowser;
             if (remoteBrowser) {
               remoteBrowser._outerWindowIDBrowserMap.delete(aOtherBrowser.outerWindowID);
             }
 
+            aOtherBrowser.docShellIsActive = (ourBrowser == this.selectedBrowser &&
+                                              window.windowState != window.STATE_MINIMIZED);
+
             // Swap the docshells
             ourBrowser.swapDocShells(aOtherBrowser);
 
             if (ourBrowser.isRemoteBrowser) {
               // Switch outerWindowIDs for remote browsers.
               let ourOuterWindowID = ourBrowser._outerWindowID;
               ourBrowser._outerWindowID = aOtherBrowser._outerWindowID;
               aOtherBrowser._outerWindowID = ourOuterWindowID;