<?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>241737</bug_id>
          
          <creation_ts>2022-06-17 18:26:40 -0700</creation_ts>
          <short_desc>Small programmatic scrolls with scroll snap don&apos;t scroll in WebKit</short_desc>
          <delta_ts>2026-01-12 09:02: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 15</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=270064</see_also>
    
    <see_also>https://bugs.webkit.org/show_bug.cgi?id=293227</see_also>
          <bug_file_loc>https://www.eightyone.co.nz/projects/safe-night-a-thon</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="Emory Fierlinger">emory.fierlinger</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>dino</cc>
    
    <cc>graouts</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1876578</commentid>
    <comment_count>0</comment_count>
    <who name="Emory Fierlinger">emory.fierlinger</who>
    <bug_when>2022-06-17 18:26:40 -0700</bug_when>
    <thetext>I have a dynamic horizontal slider on a website, half way down this page: https://www.eightyone.co.nz/projects/safe-night-a-thon

When a user hovers over the left/right arrows, the browser is supposed to slowly move them along the slider. This works in both Chrome and Firefox, but not Webkit/Safari.

After talking with Apple engineers at WWDC22, they have diagnosed this as a Webkit bug, and have told me to file it as such here. Here is the code:

var amount = &apos;&apos;;

function scroll() {
  $(&apos;#horizontal-scroll-parent&apos;).animate({
    scrollLeft: amount
  }, 25, &apos;linear&apos;, function() {
    if (amount != &apos;&apos;) {
      scroll();
    }
  });
}
$(&apos;#next&apos;).hover(function() {
  amount = &apos;+=25&apos;;
  scroll();
}, function() {
  amount = &apos;&apos;;
});
$(&apos;#back&apos;).hover(function() {
  amount = &apos;-=25&apos;;
  scroll();
}, function() {
  amount = &apos;&apos;;
});</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1876754</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2022-06-20 02:29:07 -0700</bug_when>
    <thetext>&lt;rdar://problem/95524733&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1876755</commentid>
    <comment_count>2</comment_count>
    <who name="Antoine Quint">graouts</who>
    <bug_when>2022-06-20 02:31:15 -0700</bug_when>
    <thetext>What does the scroll function do in your code example? Is it actually performing scrolling by calling something like scrollTo() or changing some CSS properties to affect where things are positioned and simulate scrolling?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1876826</commentid>
    <comment_count>3</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2022-06-20 11:09:39 -0700</bug_when>
    <thetext>I think the page is doing small programmatic scrolls; in WebKit these end up snapping back to the nearest snap point, but in other browsers they are allowed to scroll.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1876827</commentid>
    <comment_count>4</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2022-06-20 11:10:54 -0700</bug_when>
    <thetext>The spec &lt;https://drafts.csswg.org/css-scroll-snap/#overview&gt; says &quot;author can request a particular bias for the scrollport to land on a snap position after scrolling operations (including programmatic scrolls such as the scrollTo() method).&quot; so we should investigate to see if WebKit is correct, or other browsers are correct.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>