Bug 1196677 - Content search: use inputbox value for searches performed with the keyboard. r=adw
authorNihanth Subramanya <nhnt11@gmail.com>
Mon, 25 Jan 2016 15:50:21 -0800
changeset 286426 a10be60e15925625be398dda0c8db1c168d7fd8d
parent 286425 82e8f730b3e18f3be117c5a202f9fead8e7a9e78
child 286427 ca822e985ba5baae25a400b0031199a0561cfc9e
push id17949
push usernhnt11@gmail.com
push dateWed, 02 Mar 2016 20:04:48 +0000
treeherderfx-team@a10be60e1592 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersadw
bugs1196677
milestone47.0a1
Bug 1196677 - Content search: use inputbox value for searches performed with the keyboard. r=adw MozReview-Commit-ID: Lwvmd3CUV3m
browser/base/content/contentSearchUI.js
--- a/browser/base/content/contentSearchUI.js
+++ b/browser/base/content/contentSearchUI.js
@@ -247,17 +247,18 @@ ContentSearchUIController.prototype = {
   search: function (aEvent) {
     if (!this.defaultEngine) {
       return; // Not initialized yet.
     }
 
     let searchText = this.input;
     let searchTerms;
     if (this._table.hidden ||
-        aEvent.originalTarget.id == "contentSearchDefaultEngineHeader") {
+        aEvent.originalTarget.id == "contentSearchDefaultEngineHeader" ||
+        aEvent instanceof KeyboardEvent) {
       searchTerms = searchText.value;
     }
     else {
       searchTerms = this.suggestionAtIndex(this.selectedIndex) || searchText.value;
     }
     // Send an event that will perform a search and Firefox Health Report will
     // record that a search from the healthReportKey passed to the constructor.
     let eventData = {