<?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>228686</bug_id>
          
          <creation_ts>2021-07-31 20:47:29 -0700</creation_ts>
          <short_desc>scroll-snap-stop: always behaves like scroll-snap-stop: normal when using smooth scrolling</short_desc>
          <delta_ts>2022-05-11 06:06:20 -0700</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 Technology Preview</version>
          <rep_platform>iPhone / iPad</rep_platform>
          <op_sys>iOS 14</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WORKSFORME</resolution>
          
          
          <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="Simon Weaver">simon</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>augus.dupin</cc>
    
    <cc>mrobinson</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1781125</commentid>
    <comment_count>0</comment_count>
    <who name="Simon Weaver">simon</who>
    <bug_when>2021-07-31 20:47:29 -0700</bug_when>
    <thetext>I have a horizontal image carousel with five images and five navigation buttons.
The slides are each 100vw in width and positioned with scroll-snapping.

I am using iOS 15 Beta 4 and I have enabled &apos;CSSOM View Smooth Scrolling&apos; under Experimental WebKit Features.


/* partial css */
#gallery {

    scroll-snap-type: x mandatory;
    
    display: flex;
}

.slide {

    scroll-snap-align: center;
    scroll-snap-stop: normal;

    min-width: 100vw;   
    width: 100vw;
}

The scrolling is triggered programatically when clicking a button using:

document.getElementById(&apos;gallery&apos;).scrollTo({ left: offset, behavior: &apos;smooth&apos; });   // offset is x position of n&apos;th slide


If I click to go from slide 1 &gt; slide 5 then that obviously passes over all the snap stops in between.

Then what happens is Safari abruptly stops on the second slide&apos;s snap point (the first it reaches).
 
The behavior is exactly what I would expect from:
scroll-snap-stop: always 

This is not supposed to happen with scroll-snap-stop: normal 
https://www.w3.org/TR/css-scroll-snap-1/#scroll-snap-stop

Demo pending.

Similar bug:
https://bugs.webkit.org/show_bug.cgi?id=145330
https://bugs.webkit.org/show_bug.cgi?id=223406</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1782915</commentid>
    <comment_count>1</comment_count>
    <who name="Martin Robinson">mrobinson</who>
    <bug_when>2021-08-09 10:26:02 -0700</bug_when>
    <thetext>Hi Simon, thanks for reporting this issue! Do you have a testcase for this bug?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1782916</commentid>
    <comment_count>2</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2021-08-09 10:26:19 -0700</bug_when>
    <thetext>&lt;rdar://problem/81701291&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1867901</commentid>
    <comment_count>3</comment_count>
      <attachid>459108</attachid>
    <who name="Bruno Stasse">augus.dupin</who>
    <bug_when>2022-05-10 04:54:09 -0700</bug_when>
    <thetext>Created attachment 459108
testcase

I don&apos;t know whether there was initially a problem or not, but there is no problem today.

I made a testcase where you can see that there is no problem with smooth scrolling over items with `scroll-snap-stop: normal` or `scroll-snap-stop: always`. It scrolls smoothly to the desired position in both cases, as intended.

This ticket should probably be marked as fixed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1868112</commentid>
    <comment_count>4</comment_count>
    <who name="Martin Robinson">mrobinson</who>
    <bug_when>2022-05-11 06:06:20 -0700</bug_when>
    <thetext>Thanks!</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>459108</attachid>
            <date>2022-05-10 04:54:09 -0700</date>
            <delta_ts>2022-05-10 04:54:09 -0700</delta_ts>
            <desc>testcase</desc>
            <filename>scroll-snap-stop-smooth-scrolling.html</filename>
            <type>text/html</type>
            <size>1560</size>
            <attacher name="Bruno Stasse">augus.dupin</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWw+CjxodG1sIGxhbmc9ImVuIj4KICAgIDxoZWFkPgogICAgICAgIDxtZXRh
