<?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>183157</bug_id>
          
          <creation_ts>2018-02-26 20:26:41 -0800</creation_ts>
          <short_desc>[scroll-snap] scrolling against edge of iframe results in incorrect behavior</short_desc>
          <delta_ts>2021-07-07 08:28:49 -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>Layout and Rendering</component>
          <version>Safari Technology Preview</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>macOS 10.12</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="jonjohnjohnson">hi</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>bfulgham</cc>
    
    <cc>mrobinson</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>wenson_hsieh</cc>
    
    <cc>zalan</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1402262</commentid>
    <comment_count>0</comment_count>
    <who name="jonjohnjohnson">hi</who>
    <bug_when>2018-02-26 20:26:41 -0800</bug_when>
    <thetext>Could also be related to this bug on ios -&gt; https://bugs.webkit.org/show_bug.cgi?id=135997
Here&apos;s a video showcasing the behavior described that issue -&gt; http://cl.ly/pmvP

But for this issue...

On both safari 11 and technology preview 50, at least when document is within an iframe, starting a scroll in the direction towards the edge that is already been reached makes the scroll fly all the way to the opposite edge when just trying to go to next snap position.

Steps to reproduce:
1. Go to this url -&gt; http://jsbin.com/subojom/8/edit?html,css,js,output
2. Scroll further up the output panel and without releasing (flinging) change your scroll direction (even a slight amount)
3. Notice the container scroll scroll (all too quickly) to the other end of itself.
4. Behaves like this when performed from the bottom edge as well.

Here&apos;s a video showcasing this issue -&gt; http://cl.ly/pnD0</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1402263</commentid>
    <comment_count>1</comment_count>
    <who name="Wenson Hsieh">wenson_hsieh</who>
    <bug_when>2018-02-26 20:35:50 -0800</bug_when>
    <thetext>The iOS bug is a result of UIScrollView behavior, and isn&apos;t related to what you&apos;re seeing here.

On STP 50 running against macOS 10.13.4, I can reproduce this if I scroll downwards with any momentum while rubber-banding against the top edge of the scroll container. However, if I just let go without any momentum (i.e. without flinging) the scroll position rests at the top as expected.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1402264</commentid>
    <comment_count>2</comment_count>
    <who name="Wenson Hsieh">wenson_hsieh</who>
    <bug_when>2018-02-26 20:44:29 -0800</bug_when>
    <thetext>Can you reproduce the bug with the same steps in main frame scrolling, and/or overflow scrolling? (e.g. https://whsieh.github.io/examples/scroll-snap-mainframe and https://whsieh.github.io/examples/scroll-snap-overflow, respectively).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1402267</commentid>
    <comment_count>3</comment_count>
    <who name="jonjohnjohnson">hi</who>
    <bug_when>2018-02-26 21:06:21 -0800</bug_when>
    <thetext>I could not reproduce the bug with the same steps in either...

- https://whsieh.github.io/examples/scroll-snap-mainframe
- https://whsieh.github.io/examples/scroll-snap-overflow

Which led me to put both of those test case requests inside an iframe, and alas a wild bug appeared.

For the mainframe example, it completely disabled scroll-snapping.
For the overflow example, it reproduced the original described issue of this post.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1402268</commentid>
    <comment_count>4</comment_count>
    <who name="Wenson Hsieh">wenson_hsieh</who>
    <bug_when>2018-02-26 21:08:12 -0800</bug_when>
    <thetext>Got it — thanks for the information!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1402271</commentid>
    <comment_count>5</comment_count>
    <who name="jonjohnjohnson">hi</who>
    <bug_when>2018-02-26 21:14:10 -0800</bug_when>
    <thetext>Should I file another bug for the not snapping at all issue shown when the mainframe example is within an iframe?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1402273</commentid>
    <comment_count>6</comment_count>
    <who name="Wenson Hsieh">wenson_hsieh</who>
    <bug_when>2018-02-26 21:15:53 -0800</bug_when>
    <thetext>(In reply to jonjohnjohnson from comment #5)
&gt; Should I file another bug for the not snapping at all issue shown when the
&gt; mainframe example is within an iframe?

Sure — though, I suspect these behaviors may have the same or similar root cause. If that is the case, we can dupe the other bug back to this one.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1775273</commentid>
    <comment_count>7</comment_count>
    <who name="Martin Robinson">mrobinson</who>
    <bug_when>2021-07-07 08:28:49 -0700</bug_when>
    <thetext>I can&apos;t seem to reproduce this bug any longer in the iOS simulator nor in Safari.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>