New issue
Advanced search Search tips

Issue 852549 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Closed: Jan 7
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

scrollIntoView({ behavior: "smooth" }) takes a long time on long pages

Project Member Reported by domenic@chromium.org, Jun 13 2018

Issue description

Chrome 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
 
Description: Show this description

Comment 2 by bokan@chromium.org, Jun 14 2018

Owner: sunyunjia@chromium.org
Status: Assigned (was: Untriaged)
Agreed. Sandra, could we tweak the curves to better work on very long pages?
Project Member

Comment 3 by bugdroid1@chromium.org, 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

Status: Fixed (was: Assigned)
Cc: sunyunjia@chromium.org chelamcherla@chromium.org
 Issue 919332  has been merged into this issue.
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