[webkit-dev] [CSSOM View] Smooth scroll behavior via CSS property / DOM scroll* API

Frédéric Wang fwang at igalia.com
Thu Sep 20 13:26:12 PDT 2018

Hi all,

This email is to announce that I have started to work on (programmatic)
smooth scrolling in WebKit from the CSSOM View specification [1]. To use
this effect, web developers can pass a behavior parameter (auto, smooth,
or instant) to Element.scroll, Element.scrollTo, Element.scrollBy,
Element.scrollIntoView, Window.scroll, Window.scrollTo or
Window.scrollBy [2]. When behavior is auto, the instant/smooth
characteristic is actually taken from the value of a new CSS
scroll-behavior property [3]. This new feature will be protected by a
compile flag (enabled by default) and a runtime flag (an experimental
feature). If you are interested, you can follow advancement on Bugzilla [4].

Incidentally (and since that was convenient to do it before) I also
added some basic support for new ScrollIntoView options [5] [6] that
allow to specify how you want the revealed element to be aligned with
respect to its scrollable ancestors.



[1] https://drafts.csswg.org/cssom-view
[2] https://drafts.csswg.org/cssom-view/#dictdef-scrolloptions
[3] https://drafts.csswg.org/cssom-view/#propdef-scroll-behavior
[4] https://bugs.webkit.org/show_bug.cgi?id=188043
[5] https://bugs.webkit.org/show_bug.cgi?id=189258
[6] https://drafts.csswg.org/cssom-view/#dictdef-scrollintoviewoptions

More information about the webkit-dev mailing list