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

Unified Diff: chrome/renderer/autofill/form_autofill_util.cc

Issue 11198048: [Autofill] Update the autocomplete types implementation to match the current HTML spec. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update AutofillFieldTest expectations Created 8 years, 2 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
Index: chrome/renderer/autofill/form_autofill_util.cc
diff --git a/chrome/renderer/autofill/form_autofill_util.cc b/chrome/renderer/autofill/form_autofill_util.cc
index 42d6ffa5b521a393d0f92fd8303cb1236552ea29..a612b11e0cd3a258cd2f357a555688889ab9f816 100644
--- a/chrome/renderer/autofill/form_autofill_util.cc
+++ b/chrome/renderer/autofill/form_autofill_util.cc
@@ -593,14 +593,14 @@ void WebFormControlElementToFormField(const WebFormControlElement& element,
// labels for all form control elements are scraped from the DOM and set in
// WebFormElementToFormData.
field->name = element.nameForAutofill();
- field->form_control_type = element.formControlType();
- field->autocomplete_type = element.getAttribute("x-autocompletetype");
- TrimWhitespace(field->autocomplete_type, TRIM_ALL, &field->autocomplete_type);
- if (field->autocomplete_type.size() > kMaxDataLength) {
+ field->form_control_type = UTF16ToUTF8(element.formControlType());
+ field->autocomplete_attribute =
+ UTF16ToUTF8(element.getAttribute("autocomplete"));
+ if (field->autocomplete_attribute.size() > kMaxDataLength) {
// Discard overly long attribute values to avoid DOS-ing the browser
// process. However, send over a default string to indicate that the
// attribute was present.
- field->autocomplete_type = ASCIIToUTF16("x-max-data-length-exceeded");
+ field->autocomplete_attribute = "x-max-data-length-exceeded";
}
if (!IsAutofillableElement(element))

Powered by Google App Engine
This is Rietveld 408576698