Bug 1408026 - Opening of new tabs is slower if Activity Stream is enabled
MozReview-Commit-ID: CXEDtNOLPUE
--- a/browser/base/content/tabbrowser.xml
+++ b/browser/base/content/tabbrowser.xml
@@ -4514,28 +4514,33 @@
if (requestedBrowser.isRemoteBrowser) {
// If a tab is remote and the window is not minimized, we can show a
// blank tab instead of a spinner in the following cases:
//
// 1. The tab has just crashed, and we haven't started showing the
// tab crashed page yet (in this case, the TabParent is null)
// 2. The tab has never presented, and has not finished loading
// a non-local-about: page.
+ // 3. The request tab is about:newtab i.e we are opening a newtab. In
+ // this case we want to wait until it's loaded until we switch to it
+ // to avoid showing a flash before rendering content
//
// For (2), "finished loading a non-local-about: page" is
// determined by the busy state on the tab element and checking
// if the loaded URI is local.
let hasSufficientlyLoaded =
!this.requestedTab.hasAttribute("busy") &&
!this.tabbrowser._isLocalAboutURI(requestedBrowser.currentURI);
let fl = requestedBrowser.frameLoader;
+ let isNewTab = requestedBrowser.currentURI.spec === "about:newtab"
shouldBeBlank = !this.minimizedOrFullyOccluded &&
(!fl.tabParent ||
- (!hasSufficientlyLoaded && !fl.tabParent.hasPresented));
+ (!hasSufficientlyLoaded && !fl.tabParent.hasPresented)) &&
+ !isNewTab;
}
this.log("Tab should be blank: " + shouldBeBlank);
this.log("Requested tab is remote?: " + requestedBrowser.isRemoteBrowser);
// Figure out which tab we actually want visible right now.
let showTab = null;
if (requestedTabState != this.STATE_LOADED &&