Bug 1515307 - Opening the popup with up/down when a string is typed should search that string. r=mak
☠☠ backed out by a9a828f85c91 ☠ ☠
authorDão Gottwald <dao@mozilla.com>
Thu, 17 Jan 2019 16:20:33 +0000
changeset 454306 cbb4720dc4d5c4f782943a888a4e4ed05320134c
parent 454305 b179bb22821b9311b1824e725abdc945ab3f57f4
child 454307 560290f263515bb7c7bb834cde8f7d64d5bdde54
push id76283
push userdgottwald@mozilla.com
push dateThu, 17 Jan 2019 16:24:16 +0000
treeherderautoland@cbb4720dc4d5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmak
bugs1515307
milestone66.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 1515307 - Opening the popup with up/down when a string is typed should search that string. r=mak Differential Revision: https://phabricator.services.mozilla.com/D16861
browser/components/urlbar/UrlbarInput.jsm
--- a/browser/components/urlbar/UrlbarInput.jsm
+++ b/browser/components/urlbar/UrlbarInput.jsm
@@ -343,33 +343,30 @@ class UrlbarInput {
       val = this.window.losslessDecodeURI(uri);
     }
     this.value = val;
   }
 
   /**
    * Starts a query based on the user input.
    *
-   * @param {string} [options.searchString]
-   *   The string the user entered in autocomplete.
    * @param {number} [options.lastKey]
    *   The last key the user entered (as a key code).
    */
   startQuery({
-    searchString = "",
     lastKey = null,
   } = {}) {
     this.controller.startQuery(new QueryContext({
       enableAutofill: UrlbarPrefs.get("autoFill"),
       isPrivate: this.isPrivate,
       lastKey,
       maxResults: UrlbarPrefs.get("maxRichResults"),
       muxer: "UnifiedComplete",
       providers: ["UnifiedComplete"],
-      searchString,
+      searchString: this.textValue,
     }));
   }
 
   typeRestrictToken(char) {
     this.inputField.value = char + " ";
 
     let event = this.document.createEvent("UIEvents");
     event.initUIEvent("input", true, false, this.window, 0);
@@ -660,31 +657,30 @@ class UrlbarInput {
       if (this.view.isOpen) {
         this.view.close();
       } else {
         this.startQuery();
       }
     }
   }
 
-  _on_input(event) {
-    let value = event.target.value;
+  _on_input() {
+    let value = this.textValue;
     this.valueIsTyped = true;
     this._untrimmedValue = value;
     this.window.gBrowser.userTypedValue = value;
 
     if (value) {
       this.setAttribute("usertyping", "true");
     } else {
       this.removeAttribute("usertyping");
     }
 
     // XXX Fill in lastKey, and add anything else we need.
     this.startQuery({
-      searchString: value,
       lastKey: null,
     });
   }
 
   _on_select(event) {
     if (!Services.clipboard.supportsSelectionClipboard()) {
       return;
     }