IGNoYXJzZXQ9IlVURi04IiAvPgogICAgICAgIDxtZXRhIGh0dHAtZXF1aXY9IlgtVUEtQ29tcGF0
aWJsZSIgY29udGVudD0iSUU9ZWRnZSIgLz4KICAgICAgICA8bWV0YSBuYW1lPSJ2aWV3cG9ydCIg
Y29udGVudD0id2lkdGg9ZGV2aWNlLXdpZHRoLCBpbml0aWFsLXNjYWxlPTEuMCIgLz4KICAgICAg
ICA8dGl0bGU+U2Nyb2xsLXNuYXAtc3RvcCBhbmQgc21vb3RoIHNjcm9sbGluZzwvdGl0bGU+CiAg
ICAgICAgPHN0eWxlPgogICAgICAgICAgICBib2R5IHsKICAgICAgICAgICAgICAgIG1hcmdpbjog
MDsKICAgICAgICAgICAgfQogICAgICAgICAgICBidXR0b24gewogICAgICAgICAgICAgICAgcG9z
aXRpb246IGZpeGVkOwogICAgICAgICAgICB9CiAgICAgICAgICAgICNnYWxsZXJ5IHsKICAgICAg
ICAgICAgICAgIHdpZHRoOiAxMDB2dzsKICAgICAgICAgICAgICAgIGhlaWdodDogMTAwdmg7Cgog
ICAgICAgICAgICAgICAgb3ZlcmZsb3cteDogYXV0bzsKICAgICAgICAgICAgICAgIHNjcm9sbC1z
bmFwLXR5cGU6IHggbWFuZGF0b3J5OwoKICAgICAgICAgICAgICAgIGRpc3BsYXk6IGZsZXg7CiAg
ICAgICAgICAgIH0KICAgICAgICAgICAgLnNsaWRlIHsKICAgICAgICAgICAgICAgIHNjcm9sbC1z
bmFwLWFsaWduOiBjZW50ZXI7CiAgICAgICAgICAgICAgICBzY3JvbGwtc25hcC1zdG9wOiBub3Jt
YWw7CgogICAgICAgICAgICAgICAgbWluLXdpZHRoOiAxMDB2dzsKICAgICAgICAgICAgICAgIHdp
ZHRoOiAxMDB2dzsKCiAgICAgICAgICAgICAgICBiYWNrZ3JvdW5kLWNvbG9yOiBvcmFuZ2U7CiAg
ICAgICAgICAgIH0KICAgICAgICAgICAgLnNsaWRlOm50aC1jaGlsZCgybikgewogICAgICAgICAg
ICAgICAgYmFja2dyb3VuZC1jb2xvcjogZ3JlZW47CiAgICAgICAgICAgIH0KICAgICAgICA8L3N0
eWxlPgogICAgPC9oZWFkPgogICAgPGJvZHk+CiAgICAgICAgPGJ1dHRvbj5TY3JvbGwgdG8gMzwv
YnV0dG9uPgogICAgICAgIDxkaXYgaWQ9ImdhbGxlcnkiPgogICAgICAgICAgICA8ZGl2IGNsYXNz
PSJzbGlkZSI+PC9kaXY+CiAgICAgICAgICAgIDxkaXYgY2xhc3M9InNsaWRlIj48L2Rpdj4KICAg
ICAgICAgICAgPGRpdiBjbGFzcz0ic2xpZGUiPjwvZGl2PgogICAgICAgICAgICA8ZGl2IGNsYXNz
PSJzbGlkZSI+PC9kaXY+CiAgICAgICAgICAgIDxkaXYgY2xhc3M9InNsaWRlIj48L2Rpdj4KICAg
ICAgICA8L2Rpdj4KICAgIDwvYm9keT4KICAgIDxzY3JpcHQ+CiAgICAgICAgY29uc3QgYnV0dG9u
ID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvcigiYnV0dG9uIik7CgogICAgICAgIGJ1dHRvbi5hZGRF
dmVudExpc3RlbmVyKCJjbGljayIsICgpID0+IHsKICAgICAgICAgICAgZ2FsbGVyeS5zY3JvbGxU
byh7CiAgICAgICAgICAgICAgICBsZWZ0OiB3aW5kb3cuaW5uZXJXaWR0aCAqIDIsCiAgICAgICAg
ICAgICAgICBiZWhhdmlvcjogInNtb290aCIsCiAgICAgICAgICAgIH0pOwogICAgICAgIH0pOwog
ICAgPC9zY3JpcHQ+CjwvaHRtbD4K
</data>

          </attachment>
      

    </bug>

</bugzilla>