Contact emails
maj...@chromium.org, rby...@chromium.org
Spec
Add a new attribute to the history object allowing web developers to explicitly disable user agents default scroll restoration behavior on history navigation. This document describes background and motivation for this change, and WhatWG and WICG discussion threads provide additional context for the API design.
Link to “Intent to Implement” blink-dev discussion
https://groups.google.com/a/chromium.org/d/msg/blink-dev/U1e2lmGs4tM/9_70ojL8TiIJ
Note that we are planing to ship a slightly different API than the one proposed in the original intent-to-implement. We have settled on the current API based on WhatWG feedback.
Is this feature supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?
Yes.
Debuggability
The publicly exposed attribute may be inspected in DevTools similar to other web-exposed APIs. No special debug support is planned.
Compatibility Risk
The surface area of the change is small and we have consulted with relevant standard groups and vendors to ensure there is agreement around the issue and proposed solution. The API is publicly supported by Mozilla but until it becomes adopted by the HTML spec there is some amount of interoperability risks.
Web developers: Positive (on addressing the issue: 1 2 3 4)
Firefox: Positive
Internet Explorer: No public signals
Safari: No public signals
OWP launch tracking bug
https://code.google.com/p/chromium/issues/detail?id=477353
Entry on the feature dashboard
I'll avoid the conflict of interest and abstain from officially approving this :-). But I want to weigh in unofficially with my support anyway.Majid has been actively driving open discussion on this minor API change for quite some time, and it appears to have converged to consensus. I'd prefer we had an official spec change before shipping this, but I believe it's not worth the cost to delay shipping past M46. There's a clear, long-standing and urgent need from web developers here, a relatively straight forward / small solution, and apparent consensus with Mozilla at least on the design / spec change necessary. I'm confident that the compat risk is relatively low and that we'll get the HTML spec updated eventually to incorporate this new API. Shipping is the right next step IMHO.
Thanks,Rick
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
A better example is to perhaps set the scrollRestoration in an inline script in <head/>
Why would the timing matter? It's not "should I restore scroll position right now?". If it were that, we would need to set it very early, yeah. But my read is that this is "should I *save* the scroll position into the history entry?". (Certainly that would be the simpler way to do this.) This makes the timing much more relaxed.
Earlier is, I suppose, better, but if you happen to navigate away while a page is doing its first few layouts and still setting itself up, there wouldn't really be any scroll position to restore if you were to try to navigate back.
If there were, it wouldn't be any different than if the user tried to scroll before you installed an onscroll handler or whatever. Really the right time to set this field is right when you create whatever widgets in your page require custom scroll handling.
That is, think history.replaceState, not window.onpopstate.
On Wed, Aug 5, 2015 at 3:25 PM PhistucK <phis...@gmail.com> wrote:
Yes, barring an HTML attribute or some similar mechanism. This is pretty bad.