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

Unified Diff: components/autofill/content/renderer/form_autofill_util.cc

Issue 734983006: Autofill - Fix Harry and David checkout: ignore role="presentation" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: relative patchset Created 6 years 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: 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 7501905cd4e2f5526103a13026e351124e8a1c87..e20c4b92bd942ee1bde2bf8c1130f0e6f0976409 100644
--- a/components/autofill/content/renderer/form_autofill_util.cc
+++ b/components/autofill/content/renderer/form_autofill_util.cc
@@ -781,6 +781,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
@@ -795,6 +796,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) {
+ field->role = "x-max-data-length-exceeded";
+ }
if (!IsAutofillableElement(element))
return;

Powered by Google App Engine
This is Rietveld 408576698