mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-10 17:24:29 +00:00
Bug 242956, only prefill usernames into text inputs and passwords into password inputs.
This commit is contained in:
parent
8130c71e43
commit
5796c6734f
@ -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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user