Bug 1380150 - Prevent subresource loads from showing the progress indicator on the tab. r?gijs draft
authorJared Wein <jwein@mozilla.com>
Fri, 08 Sep 2017 14:59:22 -0400
changeset 662137 cfc86eca5984767594a7390124a54462bfca6f80
parent 661528 6d0288c291650ab619dc4ff92cb0b60e3b6e7b3b
child 730756 9a9450b01a73a28fbf8b2815821386c6aa27997f
push id78963
push userbmo:jaws@mozilla.com
push dateMon, 11 Sep 2017 03:56:01 +0000
reviewersgijs
bugs1380150
milestone57.0a1
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;
                   }
                 }