Bug 1256472 - Account for the possibility that the selectedTab has not yet presented when initting async tab switcher. r?billm
MozReview-Commit-ID: 1mXffrdUBOE
--- a/browser/base/content/tabbrowser.xml
+++ b/browser/base/content/tabbrowser.xml
@@ -3828,18 +3828,26 @@
window.addEventListener("MozAfterPaint", this);
window.addEventListener("MozLayerTreeReady", this);
window.addEventListener("MozLayerTreeCleared", this);
window.addEventListener("TabRemotenessChange", this);
window.addEventListener("sizemodechange", this);
window.addEventListener("SwapDocShells", this, true);
window.addEventListener("EndSwapDocShells", this, true);
window.addEventListener("MozTabChildNotReady", this, true);
+
+ let tab = this.requestedTab;
+ let browser = tab.linkedBrowser;
+ let tabIsLoaded = !browser.isRemoteBrowser ||
+ browser.frameLoader.tabParent.hasPresented;
+
if (!this.minimized) {
- this.setTabState(this.requestedTab, this.STATE_LOADED);
+ this.log("Initial tab is loaded?: " + tabIsLoaded);
+ this.setTabState(tab, tabIsLoaded ? this.STATE_LOADED
+ : this.STATE_LOADING);
}
},
destroy() {
if (this.unloadTimer) {
this.clearTimer(this.unloadTimer);
this.unloadTimer = null;
}