WICG / interventions

A place for browsers and web developers to collaborate on user agent interventions.
Other
176 stars 28 forks source link

Scroll anchoring on layout #2

Closed rschoen closed 2 years ago

rschoen commented 8 years ago

I've frequently heard users complain that they'll be reading the main content of a page (such as a news article) and an image or other content will finish loading above their current scroll position. In the current behavior, this pushes the content down, jarring the UX. The users I've heard from report this as a major annoyance.

Instead, perhaps we should take a reasonable guess at what is the "main" content of the page, and anchor the scroll position to that. Then when the page shifts, the main content stays in the same position in the viewport.

dbaron commented 8 years ago

I've wanted to do something like this in Gecko for years; see https://bugzilla.mozilla.org/show_bug.cgi?id=43114 . I was motivated by some other use cases as well, such as better position preservation when resizing a window (especially in a document like a specification, and especially when the current scroll position is an anchor). I never quite had the time to finish it...

KenjiBaheux commented 8 years ago

We have a working prototype of Scroll Anchoring in the latest Dev/Canary channel.

We would love feedback on the following:

Field reports to https://goo.gl/HGPXz9

Developer insights (as comments to this issue):

@dbaron we would love to hear your thoughts or what you've learned from trying in the past. cc/ @ojanvafai @rschoen

Known caveats (master crbug):

Overall, we expect lots of iterations before we are happy with it.

skobes-chromium commented 8 years ago

I have added an informal explainer doc for scroll anchoring at https://github.com/WICG/interventions/blob/master/scroll-anchoring/explainer.md.

It includes a description of the algorithm and an opt out mechanism via a CSS "overflow-anchor" property.

Feedback is welcome. :)

toddreifsteck commented 8 years ago

Adding Matt Rakow to issue to make him aware @ChumpChief

skobes-chromium commented 8 years ago

I've updated the explainer doc for scroll anchoring to include the latest changes that have been made to Chrome's implementation: https://github.com/WICG/interventions/blob/master/scroll-anchoring/explainer.md

I'd love to get feedback from the WICG particularly on any of the first four items under "Open Issues":

skobes-chromium commented 7 years ago

FYI: the scroll anchoring docs have been moved out of the interventions repo and into: https://github.com/skobes/ScrollAnchoring

There is a proposal to transfer the ScrollAnchoring repo to WICG at: https://discourse.wicg.io/t/proposal-scroll-anchoring/1752

Please file any new scroll anchoring issues at: https://github.com/skobes/ScrollAnchoring/issues

RByers commented 7 years ago

First shipped in Chrome 56

johannhof commented 2 years ago

(As noted in #72, we intend to archive this repository and are thus triaging and resolving all open issues)

This seems to be resolved cleanly with a spec at https://drafts.csswg.org/css-scroll-anchoring/ and implementations in Chrome and Firefox. Closing the issue.