Bug 1104221 - Search drop down shows the icon of the previous default engine if the new default doesn't have an icon. r=felipe, a=lmandel
authorFlorian Quèze <florian@queze.net>
Mon, 24 Nov 2014 20:24:19 +0100
changeset 226145 7b937b21452d5d314b741f836b410b65d1624da8
parent 226144 ad1b0b9af31ea2ba47ae239f29570daa376b176a
child 226146 5feb7c5bfa27f3a7f34a92f85be73c4c3e9000ca
child 258787 01cac0e2c3963d13b1b4629f466f7a2c68cca0f2
push id4179
push userryanvm@gmail.com
push dateMon, 24 Nov 2014 20:43:07 +0000
treeherdermozilla-beta@7b937b21452d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfelipe, lmandel
bugs1104221
milestone34.0
Bug 1104221 - Search drop down shows the icon of the previous default engine if the new default doesn't have an icon. r=felipe, a=lmandel
browser/base/content/urlbarBindings.xml
--- a/browser/base/content/urlbarBindings.xml
+++ b/browser/base/content/urlbarBindings.xml
@@ -952,16 +952,21 @@
 
         // Show the current default engine in the top header of the panel.
         let currentEngine = Services.search.currentEngine;
         let uri = currentEngine.iconURI;
         if (uri) {
           uri = uri.spec;
           this.setAttribute("src", PlacesUtils.getImageURLForResolution(window, uri));
         }
+        else {
+          // If the default has just been changed to a provider without icon,
+          // avoid showing the icon of the previous default provider.
+          this.removeAttribute("src");
+        }
         document.getAnonymousElementByAttribute(this, "anonid", "searchbar-engine-name")
                 .setAttribute("value", currentEngine.name + " Search");
 
         // Update the 'Search for <keywords> with:" header.
         let headerSearchText =
           document.getAnonymousElementByAttribute(this, "anonid",
                                                   "searchbar-oneoffheader-searchtext");
         let textbox = searchbar.textbox;