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 51c745fdb5253cc1f0c28c746ea1f677beb2a098..82a99092e6bfeca1e54c073814b45bd423e7dda8 100644 |
| --- a/components/autofill/content/renderer/form_autofill_util.cc |
| +++ b/components/autofill/content/renderer/form_autofill_util.cc |
| @@ -1258,7 +1258,7 @@ bool IsFormVisible(blink::WebFrame* frame, |
| bool IsSomeControlElementVisible( |
| const WebVector<WebFormControlElement>& control_elements) { |
| for (const WebFormControlElement& control_element : control_elements) { |
| - if (IsWebNodeVisible(control_element)) |
| + if (IsWebElementVisible(control_element)) |
| return true; |
| } |
| return false; |
| @@ -1333,14 +1333,10 @@ const base::string16 GetFormIdentifier(const WebFormElement& form) { |
| return identifier; |
| } |
| -bool IsWebNodeVisible(const blink::WebNode& node) { |
| - // TODO(esprehn): This code doesn't really check if the node is visible, just |
| - // if the node takes up space in the layout. Does it want to check opacity, |
| - // transform, and visibility too? |
| - if (!node.isElementNode()) |
| - return false; |
| - const WebElement element = node.toConst<WebElement>(); |
| - return element.hasNonEmptyLayoutSize(); |
| +bool IsWebElementVisible(const blink::WebElement& element) { |
| + bool res = g_prevent_layout ? element.hasNonEmptyLayoutSize() |
|
vabr (Chromium)
2017/03/23 20:14:09
I don't know whether hasNonEmptyLayoutSize can tri
kolos1
2017/03/28 09:34:30
Added a comment here. Please review.
|
| + : element.isFocusable(); |
| + return res; |
| } |
| std::vector<blink::WebFormControlElement> ExtractAutofillableElementsFromSet( |