Index: Source/web/WebPasswordFormUtils.cpp |
diff --git a/Source/web/WebPasswordFormUtils.cpp b/Source/web/WebPasswordFormUtils.cpp |
index 582d75cb34d611b504bb4c64c6acd4694a8da30d..cc3dd6d30832259c711ce4bbbed220dd2432e84e 100644 |
--- a/Source/web/WebPasswordFormUtils.cpp |
+++ b/Source/web/WebPasswordFormUtils.cpp |
@@ -69,15 +69,15 @@ void findPasswordFormFields(HTMLFormElement* form, PasswordFormFields* fields) |
if (control->isActivatedSubmit()) |
fields->submit = control; |
- if (!control->hasTagName(HTMLNames::inputTag)) |
+ if (!isHTMLInputElement(*control)) |
continue; |
- HTMLInputElement* inputElement = toHTMLInputElement(control); |
- if (inputElement->isDisabledFormControl()) |
+ HTMLInputElement& inputElement = toHTMLInputElement(*control); |
+ if (inputElement.isDisabledFormControl()) |
continue; |
if ((fields->passwords.size() < maxPasswords) |
- && inputElement->isPasswordField()) { |
+ && inputElement.isPasswordField()) { |
// We assume that the username is the input element before the |
// first password element. |
if (fields->passwords.isEmpty() && latestInputElement) { |
@@ -86,17 +86,17 @@ void findPasswordFormFields(HTMLFormElement* form, PasswordFormFields* fields) |
if (!fields->alternateUserNames.isEmpty() && !latestInputElement->value().isEmpty()) |
fields->alternateUserNames.removeLast(); |
} |
- fields->passwords.append(inputElement); |
+ fields->passwords.append(&inputElement); |
} |
// Various input types such as text, url, email can be a username field. |
- if (inputElement->isTextField() && !inputElement->isPasswordField()) { |
- latestInputElement = inputElement; |
+ if (inputElement.isTextField() && !inputElement.isPasswordField()) { |
+ latestInputElement = &inputElement; |
// We ignore elements that have no value. Unlike userName, alternateUserNames |
// is used only for autofill, not for form identification, and blank autofill |
// entries are not useful. |
- if (!inputElement->value().isEmpty()) |
- fields->alternateUserNames.append(inputElement->value()); |
+ if (!inputElement.value().isEmpty()) |
+ fields->alternateUserNames.append(inputElement.value()); |
} |
} |
} |