This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 25728 - element.scrollIntoView should implement scrolling animation
Summary: element.scrollIntoView should implement scrolling animation
Status: RESOLVED WORKSFORME
Alias: None
Product: CSS
Classification: Unclassified
Component: CSSOM View (show other bugs)
Version: unspecified
Hardware: PC All
: P2 enhancement
Target Milestone: ---
Assignee: Simon Pieters
QA Contact: public-css-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-05-15 16:57 UTC by Kevin Suttle
Modified: 2014-11-11 13:36 UTC (History)
3 users (show)

See Also:


Attachments

Description Kevin Suttle 2014-05-15 16:57:21 UTC
Jumping the user to and from anchors is a jarring experience.

Suggested DOM function signature:

element.scrollIntoView(alignWithTop, scrollDuration, scrollSpeed, scrollEasing)
Comment 1 Kevin Suttle 2014-05-15 17:04:41 UTC
This options here demonstrate what I'm referencing. Unlike this code, however, the values wouldn't need data-* attributes.

https://github.com/cferdinandi/smooth-scroll#global-settings
Comment 2 David Burns :automatedtester 2014-05-15 19:13:39 UTC
Kevin,

Do you mean this bug for webdriver as Comment 1 doesnt appear to use the webdriver API or do you mean it for DOM?
Comment 3 Kevin Suttle 2014-05-28 16:58:40 UTC
(In reply to David Burns :automatedtester from comment #2)
> Kevin,
> 
> Do you mean this bug for webdriver as Comment 1 doesnt appear to use the
> webdriver API or do you mean it for DOM?

Apologies. For DOM.
Comment 4 Simon Pieters 2014-11-11 13:36:10 UTC
The spec supports scrollIntoView({behavior:"smooth"})
http://dev.w3.org/csswg/cssom-view/#extensions-to-the-element-interface

Alternatively you can set scroll-behavior: smooth; CSS property, which also scrolls smoothly when navigating to a fragment identifier.
http://dev.w3.org/csswg/cssom-view/#smooth-scrolling:-the-'scroll-behavior'-property

Please reopen if this does not sufficient.