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

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

Issue 1072813002: Avoid considering readonly password elements in password form (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Formatted comment length to contain within 80 chars Created 5 years, 8 months 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
« no previous file with comments | « chrome/test/data/password/password_form_with_password_readonly.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/autofill/content/renderer/password_form_conversion_utils.cc
diff --git a/components/autofill/content/renderer/password_form_conversion_utils.cc b/components/autofill/content/renderer/password_form_conversion_utils.cc
index 7ad5814273126fa24f9014b298a63b3ed370cebd..74708ef4cf5d53f380a5952771ac73f0902c0455 100644
--- a/components/autofill/content/renderer/password_form_conversion_utils.cc
+++ b/components/autofill/content/renderer/password_form_conversion_utils.cc
@@ -254,7 +254,14 @@ void GetPasswordForm(
layout_sequence.push_back('N');
}
- if (input_element->isPasswordField()) {
+ // If the password field is readonly, the page is likely using a virtual
+ // keyboard and bypassing the password field value (see
+ // http://crbug.com/475488). There is nothing Chrome can do to fill
+ // passwords for now.
+ if (input_element->isPasswordField() &&
+ (!input_element->isReadOnly() ||
+ HasAutocompleteAttributeValue(*input_element, "current_password") ||
+ HasAutocompleteAttributeValue(*input_element, "new-password"))) {
passwords.push_back(*input_element);
// If we have not yet considered any element to be the username so far,
// provisionally select the input element just before the first password
« no previous file with comments | « chrome/test/data/password/password_form_with_password_readonly.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698