Bug 1083990: fix bug that caused deletion of history autocomplete items to temporarily mess up the suggestions dropdown display, r=MattN, a=lsblakk.
authorGavin Sharp <gavin@gavinsharp.com>
Thu, 30 Oct 2014 09:00:53 -0700
changeset 234082 21754ccc7751baa7c1d08268c5faae45f2379109
parent 234081 b97e451b0e6763cfd4a49309b021bde65dff7868
child 234083 ce8e174af2f297a7e830053f4911e277451e87ee
push id4187
push userbhearsum@mozilla.com
push dateFri, 28 Nov 2014 15:29:12 +0000
treeherdermozilla-beta@f23cc6a30c11 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersMattN, lsblakk
bugs1083990
milestone35.0a2
Bug 1083990: fix bug that caused deletion of history autocomplete items to temporarily mess up the suggestions dropdown display, r=MattN, a=lsblakk.
toolkit/components/search/nsSearchSuggestions.js
--- a/toolkit/components/search/nsSearchSuggestions.js
+++ b/toolkit/components/search/nsSearchSuggestions.js
@@ -88,23 +88,27 @@ SuggestAutoComplete.prototype = {
    * Notifies the front end of new results.
    * @param searchString  the user's query string
    * @param results       an array of results to the search
    * @param comments      an array of metadata corresponding to the results
    * @private
    */
   onResultsReady: function(searchString, results, comments, formHistoryResult) {
     if (this._listener) {
+      // Create a copy of the results array to use as labels, since
+      // FormAutoCompleteResult doesn't like being passed the same array
+      // for both.
+      let labels = results.slice();
       let result = new FormAutoCompleteResult(
           searchString,
           Ci.nsIAutoCompleteResult.RESULT_SUCCESS,
           0,
           "",
           results,
-          results,
+          labels,
           comments,
           formHistoryResult);
 
       this._listener.onSearchResult(this, result);
 
       // Null out listener to make sure we don't notify it twice
       this._listener = null;
     }