commit | 8a6503147055c98cb1fcd5a70a19f16fc771050f | [log] [tgz] |
---|---|---|
author | Rahul Arakeri <arakeri@microsoft.com> | Tue Jul 30 17:01:12 2019 |
committer | Commit Bot <commit-bot@chromium.org> | Tue Jul 30 17:01:12 2019 |
tree | 9a5da2996710d531487a421df470eccb26b718e1 | |
parent | dbd6ef7c7f5b96729f9a3bff1a91320a36a08d01 [diff] |
[Reland] Fix for thumb drag and pointer offset. The original CL was reverted because one of the content_browsertests (ScrollLatencyCompositedScrollbarBrowserTest.ScrollbarThumbDragLatency) got flaky. This failure was not caught because all TryJobs passed the dry run on retries (crbug.com/988443) Reason for the flakiness: This CL exposed a pre existing race condition. The issue only now came to light because this CL changes how thumb drag takes place. ScrollbarController::HandleMouseMove now calls ComputeScrollDelta for calculating the clamped delta. ComputeScrollDelta is where execution aborts due to the scroll_node being null. The reason the scroll_node is sometimes null here is because the mousemove reaches ComputeScrollDelta before GSB has had a chance to set up the scroll_node (due to queueing). See crbug.com/988308 for more details. Reverted CL is crrev.com/c/1684532 Reverted CL is in PS2. New CL is in PS6. [Description from the original CL]: Fixes an issue with thumb drags for compositor threaded scrollbar scrolling. When you click and drag the thumb past the track and then reverse your drag direction, the pointer no longer sticks to the thumb and instead, maintains a constant offset with the thumb as it moves. The reason this happens is because the scroll offset calculation in the ScrollbarController simply uses 2 factors to calculate the delta. One of them is the previous_pointer_position_ and the other is the current pointer location (i.e position_in_widget). There is no logic to check if the difference between these 2 factors should indeed generate a GSU or not. The fix is to make the thumb drag delta calculation relative to the layer and then use LayerTreeHostImpl::CanConsumeDelta to determine if a scroll should be initiated. Bug: 1684532 Change-Id: I4a12729ae77725f4a7aac0b02c4b7a3368d8e935 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1722157 Reviewed-by: David Bokan <bokan@chromium.org> Commit-Queue: Rahul Arakeri <arakeri@microsoft.com> Cr-Commit-Position: refs/heads/master@{#682326}
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure .