summaryrefslogtreecommitdiffstats
path: root/chrome/renderer/form_manager.cc
diff options
context:
space:
mode:
authorjhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-21 23:51:33 +0000
committerjhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-21 23:51:33 +0000
commit75a0fc40f52f44c7c11324b840895c716cf1752e (patch)
tree38c0894249d7177cf5047ef3cbf9063d7ff187d4 /chrome/renderer/form_manager.cc
parent63345aa81fdd15732b446502b401dd57cc4ce0ea (diff)
downloadchromium_src-75a0fc40f52f44c7c11324b840895c716cf1752e.zip
chromium_src-75a0fc40f52f44c7c11324b840895c716cf1752e.tar.gz
chromium_src-75a0fc40f52f44c7c11324b840895c716cf1752e.tar.bz2
AutoFill: Skip past empty strings when comparing form fields for filling.
Empty WebString != Empty string16! BUG=none TEST=FormManagerTest.FillFormEmptyName Review URL: http://codereview.chromium.org/1750004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45264 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/form_manager.cc')
-rw-r--r--chrome/renderer/form_manager.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/chrome/renderer/form_manager.cc b/chrome/renderer/form_manager.cc
index 144e23d..c66cd74 100644
--- a/chrome/renderer/form_manager.cc
+++ b/chrome/renderer/form_manager.cc
@@ -394,6 +394,12 @@ bool FormManager::FillForm(const FormData& form) {
for (size_t i = 0, j = 0;
i < form_element->control_elements.size() && j < form.fields.size();
++i, ++j) {
+ // Once again, empty WebString != empty string16, so we have to explicitly
+ // check for this case.
+ if (form_element->control_elements[i].nameForAutofill().length() == 0 &&
+ form.fields[j].name().empty())
+ continue;
+
// We assume that the intersection of the fields in
// |form_element->control_elements| and |form.fields| is ordered, but it's
// possible that one or the other sets may have more fields than the other,