Bug 1121802 - Only add #-moz-resolution to favicon URIs that end in ".ico". r=Unfocused, a=sledru
authorSeth Fowler <seth@mozilla.com>
Sat, 17 Jan 2015 00:38:41 -0800
changeset 242967 d00b4a85897c
parent 242966 a7f164f7c32d
child 242968 57cb206153af
push id4350
push userryanvm@gmail.com
push date2015-01-21 19:56 +0000
treeherdermozilla-beta@4501fcac9e0b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersUnfocused, sledru
bugs1121802
milestone36.0
Bug 1121802 - Only add #-moz-resolution to favicon URIs that end in ".ico". r=Unfocused, a=sledru
toolkit/components/places/PlacesUtils.jsm
toolkit/content/widgets/autocomplete.xml
--- a/toolkit/components/places/PlacesUtils.jsm
+++ b/toolkit/components/places/PlacesUtils.jsm
@@ -1485,16 +1485,19 @@ this.PlacesUtils = {
    *
    * @param aHeight
    *        The target image height
    *
    * @return The URL with the fragment at the end
    */
   getImageURLForResolution:
   function PU_getImageURLForResolution(aWindow, aURL, aWidth = 16, aHeight = 16) {
+    if (!aURL.endsWith('.ico') && !aURL.endsWith('.ICO')) {
+      return aURL;
+    }
     let width  = Math.round(aWidth * aWindow.devicePixelRatio);
     let height = Math.round(aHeight * aWindow.devicePixelRatio);
     return aURL + (aURL.contains("#") ? "&" : "#") +
            "-moz-resolution=" + width + "," + height;
   },
 
   /**
    * Get the unique id for an item (a bookmark, a folder or a separator) given
--- a/toolkit/content/widgets/autocomplete.xml
+++ b/toolkit/content/widgets/autocomplete.xml
@@ -1107,16 +1107,19 @@ extends="chrome://global/content/binding
 
       <method name="_getImageURLForResolution">
         <parameter name="aWin"/>
         <parameter name="aURL"/>
         <parameter name="aWidth"/>
         <parameter name="aHeight"/>
         <body>
           <![CDATA[
+          if (!aURL.endsWith('.ico') && !aURL.endsWith('.ICO')) {
+            return aURL;
+          }
           let width  = Math.round(aWidth * aWin.devicePixelRatio);
           let height = Math.round(aHeight * aWin.devicePixelRatio);
           return aURL + (aURL.contains("#") ? "&" : "#") +
                  "-moz-resolution=" + width + "," + height;
           ]]>
         </body>
       </method>