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 286430 a10be60e15925625be398dda0c8db1c168d7fd8d
parent 286429 82e8f730b3e18f3be117c5a202f9fead8e7a9e78
child 286431 ca822e985ba5baae25a400b0031199a0561cfc9e
push id30049
push usercbook@mozilla.com
push dateThu, 03 Mar 2016 10:53:54 +0000
treeherdermozilla-central@7e43bdd93e43 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersadw
bugs1196677
milestone47.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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 = {