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

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

Issue 17391012: Implement 'invalid' AutocompleteErrorEvent#reason (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 6 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
Index: components/autofill/content/renderer/autofill_agent.cc
diff --git a/components/autofill/content/renderer/autofill_agent.cc b/components/autofill/content/renderer/autofill_agent.cc
index 6e9b547a8afcc0b7fc3a001b70f1b501b1eb6511..04ed410cc7a1c58646946035cee8e93498aaf6a8 100644
--- a/components/autofill/content/renderer/autofill_agent.cc
+++ b/components/autofill/content/renderer/autofill_agent.cc
@@ -744,8 +744,11 @@ void AutofillAgent::OnRequestAutocompleteResult(
if (in_flight_request_form_.isNull())
return;
- if (result == WebFormElement::AutocompleteResultSuccess)
+ if (result == WebFormElement::AutocompleteResultSuccess) {
FillFormIncludingNonFocusableElements(form_data, in_flight_request_form_);
+ if (!in_flight_request_form_.checkValidityWithoutDispatchingEvents())
+ result = WebFormElement::AutocompleteResultErrorInvalid;
+ }
in_flight_request_form_.finishRequestAutocomplete(result);
in_flight_request_form_.reset();

Powered by Google App Engine
This is Rietveld 408576698