Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(569)

Unified Diff: components/autofill/content/renderer/password_autofill_agent.cc

Issue 1428283002: Fix of password autofilling on hidden passwords forms. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comment fix Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 af47549d3efce506748396d57fc39b740fd02e1d..f1c786925904583ff38d342b481e403b4e9b17a2 100644
--- a/components/autofill/content/renderer/password_autofill_agent.cc
+++ b/components/autofill/content/renderer/password_autofill_agent.cc
@@ -185,12 +185,6 @@ bool FindFormInputElement(
if (input_element.isPasswordField() != is_password_field)
continue;
- // Avoid autofilling invisible password fields.
- if (input_element.isPasswordField() &&
- !form_util::IsWebNodeVisible(input_element)) {
- continue;
- }
-
// For change password form with ambiguous or empty names keep only the
// first password field having |autocomplete='current-password'| attribute
// set. Also make sure we avoid keeping password fields having
@@ -203,8 +197,14 @@ bool FindFormInputElement(
// Check for a non-unique match.
if (found_input) {
// For change password form keep only the first password field entry.
- if (does_password_field_has_ambigous_or_empty_name)
+ if (does_password_field_has_ambigous_or_empty_name) {
+ if (!form_util::IsWebNodeVisible((*result)[field_name])) {
+ // If a previously chosen field was invisible then take the current
+ // one.
+ (*result)[field_name] = input_element;
+ }
continue;
+ }
found_input = false;
break;
« no previous file with comments | « chrome/test/data/password/password_form.html ('k') | components/autofill/content/renderer/password_form_conversion_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698