Bug 1397426 - Make async tab switcher use new nsITabParent renderLayers function. r?billm draft
authorMike Conley <mconley@mozilla.com>
Mon, 25 Sep 2017 13:54:02 -0400
changeset 672194 2996e8471c1c130f59267d091ef3da7933de0105
parent 671252 0387b1614c29903ecb0687f6ad5621ae9976dff9
child 672195 61a3d4a3426fda249e402002692fb047b8924835
push id82187
push userbmo:mconley@mozilla.com
push dateThu, 28 Sep 2017 22:04:21 +0000
reviewersbillm
bugs1397426
milestone57.0a1
Bug 1397426 - Make async tab switcher use new nsITabParent renderLayers function. r?billm MozReview-Commit-ID: Go2EdMXGwa7
browser/base/content/tabbrowser.xml
--- a/browser/base/content/tabbrowser.xml
+++ b/browser/base/content/tabbrowser.xml
@@ -4334,24 +4334,27 @@
 
             setTabState(tab, state) {
               this.setTabStateNoAction(tab, state);
 
               let browser = tab.linkedBrowser;
               let {tabParent} = browser.frameLoader;
               if (state == this.STATE_LOADING) {
                 this.assert(!this.minimizedOrFullyOccluded);
-                browser.docShellIsActive = true;
-                if (!tabParent) {
+                if (tabParent) {
+                  tabParent.renderLayers(true);
+                } else {
                   this.onLayersReady(browser);
                 }
               } else if (state == this.STATE_UNLOADING) {
+                browser.docShellIsActive = false;
                 this.unwarmTab(tab);
-                browser.docShellIsActive = false;
-                if (!tabParent) {
+                if (tabParent) {
+                  tabParent.renderLayers(false);
+                } else {
                   this.onLayersCleared(browser);
                 }
               }
 
               if (!tab.linkedBrowser.isRemoteBrowser) {
                 // setTabState is potentially re-entrant in the non-remote case,
                 // so we must re-get the state for this assertion.
                 let nonRemoteState = this.getTabState(tab);
@@ -4543,16 +4546,17 @@
                 }
                 this.spinnerTab = showTab;
                 this.tabbrowser.setAttribute("pendingpaint", "true");
                 this.spinnerTab.linkedBrowser.setAttribute("pendingpaint", "true");
               }
 
               // Switch to the tab we've decided to make visible.
               if (this.visibleTab !== showTab) {
+                showTab.linkedBrowser.docShellIsActive = true;
                 this.tabbrowser._adjustFocusBeforeTabSwitch(this.visibleTab, showTab);
                 this.visibleTab = showTab;
 
                 this.maybeVisibleTabs.add(showTab);
 
                 let tabs = this.tabbrowser.mTabBox.tabs;
                 let tabPanel = this.tabbrowser.mPanelContainer;
                 let showPanel = tabs.getRelatedElement(showTab);