<?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>158821</bug_id>
          
          <creation_ts>2016-06-15 17:08:12 -0700</creation_ts>
          <short_desc>Scroll snapping not working for 2 elements</short_desc>
          <delta_ts>2018-04-11 22:50:51 -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 9</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P1</priority>
          <bug_severity>Critical</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Sriram Krishnan">sriramkrish85</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>bfulgham</cc>
    
    <cc>dvoytenko</cc>
    
    <cc>fred.wang</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>sriramkrish85</cc>
    
    <cc>timothy003</cc>
    
    <cc>wenson_hsieh</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1202764</commentid>
    <comment_count>0</comment_count>
    <who name="Sriram Krishnan">sriramkrish85</who>
    <bug_when>2016-06-15 17:08:12 -0700</bug_when>
    <thetext>When i try to use -webkit-scroll-snap-type: mandatory on a container and -webkit-scroll-snap-coordinate: 0 0 on its children, it does not work when there are only 2 elements in the container. 

Here is the URL for my demo  - http://output.jsbin.com/fegace

I found that i could work around this by adding 2 dummy 1px elements on either side of the actual elements and make this sort of work. 
Workaround - http://output.jsbin.com/zitifuy</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1218140</commentid>
    <comment_count>1</comment_count>
    <who name="Sriram Krishnan">sriramkrish85</who>
    <bug_when>2016-08-05 17:37:46 -0700</bug_when>
    <thetext>Hi any updates on when this would be fixed?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1401112</commentid>
    <comment_count>2</comment_count>
      <attachid>334380</attachid>
    <who name="Frédéric Wang Nélar">fred.wang</who>
    <bug_when>2018-02-21 08:26:40 -0800</bug_when>
    <thetext>Created attachment 334380
Testcase

This is a reduced testcase without -webkit prefix and using the new values described in the latest Working Draft (https://drafts.csswg.org/css-scroll-snap/). The snapping works as expected with the iOS simulator (both the latest release and trunk).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1413931</commentid>
    <comment_count>3</comment_count>
    <who name="Frédéric Wang Nélar">fred.wang</who>
    <bug_when>2018-04-11 22:50:51 -0700</bug_when>
    <thetext>According to AMP developers, this bug is fixed in iOS 11.3</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>334380</attachid>
            <date>2018-02-21 08:26:40 -0800</date>
            <delta_ts>2018-02-21 08:26:40 -0800</delta_ts>
            <desc>Testcase</desc>
            <filename>scroll-snapping.html</filename>
            <type>text/html</type>
            <size>907</size>
            <attacher name="Frédéric Wang Nélar">fred.wang</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWw+CjxodG1sPgogIDxoZWFkPgogICAgPHRpdGxlPlNjcm9sbCBTbmFwcGlu
ZzwvdGl0bGU+CiAgICA8bWV0YSBuYW1lPSJ2aWV3cG9ydCIgY29udGVudD0id2lkdGg9ZGV2aWNl
LXdpZHRoIj4KICAgIDxtZXRhIGNoYXJzZXQ9InV0Zi04Ii8+CiAgICA8c3R5bGU+CiAgICAgIGRp
diB7CiAgICAgICAgd2lkdGg6IDIwMHB4OwogICAgICAgIGhlaWdodDogMjAwc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