Bug 242956, only prefill usernames into text inputs and passwords into password inputs.

This commit is contained in:
bryner%brianryner.com 2004-05-27 05:00:11 +00:00
parent 8130c71e43
commit 5796c6734f

View File

@ -811,6 +811,7 @@ nsPasswordManager::OnStateChange(nsIWebProgress* aWebProgress,
SignonDataEntry* firstMatch = nsnull;
nsCOMPtr<nsIDOMHTMLInputElement> userField, passField;
nsCOMPtr<nsIDOMHTMLInputElement> temp;
nsAutoString fieldType;
for (SignonDataEntry* e = hashEnt->head; e; e = e->next) {
@ -821,6 +822,10 @@ nsPasswordManager::OnStateChange(nsIWebProgress* aWebProgress,
nsAutoString oldUserValue;
if (temp) {
temp->GetType(fieldType);
if (!fieldType.Equals(NS_LITERAL_STRING("text")))
continue;
temp->GetValue(oldUserValue);
userField = temp;
} else {
@ -871,6 +876,10 @@ nsPasswordManager::OnStateChange(nsIWebProgress* aWebProgress,
nsAutoString oldPassValue;
if (temp) {
temp->GetType(fieldType);
if (!fieldType.Equals(NS_LITERAL_STRING("password")))
continue;
temp->GetValue(oldPassValue);
passField = temp;
} else {