Bug 171099 - Implement scroll anchoring
Summary: Implement scroll anchoring
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Scrolling (show other bugs)
Version: Safari 10
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on: 109640
Blocks:
  Show dependency treegraph
 
Reported: 2017-04-20 22:08 PDT by Rick Byers
Modified: 2021-08-24 16:29 PDT (History)
9 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rick Byers 2017-04-20 22:08:23 PDT
Scroll anchoring is a feature designed to avoid unintended jumps of the content while (or even after) a page is loading - keeping what the user is looking at in view. It relies on some heuristics to avoid web compat issues, but includes an explicit opt-out API (overflow-anchor CSS property) for sites designed not to need it.  It took quite a bit of iteration to get the web compat right, but it's now been shipping since Chrome 56 without issue, so we're convinced it has stuck. We're seeing about 11% of page views on Android trigger anchoring logic at least once, and about 6% on desktop.

Summary / video: https://blog.chromium.org/2017/04/scroll-anchoring-for-web-developers.html
Explainer: https://github.com/WICG/ScrollAnchoring/blob/master/explainer.md
Draft spec: https://wicg.github.io/ScrollAnchoring
CSSWG discussion: https://github.com/w3c/csswg-drafts/issues/676
Blink implementation: https://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/layout/ScrollAnchor.cpp

Feel free to file issues (https://github.com/WICG/ScrollAnchoring/issues) for any concerns, questions or suggestions.  Let us know if you think you might implement and we'll try to get some web-platform-tests upstreamed (https://github.com/WICG/ScrollAnchoring/issues/3)
Comment 1 Dean Jackson 2017-04-20 22:12:17 PDT
We're interested in implementing this. I'll add it to the WebKit Status page.
Comment 2 Radar WebKit Bug Importer 2017-04-20 22:24:28 PDT
<rdar://problem/31751673>
Comment 3 Steven K 2021-05-19 12:53:42 PDT
Scroll anchoring would really help simplify things. Was hoping to leverage this for a jump-to-specific-spot-on-page-load feature (where the browser default of jumping to element with ID that matches the URL fragment can't be used since the content is asynchronously retrieved). Unfortunately, the lack of current WebKit support for this feature requires I find some way to avoid everything jumping down when content above the scrolled-to spot loads in.

Is there an update on timing/priority for this? I looked in the feature status (https://webkit.org/status/) for this, but didn't see an entry.