summaryrefslogtreecommitdiffstats
path: root/components
diff options
context:
space:
mode:
authorMathieu Perreault <mathp@chromium.org>2016-01-23 08:58:46 -0500
committerMathieu Perreault <mathp@chromium.org>2016-01-23 14:00:54 +0000
commitf5fb273c0ad2294d3fbae73b93aae65388716ca2 (patch)
treee537cf1132edc82745bbdfb094aa729ab7775f37 /components
parentfef12ad4e021779ce6f1099926ad34cb45ee8af5 (diff)
downloadchromium_src-f5fb273c0ad2294d3fbae73b93aae65388716ca2.zip
chromium_src-f5fb273c0ad2294d3fbae73b93aae65388716ca2.tar.gz
chromium_src-f5fb273c0ad2294d3fbae73b93aae65388716ca2.tar.bz2
[Merge M49][Autofill] Fill non-focusable select elements.
As explained in comments, we often see non focusable select elements being the "backend" for a prettier dropdown (changing the pretty dropdown will change the <select> value). Autofill previously wouldn't touch the non-focusable select elements. BUG=428883 TEST=FormAutofilTest browser_tests Review URL: https://codereview.chromium.org/1610583003 Cr-Commit-Position: refs/heads/master@{#370955} (cherry picked from commit 7760b51aa0d7684735571113d6f225c3b5832935) Review URL: https://codereview.chromium.org/1623783002 . Cr-Commit-Position: refs/branch-heads/2623@{#100} Cr-Branched-From: 92d77538a86529ca35f9220bd3cd512cbea1f086-refs/heads/master@{#369907}
Diffstat (limited to 'components')
-rw-r--r--components/autofill/content/renderer/form_autofill_util.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/components/autofill/content/renderer/form_autofill_util.cc b/components/autofill/content/renderer/form_autofill_util.cc
index bda3c4e..5e462f4 100644
--- a/components/autofill/content/renderer/form_autofill_util.cc
+++ b/components/autofill/content/renderer/form_autofill_util.cc
@@ -60,6 +60,10 @@ enum FieldFilterMask {
FILTER_NONE = 0,
FILTER_DISABLED_ELEMENTS = 1 << 0,
FILTER_READONLY_ELEMENTS = 1 << 1,
+ // Filters non-focusable elements with the exception of select elements, which
+ // are sometimes made non-focusable because they are present for accessibility
+ // while a prettier, non-<select> dropdown is shown. We still want to autofill
+ // the non-focusable <select>.
FILTER_NON_FOCUSABLE_ELEMENTS = 1 << 2,
FILTER_ALL_NON_EDITABLE_ELEMENTS = FILTER_DISABLED_ELEMENTS |
FILTER_READONLY_ELEMENTS |
@@ -811,7 +815,9 @@ void ForEachMatchingFormFieldCommon(
if (((filters & FILTER_DISABLED_ELEMENTS) && !element->isEnabled()) ||
((filters & FILTER_READONLY_ELEMENTS) && element->isReadOnly()) ||
- ((filters & FILTER_NON_FOCUSABLE_ELEMENTS) && !element->isFocusable()))
+ // See description for FILTER_NON_FOCUSABLE_ELEMENTS.
+ ((filters & FILTER_NON_FOCUSABLE_ELEMENTS) && !element->isFocusable() &&
+ !IsSelectElement(*element)))
continue;
callback(data.fields[i], is_initiating_element, element);