Bug 998171 Clear the Aero Peek favicon when the document changes r=mcsmurf a=Ratty SEA_2_26_1_RELBRANCH
authorNeil Rashbrook <neil@parkwaycc.co.uk>
Mon, 02 Jun 2014 00:10:24 +0100
branchSEA_2_26_1_RELBRANCH
changeset 31071 aa67f2715fd3c391343eaf7e1b470fd553fdffce
parent 31070 6f6c5df761b9fdbdd4598d191a2affbeb3ba7858
child 31072 ba5a407b0217b96adc79f2d21ddff100147c0e36
push id1
push userclokep@gmail.com
push dateMon, 07 May 2018 22:45:56 +0000
treeherdercomm-esr60@57eacde5ef40 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmcsmurf, Ratty
bugs998171
Bug 998171 Clear the Aero Peek favicon when the document changes r=mcsmurf a=Ratty
suite/browser/nsBrowserStatusHandler.js
suite/browser/tabbrowser.xml
--- a/suite/browser/nsBrowserStatusHandler.js
+++ b/suite/browser/nsBrowserStatusHandler.js
@@ -155,17 +155,18 @@ nsBrowserStatusHandler.prototype =
   {
     this.feeds.push(aLink);
     this.feedsMenu.removeAttribute("disabled");
     this.feedsButton.hidden = false;
   },
 
   onLinkIconAvailable : function(aHref)
   {
-    if (gProxyFavIcon && Services.prefs.getBoolPref("browser.chrome.site_icons")) {
+    if (aHref && gProxyFavIcon &&
+        Services.prefs.getBoolPref("browser.chrome.site_icons")) {
       var browser = getBrowser();
       if (browser.userTypedValue === null)
         gProxyFavIcon.setAttribute("src", aHref);
     }
   },
 
   onProgressChange : function (aWebProgress, aRequest,
                                aCurSelfProgress, aMaxSelfProgress,
--- a/suite/browser/tabbrowser.xml
+++ b/suite/browser/tabbrowser.xml
@@ -542,17 +542,17 @@
             // The first location change is gotoIndex called from mInstallSH,
             // the second one is considered a user action.
             mLocationChangeCount : 0,
 
             onLocationChange: function(aWebProgress, aRequest, aLocation, aFlags) {
               const nsIWebProgressListener = Components.interfaces.nsIWebProgressListener;
               if (aWebProgress.isTopLevel) {
                 if (!(aFlags & nsIWebProgressListener.LOCATION_CHANGE_SAME_DOCUMENT)) {
-                  this.mBrowser.mIconURL = "";
+                  this.mTabBrowser.setIcon(this.mTab, "");
                   this.mFeeds = [];
                 }
 
                 if (this.mLocationChangeCount > 0 ||
                     aLocation.spec != "about:blank")
                   ++this.mLocationChangeCount;
 
                 if (this.mLocationChangeCount == 2) {
@@ -708,19 +708,23 @@
       </method>
 
       <method name="setIcon">
         <parameter name="aTab"/>
         <parameter name="aURI"/>
         <body>
           <![CDATA[
             var browser = aTab.linkedBrowser;
-            if (!(aURI instanceof Components.interfaces.nsIURI))
-              aURI = this.mIOService.newURI(aURI, null, null);
-            browser.mIconURL = aURI.spec;
+            if (!aURI)
+              browser.mIconURL = "";
+            else {
+              if (!(aURI instanceof Components.interfaces.nsIURI))
+                aURI = this.mIOService.newURI(aURI, null, null);
+              browser.mIconURL = aURI.spec;
+            }
 
             if (aURI && this.mFaviconService) {
               var faviconFlags = this.usePrivateBrowsing ?
                   this.mFaviconService.FAVICON_LOAD_PRIVATE :
                   this.mFaviconService.FAVICON_LOAD_NON_PRIVATE;
               this.mFaviconService.setAndFetchFaviconForPage(browser.currentURI,
                                                              aURI, false,
                                                              faviconFlags);