W3C home > Mailing lists > Public > www-style@w3.org > March 2013

Re: [cssom-view] Add a "smooth" parameter to scrollTo and scrollBy functions

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Tue, 19 Mar 2013 14:07:27 -0400
Message-ID: <5148A95F.3040805@mit.edu>
To: www-style@w3.org
On 3/19/13 1:46 PM, Tab Atkins Jr. wrote:
> Thus, I propose that we amend the existing scrollTo and scrollBy
> functions in CSSOM View to take a third parameter: an optional
> "smooth" string.  If omitted, the scroll is instant.

So Gecko internally has:

   enum ScrollMode { INSTANT, SMOOTH, NORMAL };

INSTANT is what scrollTo and scrollBy do.  NORMAL is done as one scroll, 
but possibly async.  SMOOTH will do smooth scrolling if the user has 
that enabled, and behave like NORMAL otherwise.

There's also a comment:

     * If an INSTANT request happens while a smooth or async scroll is 
already in
     * progress, the async scroll is interrupted and we instantly scroll 
to the
     * destination.

So clearly supporting "smooth" as described (at the level of detail 
described) would not be too hard.  The questions I have are:

1)  Do we want an equivalent to NORMAL?
2)  I believe it's it's important to keep the user override that turns
     SMOOTH into NORMAL if the user so chooses.
3)  The behavior of scrolls while another scroll is pending would
     obviously need to be defined.

Probably lots of other details to sort out, but in general this is a 
good idea.

Received on Tuesday, 19 March 2013 18:08:00 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:50:40 UTC