Bug 1259060 - Add shift+enter to navigate to previous result in inspector search;r=bgrins
authorSteve Melia <steve.j.melia@gmail.com>
Fri, 25 Mar 2016 13:58:27 +0000
changeset 290467 6e36e9a374f2564f27a40c0b1f8ba222a62909b0
parent 290466 6ad2d4707209325e68ad091cbb34f1a78bf9c5cf
child 290468 678ddeb8eb8483540c58ce4ad54248a2429cb6b7
push id18387
push userbgrinstead@mozilla.com
push dateSat, 26 Mar 2016 20:59:02 +0000
treeherderfx-team@6e36e9a374f2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbgrins
bugs1259060
milestone48.0a1
Bug 1259060 - Add shift+enter to navigate to previous result in inspector search;r=bgrins MozReview-Commit-ID: 6Y8tz7dML5s
devtools/client/inspector/inspector-search.js
devtools/client/inspector/test/browser_inspector_search-05.js
--- a/devtools/client/inspector/inspector-search.js
+++ b/devtools/client/inspector/inspector-search.js
@@ -102,17 +102,17 @@ InspectorSearch.prototype = {
 
   _onKeyDown: function(event) {
     if (this.searchBox.value.length === 0) {
       this.searchBox.removeAttribute("filled");
     } else {
       this.searchBox.setAttribute("filled", true);
     }
     if (event.keyCode === event.DOM_VK_RETURN) {
-      this._onSearch();
+      this._onSearch(event.shiftKey);
     } if (event.keyCode === Ci.nsIDOMKeyEvent.DOM_VK_G && event.metaKey) {
       this._onSearch(event.shiftKey);
       event.preventDefault();
     }
   }
 };
 
 /**
--- a/devtools/client/inspector/test/browser_inspector_search-05.js
+++ b/devtools/client/inspector/test/browser_inspector_search-05.js
@@ -48,16 +48,30 @@ add_task(function* () {
 
   info("Press enter to cycle through multiple nodes matching this suggestion");
   onSelect = inspector.once("inspector-updated");
   EventUtils.synthesizeKey("VK_RETURN", {}, inspector.panelWin);
   yield onSelect;
 
   yield checkCorrectButton(inspector, "#iframe-2");
 
+  info("Press shift-enter to select the previous node matching this suggestion");
+  onSelect = inspector.once("inspector-updated");
+  EventUtils.synthesizeKey("VK_RETURN",  { shiftKey: true }, inspector.panelWin);
+  yield onSelect;
+
+  yield checkCorrectButton(inspector, "#iframe-1");
+
+  info("Press enter to cycle through multiple nodes matching this suggestion");
+  onSelect = inspector.once("inspector-updated");
+  EventUtils.synthesizeKey("VK_RETURN", {}, inspector.panelWin);
+  yield onSelect;
+
+  yield checkCorrectButton(inspector, "#iframe-2");
+
   info("Press enter to cycle through multiple nodes matching this suggestion");
   onSelect = inspector.once("inspector-updated");
   EventUtils.synthesizeKey("VK_RETURN", {}, inspector.panelWin);
   yield onSelect;
 
   yield checkCorrectButton(inspector, "#iframe-3");
 
   info("Press enter to cycle through multiple nodes matching this suggestion");