зеркало из https://github.com/mozilla/gecko-dev.git
Bug 395150 - fillDoc() shouldn't trudge through each form if there are no stored logins for site. r=gavin, a=mconnor
This commit is contained in:
Родитель
912f4b4b6c
Коммит
219cd0fa6f
|
@ -887,16 +887,19 @@ LoginManager.prototype = {
|
|||
return;
|
||||
|
||||
var formOrigin = this._getPasswordOrigin(doc.documentURI);
|
||||
var autofillForm = this._prefBranch.getBoolPref("autofillForms");
|
||||
|
||||
this.log("fillDocument found " + forms.length +
|
||||
// If there are no logins for this site, bail out now.
|
||||
if (!this.countLogins(formOrigin, "", null))
|
||||
return;
|
||||
|
||||
this.log("fillDocument processing " + forms.length +
|
||||
" forms on " + doc.documentURI);
|
||||
|
||||
var autofillForm = this._prefBranch.getBoolPref("autofillForms");
|
||||
var previousActionOrigin = null;
|
||||
|
||||
for (var i = 0; i < forms.length; i++) {
|
||||
var form = forms[i];
|
||||
var actionOrigin = this._getActionOrigin(form);
|
||||
|
||||
// Heuristically determine what the user/pass fields are
|
||||
// We do this before checking to see if logins are stored,
|
||||
|
@ -912,6 +915,7 @@ LoginManager.prototype = {
|
|||
|
||||
// Only the actionOrigin might be changing, so if it's the same
|
||||
// as the last form on the page we can reuse the same logins.
|
||||
var actionOrigin = this._getActionOrigin(form);
|
||||
if (actionOrigin != previousActionOrigin) {
|
||||
var foundLogins =
|
||||
this.findLogins({}, formOrigin, actionOrigin, null);
|
||||
|
|
Загрузка…
Ссылка в новой задаче