forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Reland] Deleted ScrollbarLayerImplBase arg from ScrollbarController.
- Reverted change: crrev.com/c/2174809 - Reverted CL is in PS1. - Reverted because ScrollbarController::StartAutoScrollAnimation tried to dereference a null ScrollbarLayerImplBase. - Relanded CL + fix is in the latest PS. Root cause: When the user rapidly clicks on the scrollbar, a second mousedown can arrive within the same VSync as the first mousedown. When handling the second mousedown, the first thing that happens is that the ScrollbarController schedules an autoscroll task. After this, the InputHandlerProxy notices that this 2nd mousedown occurred in the same VSync and that will lead to LayerTreeHostImpl::ScrollEnd getting called. ScrollbarController::captured_scrollbar_metadata_ then gets cleared by ScrollEnd. Due to this, the scrollbar layer reference that is needed by StartAutoScrollAnimation is null. The previously scheduled autoscroll task then tries to proceed (after 250ms) by using a null ScrollbarLayer and fails. Why didn't this fail before this change: This bug was masked because when the autoscroll task was previously created, a pointer to the scrollbar layer was directly passed from the HandlePointerDown to StartAutoScrollAnimation. This reference always remains valid even though the InputHandlerProxy cancelled the scroll. With the refactor, the scrollbar layer needed for StartAutoScrollAnimation is now queried on demand using captured_scrollbar_metadata_ which gets cleared on ScrollEnd and this is what exposed the bug. The fix is to clear the scheduled autoscroll task as well on ScrollEnd. Original description: This CL gets rid of the several ScrollbarLayerImplBase references in the private methods of ScrollbarController. They need not be passed around because the ScrollbarLayerImplBase can easily be looked up by calling ScrollbarController::ScrollbarLayer (which retrieves the needed scrollber layer by using CapturedScrollbarMetadata::scroll_element_id). Bug: 1077093, 1078765 Change-Id: Ida68e4323e69757a7bfaeab7a7986fb64d07feb2 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2224606 Commit-Queue: Rahul Arakeri <arakeri@microsoft.com> Reviewed-by: David Bokan <bokan@chromium.org> Cr-Commit-Position: refs/heads/master@{#774367}
- Loading branch information
Rahul Arakeri
authored and
Commit Bot
committed
Jun 2, 2020
1 parent
77e94e0
commit 2e22246
Showing
3 changed files
with
159 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.