summaryrefslogtreecommitdiffstats
path: root/WebKit/android/WebCoreSupport/autofill
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2010-09-14 16:59:00 +0100
committerSteve Block <steveblock@google.com>2010-09-23 16:08:18 +0100
commit60e8df73fc6d110245987632be372eabd625344f (patch)
tree7edefba923740b37fd1e4ea5fe6fa0791e7b6da7 /WebKit/android/WebCoreSupport/autofill
parent0af298725e8a2e8722cc13dd324929dc6df06b73 (diff)
downloadexternal_webkit-60e8df73fc6d110245987632be372eabd625344f.zip
external_webkit-60e8df73fc6d110245987632be372eabd625344f.tar.gz
external_webkit-60e8df73fc6d110245987632be372eabd625344f.tar.bz2
Fix a bug that would cause the AutoFill server to return an error.
We were pushing the <option> elements associated with <select> tags into the form field vector that AutoFill uses. This is not correct as they are not used by the server and result in duplicate field signatures in the XML requests. As the signatures should be unique, the server returns an error response. Change-Id: I359a952cf219e088c2cae886907f563d86756688
Diffstat (limited to 'WebKit/android/WebCoreSupport/autofill')
-rw-r--r--WebKit/android/WebCoreSupport/autofill/FormManagerAndroid.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/WebKit/android/WebCoreSupport/autofill/FormManagerAndroid.cpp b/WebKit/android/WebCoreSupport/autofill/FormManagerAndroid.cpp
index c97a2a8..8f0467b 100644
--- a/WebKit/android/WebCoreSupport/autofill/FormManagerAndroid.cpp
+++ b/WebKit/android/WebCoreSupport/autofill/FormManagerAndroid.cpp
@@ -217,6 +217,8 @@ bool FormManager::HTMLFormElementToFormData(HTMLFormElement& element,
std::vector<bool> fields_extracted(control_elements.size(), false);
for (size_t i = 0; i < control_elements.size(); ++i) {
const HTMLFormControlElement* control_element = control_elements[i];
+ if (!(control_element->hasTagName(inputTag) || control_element->hasTagName(selectTag)))
+ continue;
if (requirements & REQUIRE_AUTOCOMPLETE &&
control_element->type() == WTF::String("text")) {
@@ -305,7 +307,8 @@ void FormManager::ExtractForms(WebCore::Document* document) {
size_t size = elements.size();
for (size_t i = 0; i < size; i++) {
WebCore::HTMLFormControlElement* e = elements[i];
- form_elements->control_elements.push_back(e);
+ if (e->hasTagName(inputTag) || e->hasTagName(selectTag))
+ form_elements->control_elements.push_back(e);
}
form_elements->form_element = form;
}