Bug 1214624 - tabBrowser should remove the audio icon when location changes, r=jaws, r=mak77
authorAndrea Marchesini <amarchesini@mozilla.com>
Tue, 24 Nov 2015 19:17:30 +0000
changeset 274083 72cf0adcfb2796c1e7b439e1851144fb818e1469
parent 274082 6e50570f07826b246150a5547bad1e71d0aeb977
child 274084 cbc2c8a244380a83ba857d0c315462490b1652e8
push id29721
push usercbook@mozilla.com
push dateWed, 25 Nov 2015 11:52:17 +0000
treeherdermozilla-central@1835baed2a38 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjaws, mak77
bugs1214624
milestone45.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 1214624 - tabBrowser should remove the audio icon when location changes, r=jaws, r=mak77
browser/base/content/tabbrowser.xml
--- a/browser/base/content/tabbrowser.xml
+++ b/browser/base/content/tabbrowser.xml
@@ -644,26 +644,16 @@
                 // We need to add 2 because loadURIWithFlags may have
                 // cancelled a pending load which would have cleared
                 // its anchor scroll detection temporary increment.
                 if (aWebProgress.isTopLevel) {
                   this.mBrowser.userTypedClear += 2;
 
                   // If the browser is loading it must not be crashed anymore
                   this.mTab.removeAttribute("crashed");
-
-                  // If the browser was playing audio, we should remove the playing state.
-                  if (this.mTab.hasAttribute("soundplaying")) {
-                    this.mTab.removeAttribute("soundplaying");
-                    this.mTabBrowser._tabAttrModified(this.mTab, ["soundplaying"]);
-                  }
-                  // If the browser was previously muted, we should restore the muted state.
-                  if (this.mTab.hasAttribute("muted")) {
-                    this.mTab.linkedBrowser.mute();
-                  }
                 }
 
                 if (this._shouldShowProgress(aRequest)) {
                   if (!(aStateFlags & nsIWebProgressListener.STATE_RESTORING)) {
                     this.mTab.setAttribute("busy", "true");
                     if (!(aWebProgress.loadType & Ci.nsIDocShell.LOAD_CMD_RELOAD))
                       this.mTabBrowser.setTabTitleLoading(this.mTab);
                   }
@@ -761,25 +751,38 @@
                 // failed URI (particularly for SSL errors). However, don't clear the value
                 // if the error page's URI is about:blank, because that causes complete
                 // loss of urlbar contents for invalid URI errors (see bug 867957).
                 // Another reason to clear the userTypedValue is if this was an anchor
                 // navigation.
                 if (this.mBrowser.userTypedClear > 0 ||
                     ((aFlags & Ci.nsIWebProgressListener.LOCATION_CHANGE_ERROR_PAGE) &&
                      aLocation.spec != "about:blank") ||
-                     aFlags && Ci.nsIWebProgressListener.LOCATION_CHANGE_SAME_DOCUMENT)
+                     aFlags && Ci.nsIWebProgressListener.LOCATION_CHANGE_SAME_DOCUMENT) {
                   this.mBrowser.userTypedValue = null;
+                }
+
+                // If the browser was playing audio, we should remove the playing state.
+                if (this.mTab.hasAttribute("soundplaying")) {
+                  this.mTab.removeAttribute("soundplaying");
+                  this.mTabBrowser._tabAttrModified(this.mTab, ["soundplaying"]);
+                }
+
+                // If the browser was previously muted, we should restore the muted state.
+                if (this.mTab.hasAttribute("muted")) {
+                  this.mTab.linkedBrowser.mute();
+                }
 
                 if (this.mTabBrowser.isFindBarInitialized(this.mTab)) {
                   let findBar = this.mTabBrowser.getFindBar(this.mTab);
 
                   // Close the Find toolbar if we're in old-style TAF mode
-                  if (findBar.findMode != findBar.FIND_NORMAL)
+                  if (findBar.findMode != findBar.FIND_NORMAL) {
                     findBar.close();
+                  }
 
                   // fix bug 253793 - turn off highlight when page changes
                   findBar.getElement("highlight").checked = false;
                 }
 
                 // Don't clear the favicon if this onLocationChange was
                 // triggered by a pushState or a replaceState.  See bug 550565.
                 if (aWebProgress.isLoadingDocument &&