Bug 1524510 - Freeze quantum bar results when the user interacts with them. r=mak
☠☠ backed out by 6726a4f0b942 ☠ ☠
authorDão Gottwald <dao@mozilla.com>
Fri, 29 Mar 2019 10:39:34 +0000
changeset 466742 9eca658703d92afe37923f313c9f662d16b98627
parent 466741 e365c225e26ae4c06d3346939b0c1ec9333d727a
child 466743 7077ebbd4677cabc478006b26dbf7cc6ac9bd0dc
push id35780
push useropoprus@mozilla.com
push dateFri, 29 Mar 2019 21:53:01 +0000
treeherdermozilla-central@414f37afbe07 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmak
bugs1524510
milestone68.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 1524510 - Freeze quantum bar results when the user interacts with them. r=mak Differential Revision: https://phabricator.services.mozilla.com/D25222
browser/components/urlbar/UrlbarView.jsm
--- a/browser/components/urlbar/UrlbarView.jsm
+++ b/browser/components/urlbar/UrlbarView.jsm
@@ -31,18 +31,18 @@ class UrlbarView {
     this.panel = input.panel;
     this.controller = input.controller;
     this.document = this.panel.ownerDocument;
     this.window = this.document.defaultView;
 
     this._mainContainer = this.panel.querySelector(".urlbarView-body-inner");
     this._rows = this.panel.querySelector("#urlbarView-results");
 
+    this._rows.addEventListener("mousedown", this);
     this._rows.addEventListener("mouseup", this);
-    this._rows.addEventListener("mousedown", this);
 
     // For the horizontal fade-out effect, set the overflow attribute on result
     // rows when they overflow.
     this._rows.addEventListener("overflow", this);
     this._rows.addEventListener("underflow", this);
 
     this.panel.addEventListener("popupshowing", this);
     this.panel.addEventListener("popupshown", this);
@@ -135,16 +135,19 @@ class UrlbarView {
    *   Set to true to select the previous item. By default the next item
    *   will be selected.
    */
   selectBy(amount, {reverse = false} = {}) {
     if (!this.isOpen) {
       throw new Error("UrlbarView: Cannot select an item if the view isn't open.");
     }
 
+    // Freeze results as the user is interacting with them.
+    this.controller.cancelQuery();
+
     let row = this._selected;
 
     if (!row) {
       this._selectItem(reverse ? this._rows.lastElementChild :
                                  this._rows.firstElementChild);
       return;
     }