Skip to content

Commit

Permalink
Bug 1821083 [wpt PR 38883] - Avoid extra scrollend events on scroll v…
Browse files Browse the repository at this point in the history
…ia keys, a=testonly

Automatic update from web-platform-tests
Avoid extra scrollend events on scroll via keys

Scrolling via keyboard currently causes scrollend events to fire several
times before the scroll actually ends. This happens because when
handling a scroll, ScrollAnimator::UserScroll will execute the callbacks
from previous keydown events in the sequence of repeating keys.

This patch builds on crrev.com/c/4168692: Provide a boolean
interrupted_by_another parameter to ScrollableArea::ScrollCallback's
signature which inndicates whether the a scroll animation was
interrupted by another one. ScrollableArea::OnScrollFinished will
enqueue a scrollend event only the scroll animation was not interrupted
by another scroll.

Bug: 1400445
Change-Id: If2eb1ef8b40a2de7fce1fd0ea2d51eedca97937e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4316503
Reviewed-by: Robert Flack <flackr@chromium.org>
Commit-Queue: David Awogbemila <awogbemila@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1119972}

--

wpt-commits: c6bcc4f9ba2c6f8f640f7bd341fee1d4760225d9
wpt-pr: 38883
  • Loading branch information
David Awogbemila authored and moz-wptsync-bot committed Apr 12, 2023
1 parent a225fb9 commit 82599f9
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ async function verifyScrollStopped(test, target_div) {
const y = target_div.scrollTop;
return new Promise(resolve => {
test.step_timeout(() => {
assert_equals(x, target_div.scrollLeft);
assert_equals(y, target_div.scrollTop);
assert_equals(target_div.scrollLeft, x);
assert_equals(target_div.scrollTop, y);
resolve();
}, unscaled_pause_time_in_ms);
});
Expand Down

0 comments on commit 82599f9

Please sign in to comment.