W3C home > Mailing lists > Public > whatwg@whatwg.org > June 2015

Re: [whatwg] Proposal: Allow disabling of default scroll restoration behavior

From: Majid Valipour <majidvp@chromium.org>
Date: Mon, 29 Jun 2015 15:14:43 +0000
Message-ID: <CAB8RdXs1n+xmSQEBi8OC9P=mEweZpX8aah68zkR8eizc8NtB9Q@mail.gmail.com>
To: WHATWG <whatwg@whatwg.org>, Anne van Kesteren <annevk@annevk.nl>, Ian Hickson <ian@hixie.ch>
Cc: Olli Pettay <olli@pettay.fi>, Jonas Sicking <jonas@sicking.cc>, Rick Byers <rbyers@chromium.org>
On Wed, May 20, 2015 at 11:00 AM Majid Valipour <majidvp@chromium.org>

> It will be great if we could make progress on getting a consensus on the
> API so that we can actually ship this feature. I think we have narrowed it
> down to two main options:
> 1- Setting scroll options using history.{push, replace}State. This is what
> we have implemented in chrome (see IDLs above).
>      history.replaceState(history.state, '','', {scrollRestoration:
> 'manual'})
> 2- Setting scroll options directly on history object. This is what Jonas
> has proposed. Per our earlier discussions in this thread it should be
> possible to define the semantics such that we get per-entry control.
>     history.options.scrollRestoration = 'manual'
> Both  are equally powerful with #1 being better for complex situations
> where different entries may need to have different scroll restoration
> behaviour  and #2 being better for simpler case where the application wants
> the same scroll restoration for all its entries. As an experiment, I have
> created a small script
> <https://gist.github.com/majido/4cbd0b68d742de319aeb#file-scroll-restoration-global-flag-js>
> that implements #2 on top of #1.
> Jonas prefers #2. I am partial to #1. Spec editors (Anne, Ian, Simon,
> Robin):
> Do you have a preference here?

Anne, Ian, Simon, Robin,

Do you have a preference one way or another for either of the above APIs?

I have a git repo <https://github.com/majido/scroll-restoration-proposal> where
I have spec'd the first option
implemented in Chromium) and am tracking issues against it. Unless there is
a strong preference against #1, I feel it is reasonable to try to ship it.

Received on Monday, 29 June 2015 15:15:30 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 17:00:33 UTC