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 495463 01a517eeb9e6aaa9f5973599976a0dfcebbbbe8f
parent 495462 5f50bfa10bd626bc595ca53f78d3d4ba7f1e03ff
child 495464 75aa1ec0f564189333f7d377c2a33a95996c36a2
push id9984
push userffxbld-merge
push dateMon, 15 Oct 2018 21:07:35 +0000
treeherdermozilla-beta@183d27ea8570 [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.