| Index: components/autofill/core/browser/form_field.cc
|
| diff --git a/components/autofill/core/browser/form_field.cc b/components/autofill/core/browser/form_field.cc
|
| index b25ff2b44f72d6bd9a62fdb1ce02678e3f124ada..848297263c82becaf459d7418d5834c7596d9c6c 100644
|
| --- a/components/autofill/core/browser/form_field.cc
|
| +++ b/components/autofill/core/browser/form_field.cc
|
| @@ -27,8 +27,13 @@
|
| namespace autofill {
|
| namespace {
|
|
|
| -bool IsCheckable(const AutofillField* field) {
|
| - return field->is_checkable;
|
| +bool ShouldBeIgnored(const AutofillField* field) {
|
| + // Ignore checkable fields as they interfere with parsers assuming context.
|
| + // Eg., while parsing address, "Is PO box" checkbox after ADDRESS_LINE1
|
| + // interferes with correctly understanding ADDRESS_LINE2.
|
| + // Ignore fields marked as presentational. See
|
| + // http://www.w3.org/TR/wai-aria/roles#presentation
|
| + return field->is_checkable || field->role == "presentation";
|
| }
|
|
|
| } // namespace
|
| @@ -40,12 +45,9 @@ void FormField::ParseFormFields(const std::vector<AutofillField*>& fields,
|
| std::vector<AutofillField*> remaining_fields(fields.size());
|
| std::copy(fields.begin(), fields.end(), remaining_fields.begin());
|
|
|
| - // Ignore checkable fields as they interfere with parsers assuming context.
|
| - // Eg., while parsing address, "Is PO box" checkbox after ADDRESS_LINE1
|
| - // interferes with correctly understanding ADDRESS_LINE2.
|
| remaining_fields.erase(
|
| std::remove_if(remaining_fields.begin(), remaining_fields.end(),
|
| - IsCheckable),
|
| + ShouldBeIgnored),
|
| remaining_fields.end());
|
|
|
| // Email pass.
|
|
|