<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>171099</bug_id>
          
          <creation_ts>2017-04-20 22:08:23 -0700</creation_ts>
          <short_desc>Implement scroll anchoring</short_desc>
          <delta_ts>2026-03-05 13:41:36 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Scrolling</component>
          <version>Safari 10</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>307734</dup_id>
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=259269</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>243309</dependson>
    
    <dependson>243482</dependson>
    
    <dependson>243702</dependson>
    
    <dependson>261628</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Rick Byers">rbyers</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>alex</cc>
    
    <cc>augus.dupin</cc>
    
    <cc>benniercruz</cc>
    
    <cc>cdumez</cc>
    
    <cc>cory</cc>
    
    <cc>curlyhairiscrucial</cc>
    
    <cc>dino</cc>
    
    <cc>emmbacklinks</cc>
    
    <cc>esprehn</cc>
    
    <cc>fabienbrooke</cc>
    
    <cc>hartman.wiki</cc>
    
    <cc>kngan</cc>
    
    <cc>lwdthe1</cc>
    
    <cc>matt</cc>
    
    <cc>mustafa.0x</cc>
    
    <cc>nmouchtaris</cc>
    
    <cc>ntim</cc>
    
    <cc>rbuis</cc>
    
    <cc>ryan</cc>
    
    <cc>santiago.velez</cc>
    
    <cc>seanmacisaac</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>the.bull</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>woodlxf00</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1299500</commentid>
    <comment_count>0</comment_count>
    <who name="Rick Byers">rbyers</who>
    <bug_when>2017-04-20 22:08:23 -0700</bug_when>
    <thetext>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&apos;s now been shipping since Chrome 56 without issue, so we&apos;re convinced it has stuck. We&apos;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&apos;ll try to get some web-platform-tests upstreamed (https://github.com/WICG/ScrollAnchoring/issues/3)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1299501</commentid>
    <comment_count>1</comment_count>
    <who name="Dean Jackson">dino</who>
    <bug_when>2017-04-20 22:12:17 -0700</bug_when>
    <thetext>We&apos;re interested in implementing this. I&apos;ll add it to the WebKit Status page.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1299505</commentid>
    <comment_count>2</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2017-04-20 22:24:28 -0700</bug_when>
    <thetext>&lt;rdar://problem/31751673&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1761662</commentid>
    <comment_count>3</comment_count>
    <who name="Steven K">curlyhairiscrucial</who>
    <bug_when>2021-05-19 12:53:42 -0700</bug_when>
    <thetext>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&apos;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&apos;t see an entry.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1908073</commentid>
    <comment_count>4</comment_count>
    <who name="">mustafa.0x</who>
    <bug_when>2022-10-25 06:55:44 -0700</bug_when>
    <thetext>This is an important feature for many apps, especially chat apps.

Web developers often complain that that Safari lacks this feature. Eg https://www.bennadel.com/blog/3724-maintaining-scroll-offsets-when-adding-content-above-the-users-viewport-in-angular-9-0-0-rc-2.htm</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1925396</commentid>
    <comment_count>5</comment_count>
    <who name="Rob Buis">rbuis</who>
    <bug_when>2023-01-13 11:10:33 -0800</bug_when>
    <thetext>*** Bug 250578 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1935454</commentid>
    <comment_count>6</comment_count>
    <who name="Derk-Jan Hartman">hartman.wiki</who>
    <bug_when>2023-02-21 02:17:58 -0800</bug_when>
    <thetext>This is a significant problem on Wikipedia right now, where the browsers are picking an incorrect place to anchor when you initially navigate to a page anchor quite often in their newer skin (which has its navigation elements before the content where most anchors are). See also: https://phabricator.wikimedia.org/T330108#8631197


On most browsers this will be mitigated with overflow-anchor:none being applied to the menu elements that we don&apos;t want the browser to anchor to, but unfortunately it is not supported in Webkit see https://caniuse.com/?search=overflow-anchor and https://bugs.webkit.org/show_bug.cgi?id=109640</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1950070</commentid>
    <comment_count>7</comment_count>
    <who name="Matt Reimer">matt</who>
    <bug_when>2023-04-20 08:29:38 -0700</bug_when>
    <thetext>WebKit CSS Feature Status says overflow-anchor is supported, but e.g. this demo seems to indicate it doesn&apos;t work: https://css-tricks.com/almanac/properties/o/overflow-anchor/#aa-demo

Is overflow-anchor expected to work? Should I test differently?

Thanks for your work on this important feature.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1950079</commentid>
    <comment_count>8</comment_count>
    <who name="Tim Nguyen (:ntim)">ntim</who>
    <bug_when>2023-04-20 08:39:59 -0700</bug_when>
    <thetext>(In reply to Matt Reimer from comment #7)
&gt; WebKit CSS Feature Status says overflow-anchor is supported

That is misleading, it is currently not implemented, we should probably update this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1998862</commentid>
    <comment_count>9</comment_count>
    <who name="Tim Nguyen (:ntim)">ntim</who>
    <bug_when>2023-12-11 19:05:07 -0800</bug_when>
    <thetext>*** Bug 109640 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2011443</commentid>
    <comment_count>11</comment_count>
    <who name="lwdthe1">lwdthe1</who>
    <bug_when>2024-02-07 10:25:23 -0800</bug_when>
    <thetext>Please fix this bug. Scroll Anchoring is crucial in the modern web with chat experiences, which require reverse infinite scrolling.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2011464</commentid>
    <comment_count>12</comment_count>
    <who name="Matt Reimer">matt</who>
    <bug_when>2024-02-07 11:09:52 -0800</bug_when>
    <thetext>(In reply to lwdthe1 from comment #11)
&gt; Please fix this bug. Scroll Anchoring is crucial in the modern web with chat
&gt; experiences, which require reverse infinite scrolling.

Try the current Tech Preview. It seems to be working pretty well, at least for my use cases.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2081852</commentid>
    <comment_count>15</comment_count>
    <who name="">mustafa.0x</who>
    <bug_when>2024-12-14 20:35:57 -0800</bug_when>
    <thetext>Has the implementation been finalized? I use it in a somewhat popular web app, and safari tp&apos;s behavior differs from chrome.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2165498</commentid>
    <comment_count>16</comment_count>
    <who name="">santiago.velez</who>
    <bug_when>2025-12-12 12:27:43 -0800</bug_when>
    <thetext>Hello, any updates on this feature? is it in active development?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2187493</commentid>
    <comment_count>17</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2026-03-05 13:41:36 -0800</bug_when>
    <thetext>

*** This bug has been marked as a duplicate of bug 307734 ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>