Bug 1496478 - Only change the search engine when scrolling on searchbox if accel key is pressed;r=adw
authorBrian Grinstead <bgrinstead@mozilla.com>
Thu, 04 Oct 2018 22:59:01 +0000
changeset 439727 01a517eeb9e6
parent 439726 5f50bfa10bd6
child 439728 75aa1ec0f564
push id34783
push userncsoregi@mozilla.com
push dateFri, 05 Oct 2018 04:46:05 +0000
treeherdermozilla-central@6e67424a39d7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersadw
bugs1496478
milestone64.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 1496478 - Only change the search engine when scrolling on searchbox if accel key is pressed;r=adw The Custom Element migration missed the [modifiers=accel] in XBL on the DOMMouseScroll handler. Differential Revision: https://phabricator.services.mozilla.com/D7780
browser/components/search/content/searchbar.js
--- a/browser/components/search/content/searchbar.js
+++ b/browser/components/search/content/searchbar.js
@@ -399,17 +399,21 @@ class MozSearchbar extends MozXULElement
           installCallback);
       } else
         return;
 
       this.focus();
       this.select();
     });
 
-    this.addEventListener("DOMMouseScroll", (event) => { this.selectEngine(event, (event.detail > 0)); }, true);
+    this.addEventListener("DOMMouseScroll", (event) => {
+      if (event.getModifierState("Accel")) {
+        this.selectEngine(event, event.detail > 0);
+      }
+    }, true);
 
     this.addEventListener("input", (event) => { this.updateGoButtonVisibility(); });
 
     this.addEventListener("drop", (event) => { this.updateGoButtonVisibility(); });
 
     this.addEventListener("blur", (event) => {
       // If the input field is still focused then a different window has
       // received focus, ignore the next focus event.