Bug 1208141 - r=ttaubert, a=al
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Fri, 25 Sep 2015 08:43:28 +0100
changeset 296157 7970459fa07d07e7dac5bfdb138f2ca53db00ed5
parent 296156 d5adbfd01a529051269e87711fb0a1741c0b5a89
child 296158 e7b899c144c9cac4ddc6c574c270db75e811394c
push id5245
push userraliiev@mozilla.com
push dateThu, 29 Oct 2015 11:30:51 +0000
treeherdermozilla-beta@dac831dc1bd0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersttaubert, al
bugs1208141
milestone43.0a2
Bug 1208141 - r=ttaubert, a=al
browser/base/content/contentSearchUI.js
--- a/browser/base/content/contentSearchUI.js
+++ b/browser/base/content/contentSearchUI.js
@@ -618,27 +618,24 @@ ContentSearchUIController.prototype = {
       this._strings.searchHeader.replace("%S", this.defaultEngine.name)));
   },
 
   _updateSearchWithHeader: function () {
     if (!this._strings) {
       return;
     }
     let searchWithHeader = document.getElementById("contentSearchSearchWithHeader");
-    while (searchWithHeader.firstChild) {
-      searchWithHeader.firstChild.remove();
-    }
     if (this.input.value) {
-      let html = "<span class='contentSearchSearchWithHeaderSearchText'>" +
-                 this.input.value + "</span>";
+      let html = "<span class='contentSearchSearchWithHeaderSearchText'></span>";
       html = this._strings.searchForKeywordsWith.replace("%S", html);
       searchWithHeader.innerHTML = html;
-      return;
+      searchWithHeader.querySelector('.contentSearchSearchWithHeaderSearchText').textContent = this.input.value;
+    } else {
+      searchWithHeader.textContent = this._strings.searchWithHeader;
     }
-    searchWithHeader.appendChild(document.createTextNode(this._strings.searchWithHeader));
   },
 
   _speculativeConnect: function () {
     if (this.defaultEngine) {
       this._sendMsg("SpeculativeConnect", this.defaultEngine.name);
     }
   },