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 26941 - The 'scroll-behavior' CSS property should accept 'auto'.
Summary: The 'scroll-behavior' CSS property should accept 'auto'.
Status: RESOLVED WONTFIX
Alias: None
Product: CSS
Classification: Unclassified
Component: CSSOM View (show other bugs)
Version: unspecified
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: Simon Pieters
QA Contact: public-css-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-09-30 20:11 UTC by Kearwood "Kip" Gilbert
Modified: 2014-10-15 10:02 UTC (History)
0 users

See Also:


Attachments

Description Kearwood "Kip" Gilbert 2014-09-30 20:11:40 UTC
the CSSOM-View specification, section 14.1 (14.1 Smooth Scrolling: The 'scroll-behavior' Property), describes the 'scroll-behavior' CSS property as allowing two values, 'instant' and 'smooth':

http://www.w3.org/TR/cssom-view/#smooth-scrolling:-the-%27scroll-behavior%27-property

The default value, 'instant', may be misleading as many scrolling actions are animated smoothly by default in our implementation (and others).  I propose that 'auto' be an allowed value, and be the default.

The value of 'smooth' would remain as defined in the CSSOM-View specification; however, there would be some distinction between 'auto' and 'instant'.  'auto' may result in a mixture of smooth and instant scrolling animations, defined by existing UA behavior.  'instant' will result in scrolling events that normally animate smoothly by default be scrolled instantly.  If a UA does not scroll smoothly by default for any events, 'auto' and 'instant' can be synonymous in their implementation.
Comment 1 Simon Pieters 2014-09-30 21:11:54 UTC
Please use editor's draft: http://dev.w3.org/csswg/cssom-view/#smooth-scrolling:-the-'scroll-behavior'-property

Can you clarify which cases use smooth scrolling today? Note that the property only applies when scrolling happens due to navigation or CSSOM scrolling APIs.
Comment 2 Kearwood "Kip" Gilbert 2014-09-30 22:07:51 UTC
Smooth scrolling occurs with keyboard scrolling, with scroll-bar interaction, and to align the scroll offset to snap points for CSS scroll snapping. (http://dev.w3.org/csswg/css-snappoints/)

Section 14.1 (Smooth Scrolling: The 'scroll-behavior' Property), states:

"The 'scroll-behavior' property specifies the scrolling behavior for a scrolling box, when scrolling happens due to navigation or CSSOM scrolling APIs. Scrolls that are performed by the user are not affected by this property. When this property is specified on the root element, it applies to the viewport instead."

Would the smooth scroll animation that results from arrow key, page-up/page-down key, home/end key, and scroll bar click events be considered "performed by the user"?  (In the normal case it seems so)

When combined with CSS scroll snapping, the destination of these smooth scroll animations is altered to ensure that the destination is a valid snap point.  This is grey area in terms of being "performed by the user".

Future use cases may involve platform default smooth scrolling behavior that have not yet been discovered yet (see multi-touch navigation gestures and WebVR UX yet to be defined).

To enable content authors to explicitly disable all smooth scrolling animation (including the scroll bar smooth scrolling and scroll snapping animations), would the scroll-behavior CSS property be the ideal interface for this?
Comment 3 Simon Pieters 2014-09-30 22:34:55 UTC
(In reply to Kearwood "Kip" Gilbert from comment #2)
> Smooth scrolling occurs with keyboard scrolling, with scroll-bar
> interaction, and to align the scroll offset to snap points for CSS scroll
> snapping. (http://dev.w3.org/csswg/css-snappoints/)
> 
> Section 14.1 (Smooth Scrolling: The 'scroll-behavior' Property), states:
> 
> "The 'scroll-behavior' property specifies the scrolling behavior for a
> scrolling box, when scrolling happens due to navigation or CSSOM scrolling
> APIs. Scrolls that are performed by the user are not affected by this
> property. When this property is specified on the root element, it applies to
> the viewport instead."
> 
> Would the smooth scroll animation that results from arrow key,
> page-up/page-down key, home/end key, and scroll bar click events be
> considered "performed by the user"?  (In the normal case it seems so)

Yes.

> When combined with CSS scroll snapping, the destination of these smooth
> scroll animations is altered to ensure that the destination is a valid snap
> point.  This is grey area in terms of being "performed by the user".

I think the scroll is still performed by the user, but I can clarify it.

> Future use cases may involve platform default smooth scrolling behavior that
> have not yet been discovered yet (see multi-touch navigation gestures and
> WebVR UX yet to be defined).

Sure.

> To enable content authors to explicitly disable all smooth scrolling
> animation (including the scroll bar smooth scrolling and scroll snapping
> animations), would the scroll-behavior CSS property be the ideal interface
> for this?

Why would you want to disable smooth user scrolling?
Comment 4 Kearwood "Kip" Gilbert 2014-09-30 23:32:41 UTC
Thanks for your quick feedback.

(In reply to Simon Pieters from comment #3)
> 
> > To enable content authors to explicitly disable all smooth scrolling
> > animation (including the scroll bar smooth scrolling and scroll snapping
> > animations), would the scroll-behavior CSS property be the ideal interface
> > for this?
> 
> Why would you want to disable smooth user scrolling?

One use case would be a spreadsheet application.  In this case, it might be desirable to snap to a cell boundary without the animation.
Comment 5 Simon Pieters 2014-10-01 10:17:49 UTC
Interesting. I see that OpenOffice indeed has instant snapping for user scrolling. Can you bring this up on www-style to see what other implementors think?
Comment 6 Kearwood "Kip" Gilbert 2014-10-01 18:36:20 UTC
(In reply to Simon Pieters from comment #5)
> Interesting. I see that OpenOffice indeed has instant snapping for user
> scrolling. Can you bring this up on www-style to see what other implementors
> think?

Thanks, Simon.

I have started a thread on www-style:

http://lists.w3.org/Archives/Public/www-style/2014Oct/0014.html
Comment 7 Simon Pieters 2014-10-15 10:02:41 UTC
Renamed instant to auto, but did not add instant, per mailing list discussion. Can reconsider if there is wider implementor interest for instant.

https://dvcs.w3.org/hg/csswg/rev/85b9c2621f48