Intent to Implement: CSS Scroll Snap Points

476 views
Skip to first unread message

Majid Valipour

unread,
Jun 8, 2015, 2:10:30 PM6/8/15
to blink-dev

Contact emails

maj...@chromium.org, vol...@chromium.org, rby...@chromium.org


Spec

http://www.w3.org/TR/css-snappoints-1/


Summary

CSS scroll snap points specification introduces snap points as a way to "enforce the scroll offsets that a scroll container’s visual viewport may end at after a scrolling operation has completed". The term scrolling operation refers to any user input scrolling such as touch, wheel scrolling, or scrollbar dragging.


Motivation

Snap points aims to help web developers create well-controlled scrolling experiences such as scrolling through paginated content. 


Quoting from the spec: 

"Popular UX paradigms for scrollable content frequently employ paging through content, or sectioning into logical divisions. This is especially true for touch interactions where it is quicker and easier for users to quickly pan through a flatly-arranged breadth of content rather than delving into a hierarchical structure through tap navigation. For example, it is easier for a user to view many photos in a photo album by panning through a photo slideshow view rather than tapping on individual photos in an album.


However, given the imprecise nature of scrolling inputs like touch panning and mousewheel scrolling, it is difficult for web developers to guarantee a well-controlled scrolling experience, in particular creating the effect of paging through content. For instance, it is easy for a user to land at an awkward scroll offset which leaves a page partially on-screen when panning."


Compatibility Risk

Internet Explorer: Shipped

Firefox: In development

Safari: In development

Web developers: Positive


Describe the degree of compatibility risk you believe this change poses

We expect all three major browsers to ship this spec. Our decision to implement it is partially motivated to improve compatibility between browsers. We are aware of upcoming changes to the spec and plan to remain compliant to the spec as it changed.


Ongoing technical constraints

Our current design uses WIP primitives such as Compositor Worker, and Scroll Customization to keep the majority of snap points implementation outside blink core as a way to reduce its footprint. Our hope is that by taking this approach and pushing for development of powerful (web-exposed) primitives some day it becomes possible to implement an efficient version of snap points as a library using only web-exposed API.


A high level design document is available here.


Will this feature be supported on all six Blink platforms (Windows, Mac, Linux,

Chrome OS, Android, and Android WebView)?

Yes. However our first implementation round focuses on touch input and fast compositor scrolling cases.


OWP launch tracking bug

http://crbug.com/497851


Link to entry on the Chromium Dashboard

https://www.chromestatus.com/features/5721832506261504

Requesting approval to ship?

No

Reply all
Reply to author
Forward
0 new messages