Bug 1378203 - Use canPresent in tabbrowser.xml to determine if we can blank out a tab before switching to it. r?billm
MozReview-Commit-ID: CJEIJYlRHam
--- a/browser/base/content/tabbrowser.xml
+++ b/browser/base/content/tabbrowser.xml
@@ -4212,30 +4212,21 @@
// tab instead and focusing it immediately.
let shouldBeBlank = false;
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.
- //
- // 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);
-
+ // 2. The tab has never presented, and has not yet reported that it
+ // has enough information to paint something.
let fl = requestedBrowser.frameLoader;
- shouldBeBlank = !this.minimizedOrFullyOccluded &&
- (!fl.tabParent ||
- (!hasSufficientlyLoaded && !fl.tabParent.hasPresented));
+ let presentable = fl.tabParent && fl.tabParent.canPresent
+ shouldBeBlank = !this.minimizedOrFullyOccluded && !presentable;
}
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 &&