scrollIntoView({ behavior: "smooth" }) takes a long time on long pages |
|||
Issue descriptionChrome Version: 69.0.3452.0 (Official Build) canary (64-bit) (cohort: Clang-64) OS: Win 10 What steps will reproduce the problem? (1) Go to https://html.spec.whatwg.org/ ; wait for the full thing to load (2) Open the developer console (3) Execute the code document.body.lastElementChild.scrollIntoView({behavior: 'smooth', 'block': 'end'}); What is the expected result? The last element scrolls into view within a second or two (This is what Firefox does) What happens instead? The last element scrolls into view over the course of ~25 seconds ---- This is not a spec-comformance bug; the spec is vague, saying > When a user agent is to perform a smooth scroll of a scrolling box box to position, it must update the scroll position of box in a user-agent-defined fashion over a user-agent-defined amount of time. But, I think it's a suboptimal user experience, to have scrolling time scale without limit. I think a cap of a few seconds would be a good idea. First discussed at https://github.com/valdrinkoshi/virtual-scroller/issues/99#issuecomment-397084347
,
Jun 14 2018
Agreed. Sandra, could we tweak the curves to better work on very long pages?
,
Jan 4
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/ce9b54be312c4ebc1872989627a2f53d36503cf1 commit ce9b54be312c4ebc1872989627a2f53d36503cf1 Author: Sandra Sun <sunyunjia@chromium.org> Date: Fri Jan 04 23:46:31 2019 Limit long-distance programmatic scroll curves to 3 seconds. Currently, the duration of programmatic smooth scroll curves depend on the distance of the scroll delta. However, it could be considerably long for long pages. This patch sets an upper-limit of 3 seconds for the programmatic smooth scrolls. For shorter scrolls, the duration would still be related to the delta. Bug: 852549 Change-Id: Idbb95a15b7440a16c3e3632f063daa7b7e8fe705 Reviewed-on: https://chromium-review.googlesource.com/c/1396493 Commit-Queue: David Bokan <bokan@chromium.org> Reviewed-by: David Bokan <bokan@chromium.org> Cr-Commit-Position: refs/heads/master@{#620111} [modify] https://crrev.com/ce9b54be312c4ebc1872989627a2f53d36503cf1/cc/animation/scroll_offset_animation_curve.cc [modify] https://crrev.com/ce9b54be312c4ebc1872989627a2f53d36503cf1/third_party/blink/renderer/core/page/scrolling/scroll_into_view_test.cc
,
Jan 7
,
Jan 8
,
Jan 8
FWIW, 3 seconds still seems like too long to me, but I'll see how it feels in the next canary. |
|||
►
Sign in to add a comment |
|||
Comment 1 by domenic@chromium.org
, Jun 13 2018