Bug 1342927 - Async tab switcher updateDisplay() should only make the requested tab blank if it's in the loading state. r?billm draft
authorMike Conley <mconley@mozilla.com>
Sun, 05 Mar 2017 13:27:35 -0500
changeset 494223 4be37b77c2cdb7d9000feb64448a56863901701f
parent 494222 195fa092e0f24add5bc97a26982dcad0084e900c
child 494224 4f877b9cbd417d6d237567025a9f82899c04216f
push id47973
push usermconley@mozilla.com
push dateMon, 06 Mar 2017 21:13:44 +0000
reviewersbillm
bugs1342927
milestone54.0a1
Bug 1342927 - Async tab switcher updateDisplay() should only make the requested tab blank if it's in the loading state. r?billm MozReview-Commit-ID: Al6HwjxlETy
browser/base/content/tabbrowser.xml
--- a/browser/base/content/tabbrowser.xml
+++ b/browser/base/content/tabbrowser.xml
@@ -3900,22 +3900,25 @@
                 cancelable: true
               });
               this.tabbrowser.dispatchEvent(event);
             },
 
             // This function is called after all the main state changes to
             // make sure we display the right tab.
             updateDisplay() {
-              let shouldBeBlank = this.pendingTabChild.has(
-                this.requestedTab.linkedBrowser);
+              let requestedTabState = this.getTabState(this.requestedTab);
+
+              let shouldBeBlank =
+                this.pendingTabChild.has(this.requestedTab.linkedBrowser) &&
+                requestedTabState == this.STATE_LOADING;
 
               // Figure out which tab we actually want visible right now.
               let showTab = null;
-              if (this.getTabState(this.requestedTab) != this.STATE_LOADED &&
+              if (requestedTabState != this.STATE_LOADED &&
                   this.lastVisibleTab && this.loadTimer && !shouldBeBlank) {
                 // If we can't show the requestedTab, and lastVisibleTab is
                 // available, show it.
                 showTab = this.lastVisibleTab;
               } else {
                 // Show the requested tab. If it's not available, we'll show the spinner or a blank tab.
                 showTab = this.requestedTab;
               }
@@ -4311,16 +4314,18 @@
               this.setTabState(tab, this.STATE_LOADING);
             },
 
             // The tab for this browser isn't currently set
             // up in the content process, so we have no chance
             // of painting it right away. We'll paint a blank
             // tab instead.
             onTabChildNotReady(browser) {
+              this.assert(browser.isRemoteBrowser);
+
               let tab = this.tabbrowser.getTabForBrowser(browser);
 
               this.assert(this.getTabState(tab) == this.STATE_LOADING);
 
               this.logState(`onTabChildNotReady(${tab._tPos})`);
               this.pendingTabChild.add(browser);
               this.maybeFinishTabSwitch();