<?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>272079</bug_id>
          
          <creation_ts>2024-04-03 02:47:30 -0700</creation_ts>
          <short_desc>[css-scroll-snap] Fragment links does not work with scroll-snap on root</short_desc>
          <delta_ts>2025-12-05 04:44:52 -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 17</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>iOS 17</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=255592</see_also>
    
    <see_also>https://bugs.webkit.org/show_bug.cgi?id=245722</see_also>
    
    <see_also>https://bugs.webkit.org/show_bug.cgi?id=251003</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>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Johannes Odland">johannes.odland</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ahmad.saleem792</cc>
    
    <cc>johannes.odland</cc>
    
    <cc>nmouchtaris</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2025642</commentid>
    <comment_count>0</comment_count>
    <who name="Johannes Odland">johannes.odland</who>
    <bug_when>2024-04-03 02:47:30 -0700</bug_when>
    <thetext>Anchor links on a page with scroll-snap on the root/html element fails. 


Steps to reproduce: 
1. Open https://johannesodland.github.io/browserbugs/2024/safari-scroll-snap-fragment-links-issue.html
2. Click on one of the anchor links 

Expected result: 
The linked fragment/section is scrolled into view.

Actual result: 
The browser sometimes scrolls down to the relevant fragment, but snaps back to the top.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2025733</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2024-04-03 10:06:36 -0700</bug_when>
    <thetext>&lt;rdar://problem/125854281&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2025949</commentid>
    <comment_count>2</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2024-04-04 04:59:05 -0700</bug_when>
    <thetext>I am unable to reproduce on first load, although it is bit more involved in my case, where I have to navigate away from tab opened and then refresh tab few times to reproduce this reliably.

@Johannes - is this used to work in earlier iOS versions by any chance you know and also if you have reliable reproduction steps, it would be good to add. :-)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2025951</commentid>
    <comment_count>3</comment_count>
    <who name="Johannes Odland">johannes.odland</who>
    <bug_when>2024-04-04 05:16:28 -0700</bug_when>
    <thetext>Thanks for testing Ahmad.

Navigating to one fragment, and then to another seems to consistently reproduce the bug for me:

1. go to section 4 ( https://johannesodland.github.io/browserbugs/2024/safari-scroll-snap-fragment-links-issue.html#section-4 )
2. Scroll to top
3. Click one of the anchor links</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2076160</commentid>
    <comment_count>4</comment_count>
    <who name="Johannes Odland">johannes.odland</who>
    <bug_when>2024-11-19 10:02:44 -0800</bug_when>
    <thetext>Retested on iOS 18.1, still failing.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2122941</commentid>
    <comment_count>5</comment_count>
    <who name="Johannes Odland">johannes.odland</who>
    <bug_when>2025-06-10 22:54:24 -0700</bug_when>
    <thetext>Retested on iOS 26 beta, still failing.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2163565</commentid>
    <comment_count>6</comment_count>
    <who name="Johannes Odland">johannes.odland</who>
    <bug_when>2025-12-05 04:44:52 -0800</bug_when>
    <thetext>Retested on iOS 26.2. 
The issue seems partially solved. 
Fragment links now works, even after scrolling. 

It fails when clicking multiple fragment links after each other. 

1. Click on &quot;Section 1&quot; – The browser scrolls to section 1
2. Scroll back to the top
3. Click on &quot;Section 2&quot; – The browser scrolls to section 2, but then immediately snaps back to the top of the page.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>