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 8d690c2446a2a26163f46760c728104f15249f37..821c3e6cdbfb5432db9091e34ef9273d40af4a34 100644 |
--- a/components/autofill/content/renderer/form_autofill_util.cc |
+++ b/components/autofill/content/renderer/form_autofill_util.cc |
@@ -1366,6 +1366,7 @@ void WebFormControlElementToFormField( |
DCHECK(field); |
DCHECK(!element.isNull()); |
CR_DEFINE_STATIC_LOCAL(WebString, kAutocomplete, ("autocomplete")); |
+ CR_DEFINE_STATIC_LOCAL(WebString, kId, ("id")); |
CR_DEFINE_STATIC_LOCAL(WebString, kRole, ("role")); |
CR_DEFINE_STATIC_LOCAL(WebString, kPlaceholder, ("placeholder")); |
CR_DEFINE_STATIC_LOCAL(WebString, kClass, ("class")); |
@@ -1374,6 +1375,9 @@ void WebFormControlElementToFormField( |
// labels for all form control elements are scraped from the DOM and set in |
// WebFormElementToFormData. |
field->name = element.nameForAutofill(); |
+ base::string16 id = element.getAttribute(kId); |
+ if (id != field->name) |
sebsg
2017/01/18 19:22:49
Can you also just make a quick note or refer to HT
kolos1
2017/01/19 11:09:16
Done.
Also removed the comment about the label. A
|
+ field->id = id; |
field->form_control_type = element.formControlType().utf8(); |
field->autocomplete_attribute = element.getAttribute(kAutocomplete).utf8(); |
if (field->autocomplete_attribute.size() > kMaxDataLength) { |