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 234078 9664ebc4bf264e5163b9371a00cfafc0baa5f3db
parent 234077 43436dac11efa9ba5460e91529222b1cda2bec89
child 234079 85972aeeccf68d3c9669edf85aebfee9f32a6f07
push id1
push usersledru@mozilla.com
push dateThu, 04 Dec 2014 17:57:20 +0000
reviewersfelipe, lmandel
bugs1104221
milestone35.0a2
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
@@ -992,16 +992,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;