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

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

Issue 621503003: Exclude readonly and disabled elements from autofill form. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fold checks on ReadOnly and Enabled into IsAutofillable() function. Created 6 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
« no previous file with comments | « chrome/test/data/autofill/heuristics/output/15_crbug_40687.out ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 10d6cca9160885f95957ec482b9403489fa5999b..6b98dee792515cebc89f0c3e01be67ff9ac80b6b 100644
--- a/components/autofill/content/renderer/form_autofill_util.cc
+++ b/components/autofill/content/renderer/form_autofill_util.cc
@@ -74,6 +74,10 @@ bool HasTagName(const WebNode& node, const blink::WebString& tag) {
}
bool IsAutofillableElement(const WebFormControlElement& element) {
+ // Exclude disabled and readonly elements.
+ if (!element.isEnabled() || element.isReadOnly())
+ return false;
+
const WebInputElement* input_element = toWebInputElement(&element);
return IsAutofillableInputElement(input_element) ||
IsSelectElement(element) ||
« no previous file with comments | « chrome/test/data/autofill/heuristics/output/15_crbug_40687.out ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698