Bug 1378203 - Make async tabswitcher use nsITabParent.canPresent when determining if a tab can be blanked out. r?billm draft
authorMike Conley <mconley@mozilla.com>
Fri, 25 Aug 2017 14:45:13 -0700
changeset 653367 3ff002dac721366fc66e2150e14f3fc18a3cca88
parent 653366 beb5417f807758eb9b21f260cc164cf1f9c98bac
child 728324 0fc6ee9cfbae80af062b9929b69080f46da30a42
push id76311
push userbmo:mconley@mozilla.com
push dateFri, 25 Aug 2017 21:46:47 +0000
reviewersbillm
bugs1378203
milestone57.0a1
Bug 1378203 - Make async tabswitcher use nsITabParent.canPresent when determining if a tab can be blanked out. r?billm MozReview-Commit-ID: AIHA1Rf6OcJ
browser/base/content/tabbrowser.xml
--- a/browser/base/content/tabbrowser.xml
+++ b/browser/base/content/tabbrowser.xml
@@ -4298,30 +4298,24 @@
               // 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.
+                // 2. The tab has never presented, and has not finished initializing
+                //    rendering in the content process.
+                let fl = requestedBrowser.frameLoader;
+
                 let hasSufficientlyLoaded =
-                  !this.requestedTab.hasAttribute("busy") &&
-                  !this.tabbrowser._isLocalAboutURI(requestedBrowser.currentURI);
-
-                let fl = requestedBrowser.frameLoader;
-                shouldBeBlank = !this.minimizedOrFullyOccluded &&
-                                (!fl.tabParent ||
-                                 (!hasSufficientlyLoaded && !fl.tabParent.hasPresented));
+                  fl.tabParent && (fl.tabParent.hasPresented || fl.tabParent.canPresent);
+
+                shouldBeBlank = !this.minimizedOrFullyOccluded && !hasSufficientlyLoaded;
               }
 
               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 &&