Bug 1520665 - Replace context.autofill property with autofillValue, and make the UnifiedComplete provider set it based on result.getValueAt() r=mak
authorDrew Willcoxon <adw@mozilla.com>
Thu, 17 Jan 2019 17:04:03 +0000
changeset 511399 f4edf77f5ca0a72735303a478cd7a517f8f08e25
parent 511398 32d337b78c8f7099fa0f741dc2f45a653a833a74
child 511400 9875054a2a07c3d5f571446f24426d6b9d7d36e0
push id10547
push userffxbld-merge
push dateMon, 21 Jan 2019 13:03:58 +0000
treeherdermozilla-beta@24ec1916bffe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmak
bugs1520665
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 1520665 - Replace context.autofill property with autofillValue, and make the UnifiedComplete provider set it based on result.getValueAt() r=mak Differential Revision: https://phabricator.services.mozilla.com/D16766
browser/components/urlbar/UrlbarProviderUnifiedComplete.jsm
browser/docs/AddressBar.rst
--- a/browser/components/urlbar/UrlbarProviderUnifiedComplete.jsm
+++ b/browser/components/urlbar/UrlbarProviderUnifiedComplete.jsm
@@ -179,34 +179,34 @@ function convertResultToMatches(context,
     // nsIAutocompleteResult always contains all of the matches, includes ones
     // we may have added already. This means we'll end up adding things in the
     // wrong order here, but that's a task for the UrlbarMuxer.
     let url = result.getFinalCompleteValueAt(i);
     if (urls.has(url)) {
       continue;
     }
     urls.add(url);
-    // Not used yet: result.getValueAt(i), result.getLabelAt(i)
+    // Not used yet: result.getLabelAt(i)
     let style = result.getStyleAt(i);
     let match = makeUrlbarMatch(context.tokens, {
       url,
       icon: result.getImageAt(i),
       style,
       comment: result.getCommentAt(i),
       firstToken: context.tokens[0],
     });
     // Should not happen, but better safe than sorry.
     if (!match) {
       continue;
     }
     matches.push(match);
-    // Manage autofill and preselected properties for the first match.
+    // Manage autofillValue and preselected properties for the first match.
     if (i == 0) {
       if (style.includes("autofill") && result.defaultIndex == 0) {
-        context.autofill = true;
+        context.autofillValue = result.getValueAt(i);
       }
       if (style.includes("heuristic")) {
         context.preselected = true;
       }
     }
   }
   return {matches, done};
 }
--- a/browser/docs/AddressBar.rst
+++ b/browser/docs/AddressBar.rst
@@ -70,17 +70,18 @@ It is augmented as it progresses through
     muxer; // {string} Name of a registered muxer. Muxers can be registered
            // through the UrlbarProvidersManager.
     providers; // {array} List of registered provider names. Providers can be
                // registered through the UrlbarProvidersManager.
     sources; // {array} If provided is the list of sources, as defined by
              // MATCH_SOURCE.*, that can be returned by the model.
 
     // Properties added by the Model.
-    autofill; // {boolean} whether the first match is an autofill match.
+    autofillValue; // {string} the text value that should be autofilled in the
+                   // input, if any.
     preselected; // {boolean} whether the first match should be preselected.
     results; // {array} list of UrlbarMatch objects.
     tokens; // {array} tokens extracted from the searchString, each token is an
             // object in the form {type, value}.
   }
 
 
 The Model