github web-platform-tests/wpt merge_pr_46670

latest releases: merge_pr_49470, epochs/three_hourly/2024-12-03_06H, epochs/six_hourly/2024-12-03_06H...
7 months ago

Quit no-op smooth programmatic scrolls early

In the linked bug, repeatedly invoking scrollIntoView on the same
element with a very short interval resulted in no eventual scroll
because Blink would cancel the ongoing scroll and start a new one,
even though both scrolls were exactly identical.

This patch addresses this by having ProgrammaticScrollAnimator detect
that it is being asked to go to the same offset and quit early in such
cases, avoiding the unnecessary (deleterious even) cancellation and
recreation of scrolls.

Note that only a scrollTo web test for this issue is enabled in
smooth-scroll-nonstop.html because scrollIntoViews has the additional
hurdle (which is being addressed in crbug.com/325081538) that a
sequenced scroll cancels all other ongoing sequenced scrolls. When that
issue is addressed we can enable the scrollIntoView test.

Bug: 4086582
Change-Id: I100ba59b2410e1fccf7ec7066acda6cce978e157
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5597984
Commit-Queue: David Awogbemila awogbemila@chromium.org
Reviewed-by: Robert Flack flackr@chromium.org
Cr-Commit-Position: refs/heads/main@{#1312715}

Don't miss a new wpt release

NewReleases is sending notifications on new releases.