mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-26 20:30:41 +00:00
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 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
512fb1d5ec
commit
53c6c30ee4
@ -184,7 +184,7 @@ function convertResultToMatches(context, result, urls) {
|
||||
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,
|
||||
@ -198,10 +198,10 @@ function convertResultToMatches(context, result, urls) {
|
||||
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;
|
||||
|
@ -75,7 +75,8 @@ It is augmented as it progresses through the system, with various information:
|
||||
// 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
|
||||
|
Loading…
x
Reference in New Issue
Block a user