Bug 1653436 - Clear _autofillResult more reliably. r=mak

Differential Revision: https://phabricator.services.mozilla.com/D84716
This commit is contained in:
Harry Twyford 2020-07-23 15:33:37 +00:00
Родитель 680162874d
Коммит 7f2225ec09
1 изменённых файлов: 6 добавлений и 2 удалений

Просмотреть файл

@ -301,6 +301,10 @@ class ProviderAutofill extends UrlbarProvider {
async isActive(queryContext) {
let instance = this.queryInstance;
// This is usually reset on canceling or completing the query, but since we
// query in isActive, it may not have been canceled by the previous call.
this._autofillResult = null;
// First of all, check for the autoFill pref.
if (!UrlbarPrefs.get("autoFill")) {
return false;
@ -400,7 +404,7 @@ class ProviderAutofill extends UrlbarProvider {
this._autofillResult.heuristic = true;
addCallback(this, this._autofillResult);
delete this._autofillResult;
this._autofillResult = null;
}
/**
@ -408,7 +412,7 @@ class ProviderAutofill extends UrlbarProvider {
* @param {object} queryContext The query context object
*/
cancelQuery(queryContext) {
delete this._autofillResult;
this._autofillResult = null;
}
/**