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

On Tue, Mar 19, 2013 at 11:07 AM, Boris Zbarsky <bzbarsky@mit.edu> wrote:
> 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?

Is this accessible directly in any way from author code in Gecko?  Or
is it just a mode for handling the "author requests smooth scrolling,
but user doesn't want it" case?

> 2)  I believe it's it's important to keep the user override that turns
>     SMOOTH into NORMAL if the user so chooses.

Sounds very reasonable.

> 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.

Cool.

~TJ

Received on Tuesday, 19 March 2013 18:15:17 UTC