0

Impulse scrolling on by default.

This CL turns impulse based scrolling on by default.
Design doc: https://docs.google.com/document/d/1rzf_SpkCVOZeXS_jPS2YjLBDzBxyArIVYRrPhbkHsNk/edit?usp=sharing

Bug: 1163449
Change-Id: I3295b76d4455472b2f1c63f26e99efaa467130bd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2612518
Commit-Queue: Rahul Arakeri <arakeri@microsoft.com>
Reviewed-by: Robert Flack <flackr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#850847}
This commit is contained in:
Rahul Arakeri
2021-02-04 23:23:35 +00:00
committed by Chromium LUCI CQ
parent 3ccc0e4172
commit 8f8e1306c0
2 changed files with 16 additions and 3 deletions
cc/base
third_party/blink/web_tests/fast/scroll-behavior/smooth-scroll

@ -10,7 +10,7 @@ namespace features {
// Enables impulse-style scroll animations in place of the default ones.
const base::Feature kImpulseScrollAnimations = {
"ImpulseScrollAnimations", base::FEATURE_DISABLED_BY_DEFAULT};
"ImpulseScrollAnimations", base::FEATURE_ENABLED_BY_DEFAULT};
// Whether the compositor should attempt to sync with the scroll handlers before
// submitting a frame.

@ -21,7 +21,20 @@ body {
await mouseMoveTo(790, 280);
await mouseDownAt(790, 280);
// TODO(crbug.com/1172003): This needs to be fixed for track autoscrolls.
// Impulse based animations have a longer duration than the default ease
// in/out curve. So when an autoscroll animation is initiated (~250ms
// after the initial mousedown), the animation generated by the initial
// mousedown on the scrollbar track will need to be aborted by the
// cc::ScrollbarController (as the cc::KeyframeModel doesn't allow multiple
// sources animating the scroll offset). As a result, the thumb can be
// anywhere between 0 and pageStep. As long as the thumb doesn't cross the
// pointer location (i.e the offset at pageStep), this test is considered
// successful. (Note that this is not an issue while using the default ease
// in/out curve because the initial mousedown animation would've already
// finished by the time the autoscroll animation is being kicked off)
await waitForAnimationEndTimeBased( () => { return scrollY; } );
assert_equals(window.scrollY, pageStep);
assert_true(window.scrollY > 0 && window.scrollY <= pageStep,
"window.scrollY = " + window.scrollY + " ");
}, 'Scrollbar track autoscrolling doesn\'t overshoot cursor.');
</script>
</script>