Ensure logical scrolling does not happen if scroller snaps
The contract for `SnapCoordinator::PerformSnapping` is that it returns true when scroll operations results in snapping. Returning true ensures we skip the logical scroll. In a previous patch [1] the logic was incorrectly changed to return true only if we snap *and scroll as a result of the snap*. This meant that if we snap to current position, that snap operation is ignored as it does not cause any scrolling. This lead to failure of a few tests. This patch reverts that change. It also removes a unnecessary check where we check in snap logic where it tries to avoid scrolling if offsets are the same. `ScrollableArea::SetScrollOffset` already has similar shortcuts so there is no need to recreate them here which may have contributed to the error. Note: At the time [1] was landing at least one of the two tests affected [2] was marked as skipped (See http://crbug.com/922951), and the other test started flaking one day after [1] was landed (See http://crbug.com/986018). [1] https://chromium.googlesource.com/chromium/src/+/b65606034fd91c1aaf1d132a7601721e552d625f%5E%21/#F3 [2] fast/scroll-snap/snaps-after-keyboard-scrolling.html Bug: 986018 Change-Id: Iae0c0ae9cdef58023bb1bcd2b6fb12fbff13ecc5 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1769044Reviewed-by:David Bokan <bokan@chromium.org> Commit-Queue: Majid Valipour <majidvp@chromium.org> Cr-Commit-Position: refs/heads/master@{#693928}
Showing
Please register or sign in to comment