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

Issue 1516723003: [Element / Autofill] Add boundsInViewportFloat() to fix <input> popup misalignment.

Created:
5 years ago by huangs
Modified:
5 years ago
Reviewers:
bokan, oshima
CC:
chromium-reviews, mlamouri+watch-content_chromium.org, sof, creis+watch_chromium.org, blink-reviews-dom_chromium.org, rouslan+autofill_chromium.org, jam, nasko+codewatch_chromium.org, browser-components-watch_chromium.org, jdonnelly+autofillwatch_chromium.org, bondd+autofillwatch_chromium.org, dglazkov+blink, blink-reviews, darin-cc_chromium.org, mkwst+moarreviews-renderer_chromium.org, estade+watch_chromium.org, eae+blinkwatch, vabr+watchlistautofill_chromium.org, blink-reviews-api_chromium.org, rwlbuis
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[Element / Autofill] Add boundsInViewportFloat() to fix <input> popup misalignment. For <input> elements with fractional x value, the autocomplete popup location is mismatched with <input> element. To fix this, we: 1. Add Element::boundsInViewportFloat() to compute a more precise bounds for the <input> element, to be passed to popup rendering. 2. Fix popup rendering to round the received bounds in a way that's consistent with <input> element's location. BUG=529867

Patch Set 1 #

Total comments: 2

Patch Set 2 : Refator to use boundsInViewportFloat() eventually, but keep boundsInViewportInt(). #

Unified diffs Side-by-side diffs Delta from patch set Stats (+210 lines, -40 lines) Patch
M chrome/browser/ui/autofill/popup_controller_common.cc View 1 chunk +1 line, -1 line 0 comments Download
M components/autofill/content/renderer/autofill_agent.cc View 1 2 chunks +3 lines, -4 lines 0 comments Download
M components/autofill/content/renderer/password_autofill_agent.cc View 1 2 chunks +4 lines, -4 lines 0 comments Download
M components/autofill/content/renderer/password_generation_agent.cc View 1 2 chunks +7 lines, -10 lines 0 comments Download
M content/public/renderer/render_view.h View 1 2 chunks +7 lines, -0 lines 0 comments Download
M content/renderer/pepper/pepper_plugin_instance_impl.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M content/renderer/render_view_impl.h View 1 1 chunk +3 lines, -0 lines 0 comments Download
M content/renderer/render_view_impl.cc View 1 2 chunks +12 lines, -1 line 0 comments Download
M content/renderer/render_widget.h View 2 chunks +2 lines, -0 lines 0 comments Download
M content/renderer/render_widget.cc View 3 chunks +11 lines, -7 lines 0 comments Download
M third_party/WebKit/Source/core/dom/Element.h View 1 2 chunks +4 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/dom/Element.cpp View 1 2 chunks +25 lines, -6 lines 0 comments Download
M third_party/WebKit/Source/core/frame/FrameView.h View 6 chunks +19 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/frame/FrameView.cpp View 5 chunks +53 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/input/EventHandler.cpp View 1 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/platform/Widget.h View 4 chunks +8 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/Widget.cpp View 3 chunks +24 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/scroll/ScrollableArea.h View 1 chunk +4 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/scroll/Scrollbar.h View 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/scroll/Scrollbar.cpp View 1 chunk +8 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/web/WebElement.cpp View 1 2 chunks +8 lines, -2 lines 0 comments Download
M third_party/WebKit/public/web/WebElement.h View 1 2 chunks +3 lines, -1 line 0 comments Download

Messages

Total messages: 12 (3 generated)
huangs
This is currently a proof-of-concept for the main bug. I'd like to first know if ...
5 years ago (2015-12-10 00:46:06 UTC) #3
bokan
On 2015/12/10 00:46:06, huangs wrote: > This is currently a proof-of-concept for the main bug. ...
5 years ago (2015-12-10 14:48:34 UTC) #4
bokan
https://codereview.chromium.org/1516723003/diff/1/third_party/WebKit/Source/core/dom/Element.cpp File third_party/WebKit/Source/core/dom/Element.cpp (right): https://codereview.chromium.org/1516723003/diff/1/third_party/WebKit/Source/core/dom/Element.cpp#newcode1050 third_party/WebKit/Source/core/dom/Element.cpp:1050: FloatRect Element::boundsInViewportFloat() Perhaps we should just make boundsInViewport return ...
5 years ago (2015-12-10 14:48:40 UTC) #6
huangs
On 2015/12/10 14:48:40, bokan wrote: > https://codereview.chromium.org/1516723003/diff/1/third_party/WebKit/Source/core/dom/Element.cpp > File third_party/WebKit/Source/core/dom/Element.cpp (right): > > https://codereview.chromium.org/1516723003/diff/1/third_party/WebKit/Source/core/dom/Element.cpp#newcode1050 > ...
5 years ago (2015-12-10 16:15:40 UTC) #7
huangs
https://codereview.chromium.org/1516723003/diff/1/third_party/WebKit/Source/core/dom/Element.cpp File third_party/WebKit/Source/core/dom/Element.cpp (right): https://codereview.chromium.org/1516723003/diff/1/third_party/WebKit/Source/core/dom/Element.cpp#newcode1050 third_party/WebKit/Source/core/dom/Element.cpp:1050: FloatRect Element::boundsInViewportFloat() On 2015/12/10 14:48:39, bokan wrote: > Perhaps ...
5 years ago (2015-12-10 16:16:14 UTC) #8
bokan
boundsInViewport already truncates from floats to ints. If we just returned the float version the ...
5 years ago (2015-12-10 17:12:39 UTC) #9
oshima
On 2015/12/10 17:12:39, bokan wrote: > boundsInViewport already truncates from floats to ints. If we ...
5 years ago (2015-12-10 18:13:03 UTC) #10
huangs
In principle this works, since unite() and enclosingBoundingBox() commute. The problem though is that the ...
5 years ago (2015-12-10 21:19:30 UTC) #11
huangs
5 years ago (2015-12-10 21:54:54 UTC) #12
Updated.  Please note that this CL is only a prototype.  I'm going to go ahead
and do some refactoring first:

1. Implement oshima@'s suggestion to make convertViewportToWindow() use float,
and update all callers.
2. Add boundsInViewportFloat(), Rename boundsInViewport() -->
boundsInViewportInt() and make it call the Float() version, mechanical rename
for callers.
3. (Somehow) deal with coordinate conversion stuff in Widget.h.

Then we'll worry about the other stuff.

Powered by Google App Engine
This is Rietveld 408576698