[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}
4 files changed