Bug 1038290 - Update the favicon when the href attribute of link rel="icon" is changed r=Neil AURORA_BASE_20140721
authorPhilip Chee <philip.chee@gmail.com>
Tue, 22 Jul 2014 04:34:21 +0800
changeset 20568 df9ba9a1282068d222ff0ca253453dcc3ac2e904
parent 20567 dcfc843590fc43bbdb4b4b839f47d3f289c33768
child 20569 7d27f1da9f0ce4b0527b3bc9c552376061cfe345
push id1209
push usermbanner@mozilla.com
push dateTue, 02 Sep 2014 16:59:36 +0000
treeherdercomm-beta@842e0fd167ee [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersNeil
bugs1038290
Bug 1038290 - Update the favicon when the href attribute of link rel="icon" is changed r=Neil
suite/browser/tabbrowser.xml
--- a/suite/browser/tabbrowser.xml
+++ b/suite/browser/tabbrowser.xml
@@ -1081,17 +1081,17 @@
               return;
 
             this.removeTab(event.target);
             event.stopPropagation();
           ]]>
         </body>
       </method>
 
-      <method name="onLinkAdded">
+      <method name="onLinkEvent">
         <parameter name="aEvent"/>
         <body>
           <![CDATA[
             var link = aEvent.originalTarget;
             var href = link.href;
             if (!href)
               return;
 
@@ -1106,16 +1106,19 @@
                          this.mPrefs.getBoolPref("browser.chrome.site_icons");
             if (isIcon) {
              var iconUri = this.getLinkIconURI(link);
              if (iconUri)
                this.setIcon(this.tabs[index], iconUri);
              return;
             }
 
+            if (aEvent.type == "DOMLinkChanged")
+              return;
+
             var isFeed = /(?:^|\s)feed(?:\s|$)/i.test(rel) ||
                          (/(?:^|\s)alternate(?:\s|$)/i.test(rel) &&
                           !/(?:^|\s)stylesheet(?:\s|$)/i.test(rel) &&
                           /^\s*application\/(?:atom|rss)\+xml\s*$/i.test(type));
 
             if (!isFeed)
               return;
 
@@ -2795,17 +2798,18 @@
                 onget="return this.tabContainer;"/>
       <property name="mTabs" readonly="true"
                 onget="return this.tabs;"/>
     </implementation>
 
     <handlers>
       <handler event="select" action="if (event.originalTarget == this.mPanelContainer) this.updateCurrentBrowser();"/>
 
-      <handler event="DOMLinkAdded" phase="capturing" action="this.onLinkAdded(event);"/>
+      <handler event="DOMLinkAdded" phase="capturing" action="this.onLinkEvent(event);"/>
+      <handler event="DOMLinkChanged" phase="capturing" action="this.onLinkEvent(event);"/>
 
       <handler event="DOMWindowClose" phase="capturing">
         <![CDATA[
           if (!event.isTrusted)
             return;
 
           if (this.tabs.length == 1)
             return;