Chromium Code Reviews| Index: chrome/browser/ui/autofill/chrome_autofill_client.cc |
| diff --git a/chrome/browser/ui/autofill/chrome_autofill_client.cc b/chrome/browser/ui/autofill/chrome_autofill_client.cc |
| index 6b85038c7ef3f6ec306378270330550825c2d9fc..01583c02de0ee00cb0466c8dfcb7cfd12079e669 100644 |
| --- a/chrome/browser/ui/autofill/chrome_autofill_client.cc |
| +++ b/chrome/browser/ui/autofill/chrome_autofill_client.cc |
| @@ -253,6 +253,16 @@ void ChromeAutofillClient::ShowAutofillPopup( |
| base::WeakPtr<AutofillPopupDelegate> delegate) { |
| // Convert element_bounds to be in screen space. |
| gfx::Rect client_area = web_contents()->GetContainerBounds(); |
| + |
| + // Element bounds are relative to the viewport (client_area). |
| + if ((element_bounds.y() + element_bounds.height()) < 0 || |
|
Evan Stade
2017/01/18 00:05:46
nit: element_bounds.bottom()
lgarron
2017/04/05 00:59:42
Ooh, good to know.
|
| + (element_bounds.y() + element_bounds.height()) >= client_area.height()) { |
|
Evan Stade
2017/01/18 00:05:46
what about the x direction? Seems like this should
lgarron
2017/04/05 00:59:43
Oh, right. I explicitly discussed this with estark
|
| + // The top of the popup would be outside the viewport (and would disappear |
| + // before the relevant field can scroll into the viewport), so we supress |
|
Evan Stade
2017/01/18 00:05:46
nit: suppress
lgarron
2017/04/05 00:59:41
Done.
|
| + // it to avoid crbug.com/678713 |
| + return; |
| + } |
| + |
| gfx::RectF element_bounds_in_screen_space = |
| element_bounds + client_area.OffsetFromOrigin(); |