| Index: components/autofill/content/renderer/password_autofill_agent.cc
|
| diff --git a/components/autofill/content/renderer/password_autofill_agent.cc b/components/autofill/content/renderer/password_autofill_agent.cc
|
| index 34e28598f3145eb9c75ac0ff73b0ef58e46d428d..61f31211bb530992057dab8fbe08c0f7c0b0e64d 100644
|
| --- a/components/autofill/content/renderer/password_autofill_agent.cc
|
| +++ b/components/autofill/content/renderer/password_autofill_agent.cc
|
| @@ -703,8 +703,6 @@ bool PasswordAutofillAgent::FillSuggestion(
|
|
|
| if (!FindPasswordInfoForElement(*element, &username_element,
|
| &password_element, &password_info) ||
|
| - (!username_element.isNull() &&
|
| - !IsElementAutocompletable(username_element)) ||
|
| !IsElementAutocompletable(password_element)) {
|
| return false;
|
| }
|
| @@ -713,7 +711,8 @@ bool PasswordAutofillAgent::FillSuggestion(
|
| if (element->isPasswordField()) {
|
| password_info->password_field_suggestion_was_accepted = true;
|
| password_info->password_field = password_element;
|
| - } else if (!username_element.isNull()) {
|
| + } else if (!username_element.isNull() &&
|
| + IsElementAutocompletable(username_element)) {
|
| username_element.setValue(blink::WebString(username), true);
|
| username_element.setAutofilled(true);
|
| UpdateFieldValueAndPropertiesMaskMap(username_element, &username,
|
| @@ -749,13 +748,12 @@ bool PasswordAutofillAgent::PreviewSuggestion(
|
|
|
| if (!FindPasswordInfoForElement(*element, &username_element,
|
| &password_element, &password_info) ||
|
| - (!username_element.isNull() &&
|
| - !IsElementAutocompletable(username_element)) ||
|
| !IsElementAutocompletable(password_element)) {
|
| return false;
|
| }
|
|
|
| - if (!element->isPasswordField() && !username_element.isNull()) {
|
| + if (!element->isPasswordField() && !username_element.isNull() &&
|
| + IsElementAutocompletable(username_element)) {
|
| if (username_query_prefix_.empty())
|
| username_query_prefix_ = username_element.value();
|
|
|
|
|