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

Issue 2918053002: Move middle-click autoscroll to synthetic fling. (Closed)

Created:
3 years, 6 months ago by aelias_OOO_until_Jul13
Modified:
3 years, 6 months ago
Reviewers:
kenrb, bokan
CC:
blink-reviews, blink-reviews-api_chromium.org, blink-reviews-dom_chromium.org, blink-reviews-layout_chromium.org, chromium-reviews, darin-cc_chromium.org, dglazkov+blink, dtapuska+blinkwatch_chromium.org, dtapuska, dtapuska+chromiumwatch_chromium.org, eae+blinkwatch, jam, jchaffraix+rendering, kinuko+watch, leviw+renderwatch, mlamouri+watch-content_chromium.org, Navid Zolghadr, pdr+renderingwatchlist_chromium.org, rwlbuis, sof, skobes, sunyunjia, szager+layoutwatch_chromium.org, zoltan1
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Move middle-click autoscroll to synthetic fling. Middle-click autoscroll is the Windows feature where after clicking middle mouse button, the page then scrolls at a velocity depending on the distance of the mouse cursor from the start point. It's one of the few remaining scroll modalities still doing scroller latching and animation entirely on the Blink main thread. This patch moves it to the standard fling animation codepaths, allowing these scrolls to run on the compositor thread. Notes: - Middle-click autoscroll comes in "holding" and "toggle" modes. This was implicit in the previous "CanStop" logic: I refactored it into a more explicit state machine. - Device-scale-factor correctness seems to have regressed with the "page zoom for DSF" refactor. Middle-click autoscroll velocity became faster and deadzone smaller on higher-DPI. I brought back DPI normalization. - I didn't match the exact previous velocity curve as the formula is quite strange as well as framerate-dependent. I tweaked values on a simple exponentiation formula until I found something that felt similar on DPI=1 and 60fps at high speed, and with more range than before at low speeds. - This type of fling is frequently zero-velocity without actually ending (i.e. preserving the scroller latching), when the mouse cursor is within the deadzone. Thus FlingStart([0,0]) events are legal and expected. - As a next step, I plan to move selection autoscroll and drag-and-drop autoscroll to the same mechanism. Then stuff like autoscroll_layout_object_ and ScheduleMainThreadAnimation will be deleted entirely. TEST=fast/events/middleClickAutoscroll-* BUG=727964 Review-Url: https://codereview.chromium.org/2918053002 Cr-Commit-Position: refs/heads/master@{#479931} Committed: https://chromium.googlesource.com/chromium/src/+/5971e47dc08dbb773f58fd6fb13b1df7917fd295

Patch Set 1 #

Patch Set 2 : Rebase #

Patch Set 3 : Rebase and fix UseCounter crash #

Patch Set 4 : Fix bugs #

Patch Set 5 : Rebase #

Patch Set 6 : Clean up #

Total comments: 10

Patch Set 7 : Code review comments #

Patch Set 8 : Avoid potential test race with pointer clear #

Patch Set 9 : Avoid dcheck with ScheduleCursorUpdate #

Patch Set 10 : Tweak velocity curve values #

Patch Set 11 : Tweak velocity curve #

Patch Set 12 : Delete redundant cursor shape print #

