Chromium Code Reviews| 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 9677f8c184a7bfb23fe3f38e50ed461c3b9d9150..deea51c1a8332eb1af0000ac9a48106a25b40298 100644 |
| --- a/components/autofill/content/renderer/form_autofill_util.cc |
| +++ b/components/autofill/content/renderer/form_autofill_util.cc |
| @@ -1203,6 +1203,7 @@ bool ExtractFormData(const WebFormElement& form_element, FormData* data) { |
| } |
| bool IsFormVisible(blink::WebFrame* frame, |
| + const blink::WebFormElement& form_element, |
| const GURL& canonical_action, |
| const GURL& canonical_origin, |
| const FormData& form_data) { |
| @@ -1232,6 +1233,11 @@ bool IsFormVisible(blink::WebFrame* frame, |
| if (action_is_empty != form_action_is_empty) |
| continue; |
| + // Try to match the WebFormElement reference first. |
|
dvadym
2017/03/14 17:11:10
I think it's better to move up these lines before
sense (YandexTeam)
2017/03/15 04:51:24
Yes, I agree.
|
| + if (!form_element.isNull() && form.equals(form_element)) { |
|
dvadym
2017/03/14 17:11:10
Nit: you can use == operator (form == form_element
|
| + return true; // Form still exists. |
| + } |
| + |
| if (action_is_empty) { // Both actions are empty, compare all fields. |
| FormData extracted_form_data; |
| WebFormElementToFormData(form, WebFormControlElement(), nullptr, |