Index: components/autofill/content/renderer/form_autofill_util.cc |
diff --git a/components/autofill/content/renderer/form_autofill_util.cc b/components/autofill/content/renderer/form_autofill_util.cc |
index 628711cc486975011c8641e6b2b11a7ffd3f750d..40f34d5e24ecb484bd445f52a67cb9f0788630ff 100644 |
--- a/components/autofill/content/renderer/form_autofill_util.cc |
+++ b/components/autofill/content/renderer/form_autofill_util.cc |
@@ -956,6 +956,7 @@ void WebFormControlElementToFormField(const WebFormControlElement& element, |
DCHECK(field); |
DCHECK(!element.isNull()); |
CR_DEFINE_STATIC_LOCAL(WebString, kAutocomplete, ("autocomplete")); |
+ CR_DEFINE_STATIC_LOCAL(WebString, kRole, ("role")); |
// The label is not officially part of a WebFormControlElement; however, the |
// labels for all form control elements are scraped from the DOM and set in |
@@ -970,6 +971,10 @@ void WebFormControlElementToFormField(const WebFormControlElement& element, |
// attribute was present. |
field->autocomplete_attribute = "x-max-data-length-exceeded"; |
} |
+ field->role = base::UTF16ToUTF8(element.getAttribute(kRole)); |
+ if (field->role.size() > kMaxDataLength) { |
brettw
2014/12/03 21:36:24
Looks like this file prefers no {} for single-line
Evan Stade
2014/12/03 22:29:55
ah yes, I think these curlies were here because of
|
+ field->role = "x-max-data-length-exceeded"; |
+ } |
if (!IsAutofillableElement(element)) |
return; |