Unified diffs Side-by-side diffs Delta from patch set Stats (+337 lines, -238 lines) Patch
M content/browser/renderer_host/input/gesture_event_queue.cc View 1 2 3 2 chunks +4 lines, -2 lines 0 comments Download
M content/browser/renderer_host/render_widget_host_impl.h View 1 2 2 chunks +4 lines, -0 lines 0 comments Download
M content/browser/renderer_host/render_widget_host_impl.cc View 1 2 3 4 5 3 chunks +40 lines, -0 lines 0 comments Download
M content/common/view_messages.h View 1 2 3 4 5 1 chunk +8 lines, -0 lines 0 comments Download
M content/renderer/render_widget.h View 1 2 1 chunk +3 lines, -0 lines 0 comments Download
M content/renderer/render_widget.cc View 1 2 1 chunk +12 lines, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/fast/events/middleClickAutoscroll-click-expected.txt View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/fast/events/middleClickAutoscroll-drag-expected.txt View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/fast/events/middleClickAutoscroll-event-fired-expected.txt View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/fast/events/middleClickAutoscroll-in-iframe-expected.txt View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/fast/events/middleClickAutoscroll-nested-divs-expected.txt View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/fast/events/middleClickAutoscroll-nested-divs-forbidden-expected.txt View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/fast/events/middleClickAutoscroll-use-count.html View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/fast/events/resources/middleClickAutoscroll.js View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +8 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/input/EventHandler.cpp View 1 2 3 4 5 5 chunks +22 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/core/input/KeyboardEventManager.cpp View 1 2 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/input/MouseEventManager.h View 1 2 3 4 5 6 2 chunks +4 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/input/MouseEventManager.cpp View 1 2 5 chunks +12 lines, -9 lines 0 comments Download
M third_party/WebKit/Source/core/input/ScrollManager.h View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/core/input/ScrollManager.cpp View 1 2 1 chunk +5 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutBox.cpp View 1 2 3 4 2 chunks +5 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/page/AutoscrollController.h View 1 2 3 4 5 4 chunks +38 lines, -21 lines 0 comments Download
M third_party/WebKit/Source/core/page/AutoscrollController.cpp View 1 2 3 4 5 6 7 8 9 10 9 chunks +110 lines, -190 lines 0 comments Download
M third_party/WebKit/Source/core/page/ChromeClient.h View 1 2 3 4 1 chunk +5 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/web/ChromeClientImpl.h View 1 2 3 4 1 chunk +4 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/web/ChromeClientImpl.cpp View 1 2 3 4 1 chunk +23 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/web/WebViewImpl.cpp View 1 2 3 4 2 chunks +8 lines, -5 lines 0 comments Download
M third_party/WebKit/public/web/WebWidgetClient.h View 1 2 1 chunk +4 lines, -0 lines 0 comments Download
M ui/events/blink/input_handler_proxy.cc View 1 2 3 4 5 1 chunk +3 lines, -1 line 0 comments Download

Messages

Total messages: 67 (59 generated)
aelias_OOO_until_Jul13
Hi bokan@, PTAL.
3 years, 6 months ago (2017-06-14 22:33:45 UTC) #30
bokan
https://codereview.chromium.org/2918053002/diff/100001/third_party/WebKit/Source/core/dom/Node.cpp File third_party/WebKit/Source/core/dom/Node.cpp (right): https://codereview.chromium.org/2918053002/diff/100001/third_party/WebKit/Source/core/dom/Node.cpp#newcode2355 third_party/WebKit/Source/core/dom/Node.cpp:2355: if (LocalFrame* frame = GetDocument().GetFrame()) { Nit: no braces ...
3 years, 6 months ago (2017-06-15 17:40:13 UTC) #33
bokan
I'm OOO tomorrow and all my replies were nits/questions so lgtm.
3 years, 6 months ago (2017-06-15 21:22:06 UTC) #34
aelias_OOO_until_Jul13
https://codereview.chromium.org/2918053002/diff/100001/third_party/WebKit/Source/core/dom/Node.cpp File third_party/WebKit/Source/core/dom/Node.cpp (right): https://codereview.chromium.org/2918053002/diff/100001/third_party/WebKit/Source/core/dom/Node.cpp#newcode2355 third_party/WebKit/Source/core/dom/Node.cpp:2355: if (LocalFrame* frame = GetDocument().GetFrame()) { On 2017/06/15 at ...
3 years, 6 months ago (2017-06-15 22:19:54 UTC) #37
aelias_OOO_until_Jul13
+kenrb for view_messages.h security OWNERS
3 years, 6 months ago (2017-06-15 22:26:53 UTC) #39
kenrb
ipc lgtm
3 years, 6 months ago (2017-06-15 22:58:59 UTC) #40
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2918053002/220001
3 years, 6 months ago (2017-06-16 01:27:46 UTC) #63
commit-bot: I haz the power
3 years, 6 months ago (2017-06-16 02:40:07 UTC) #67
Message was sent while issue was closed.
Committed patchset #12 (id:220001) as
https://chromium.googlesource.com/chromium/src/+/5971e47dc08dbb773f58fd6fb13b...

Powered by Google App Engine
This is Rietveld 408576698