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

Issue 2641643002: Suppress Autofill popup if it would be outside the viewport. (Closed)

Created:
3 years, 11 months ago by lgarron
Modified:
3 years, 8 months ago
Reviewers:
Evan Stade
CC:
chromium-reviews, estade+watch_chromium.org, estark, mathp+autofillwatch_chromium.org, Roger McFarlane (Chromium), rouslan+autofill_chromium.org, sebsg+autofillwatch_chromium.org, vabr+watchlistautofill_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Suppress Autofill popup if it would be outside the viewport. This is not a problem for the usual autofill popup, since th focused field will move the viewport. However, it is relevant to the separate "Form Not Secure" popup that is shown for autofilled fields on HTTP pages at page load. TEST= 1) Enable chrome://flags#enable-http-form-warning 2) Store a password on http://rsolomakhin.github.io/autofill/ under "Name/Password" 3) Reload the page with so that the password field and credit card field are both in the viewport. Verify that "Login Not Secure" appears (see just-inside-viewport-bottom.png at crbug.com/678713#c11) 4) Resize the browser so that the password field is below the viewport and reload. Verify that "Login Not Secure" does *not* (see just-outside-viewport-bottom.png at crbug.com/678713#c11) BUG=678713

Patch Set 1 #

Total comments: 6

Patch Set 2 : Calculate using screen coordinates. #

Patch Set 3 : Suppress Autofill popup if it would be outside the viewport. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+9 lines, -0 lines) Patch
M chrome/browser/ui/autofill/chrome_autofill_client.cc View 1 2 1 chunk +9 lines, -0 lines 0 comments Download

Messages

Total messages: 8 (3 generated)
lgarron
estade@, could you review? (If this is not the appropriate place for such a fix, ...
3 years, 11 months ago (2017-01-17 23:37:34 UTC) #3
Evan Stade
Some questions: a) why do we show the warning before the element is focused? b) ...
3 years, 11 months ago (2017-01-18 00:05:47 UTC) #4
lgarron
On 2017/01/18 at 00:05:47, estade wrote: > Some questions: > > a) why do we ...
3 years, 11 months ago (2017-01-18 01:16:16 UTC) #6
Evan Stade
On 2017/01/18 01:16:16, lgarron wrote: > On 2017/01/18 at 00:05:47, estade wrote: > > Some ...
3 years, 11 months ago (2017-01-18 01:33:13 UTC) #7
lgarron
3 years, 8 months ago (2017-04-05 00:59:45 UTC) #8
Message was sent while issue was closed.
Publishing leftover comments to get this out of my review queue.

https://codereview.chromium.org/2641643002/diff/1/chrome/browser/ui/autofill/...
File chrome/browser/ui/autofill/chrome_autofill_client.cc (right):

https://codereview.chromium.org/2641643002/diff/1/chrome/browser/ui/autofill/...
chrome/browser/ui/autofill/chrome_autofill_client.cc:258: if
((element_bounds.y() + element_bounds.height()) < 0 ||
On 2017/01/18 at 00:05:46, Evan Stade wrote:
> nit: element_bounds.bottom()

Ooh, good to know.

https://codereview.chromium.org/2641643002/diff/1/chrome/browser/ui/autofill/...
chrome/browser/ui/autofill/chrome_autofill_client.cc:259: (element_bounds.y() +
element_bounds.height()) >= client_area.height()) {
On 2017/01/18 at 00:05:46, Evan Stade wrote:
> what about the x direction? Seems like this should be something like
> 
> if (!gfx::Rect(client_area.size()).Contains(element_bounds))

Oh, right. I explicitly discussed this with estark@, then promptly forgot to put
it in the code. :-(

Anyhow, your code doesn't work as-is because of Rect/RectF incompatibility, but
that made me realize that it's cleaner to do the calculations using screen
coordinates right after calculating element_bounds_in_screen_space.

https://codereview.chromium.org/2641643002/diff/1/chrome/browser/ui/autofill/...
chrome/browser/ui/autofill/chrome_autofill_client.cc:261: // before the relevant
field can scroll into the viewport), so we supress
On 2017/01/18 at 00:05:46, Evan Stade wrote:
> nit: suppress

Done.

Powered by Google App Engine
This is Rietveld 408576698