Bug 1380150 - Prevent subresource loads from showing the progress indicator on the tab. r=Gijs
authorJared Wein <jwein@mozilla.com>
Fri, 08 Sep 2017 14:59:22 -0400
changeset 379994 c9fe4ec27ca3de145712f848a7ef8deeb2f8870f
parent 379993 38e3ac4eee425ead861938e5406466ba585cc48b
child 379995 1cc09280f38cb9f8d81182134ca39c488107cbc8
push id32473
push userarchaeopteryx@coole-files.de
push dateMon, 11 Sep 2017 09:16:55 +0000
treeherdermozilla-central@1f1893590a1d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersGijs
bugs1380150
milestone57.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1380150 - Prevent subresource loads from showing the progress indicator on the tab. r=Gijs MozReview-Commit-ID: JjZiHp2IXTC
browser/base/content/tabbrowser.xml
--- a/browser/base/content/tabbrowser.xml
+++ b/browser/base/content/tabbrowser.xml
@@ -664,17 +664,17 @@
             onProgressChange(aWebProgress, aRequest,
                              aCurSelfProgress, aMaxSelfProgress,
                              aCurTotalProgress, aMaxTotalProgress) {
               this.mTotalProgress = aMaxTotalProgress ? aCurTotalProgress / aMaxTotalProgress : 0;
 
               if (!this._shouldShowProgress(aRequest))
                 return;
 
-              if (this.mTotalProgress)
+              if (this.mTotalProgress && aWebProgress && aWebProgress.isTopLevel)
                 this.mTab.setAttribute("progress", "true");
 
               this._callProgressListeners("onProgressChange",
                                           [aWebProgress, aRequest,
                                            aCurSelfProgress, aMaxSelfProgress,
                                            aCurTotalProgress, aMaxTotalProgress]);
             },
 
@@ -751,17 +751,18 @@
                     this.mBrowser.urlbarChangeTracker.startedLoad();
                   }
                   delete this.mBrowser.initialPageLoadedFromURLBar;
                   // If the browser is loading it must not be crashed anymore
                   this.mTab.removeAttribute("crashed");
                 }
 
                 if (this._shouldShowProgress(aRequest)) {
-                  if (!(aStateFlags & nsIWebProgressListener.STATE_RESTORING)) {
+                  if (!(aStateFlags & nsIWebProgressListener.STATE_RESTORING) &&
+                      aWebProgress && aWebProgress.isTopLevel) {
                     this.mTab.setAttribute("busy", "true");
                     this._syncThrobberAnimations();
                   }
 
                   if (this.mTab.selected) {
                     this.mTabBrowser.mIsBusy = true;
                   }
                 }