summaryrefslogtreecommitdiffstats
path: root/webkit/glue/dom_operations.cc
diff options
context:
space:
mode:
authorsnej@chromium.org <snej@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-04 20:22:56 +0000
committersnej@chromium.org <snej@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-04 20:22:56 +0000
commitfcc2caa7b147a296f450df1d3bbcd2bc4569093e (patch)
treea3eb58e4eacb289c707f4481610b8ef21bfba103 /webkit/glue/dom_operations.cc
parent031e43a8001ff1349fd34f07bca29c1be874c6ad (diff)
downloadchromium_src-fcc2caa7b147a296f450df1d3bbcd2bc4569093e.zip
chromium_src-fcc2caa7b147a296f450df1d3bbcd2bc4569093e.tar.gz
chromium_src-fcc2caa7b147a296f450df1d3bbcd2bc4569093e.tar.bz2
Don't autofill a read-only password field.
BUG=26416 TEST=PasswordManagerAutocompleteTests::OnBlur Review URL: http://codereview.chromium.org/1856004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46383 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/dom_operations.cc')
-rw-r--r--webkit/glue/dom_operations.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/webkit/glue/dom_operations.cc b/webkit/glue/dom_operations.cc
index f42270d..982bbba 100644
--- a/webkit/glue/dom_operations.cc
+++ b/webkit/glue/dom_operations.cc
@@ -183,6 +183,11 @@ static bool FillFormImpl(FormElements* fe, const FormData& data) {
it != fe->input_elements.end(); ++it) {
if (!it->second.value().isEmpty()) // Don't overwrite pre-filled values.
continue;
+ if (it->second.inputType() == WebInputElement::Password) {
+ if (!it->second.isEnabledFormControl() ||
+ it->second.hasAttribute("readonly"))
+ continue; // Don't fill uneditable password fields.
+ }
it->second.setValue(data_map[it->first]);
it->second.setAutofilled(true);
it->second.dispatchFormControlChangeEvent();