<?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>145148</bug_id>
          
          <creation_ts>2015-05-18 15:55:53 -0700</creation_ts>
          <short_desc>Scroll-snap animations should not start on axes with zero-delta</short_desc>
          <delta_ts>2015-05-19 14:27:39 -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>528+ (Nightly build)</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>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Brent Fulgham">bfulgham</reporter>
          <assigned_to name="Brent Fulgham">bfulgham</assigned_to>
          <cc>bfulgham</cc>
    
    <cc>commit-queue</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1095716</commentid>
    <comment_count>0</comment_count>
    <who name="Brent Fulgham">bfulgham</who>
    <bug_when>2015-05-18 15:55:53 -0700</bug_when>
    <thetext>I noticed a bug in two-dimensional scroll snap regions as follows:

1. Begin a vertical scroll-snap gesture.
2. Scroll region being a vertical scroll animation.
3. Interrupt the vertical scroll with a horizontal gesture.
4. A horizontal scroll will begin.
5. Suddenly, the horizontal scroll will end and a vertical scroll will start.
6. The remainder of the original vertical scroll completes.

This is happening because of a flaw in the gesture handling code.

a. Vertical gestures are tracked, and a vertical target is selected.
b. Horizontal gesture interrupts animation, clearing the wheel tracking state.
c. Horizontal gesture is tracked, causing non-zero X delta values to be tracked, as well as an equivalent set of zero Y delta values.
d. When the horizontal gesture enters the inertial scrolling phase, WebKit activates the scroll snap logic.
e. WebKit first checks for vertical scrolling. It sees that it has a valid count of wheel events, and triggers the start of a vertical scroll snap animation.
f. The vertical scroll animation begins overriding wheel events.
g. Later, WebKit checks for horizontal scrolling. However, it sees that wheel events are being overridden, and stops.
h. Consequently, the horizontal snap is &quot;converted&quot; to a vertical snap.

The fix is to block starting the scroll snap animation on an axis if the user gesture involved zero delta in the direction of the axis.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1095717</commentid>
    <comment_count>1</comment_count>
      <attachid>253349</attachid>
    <who name="Brent Fulgham">bfulgham</who>
    <bug_when>2015-05-18 15:58:29 -0700</bug_when>
    <thetext>Created attachment 253349
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1095718</commentid>
    <comment_count>2</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2015-05-18 16:00:29 -0700</bug_when>
    <thetext>Attachment 253349 did not pass style-queue:


ERROR: Source/WebCore/ChangeLog:8:  You should remove the &apos;No new tests&apos; and either add and list tests, or explain why no new tests were possible.  [changelog/nonewtests] [5]
Total errors found: 1 in 2 files


If any of these errors are false positives, please file a bug against check-webkit-style.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1095735</commentid>
    <comment_count>3</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2015-05-18 16:33:33 -0700</bug_when>
    <thetext>&lt;rdar://problem/21009187&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1095736</commentid>
    <comment_count>4</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2015-05-18 16:33:35 -0700</bug_when>
    <thetext>&lt;rdar://problem/21009192&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1095993</commentid>
    <comment_count>5</comment_count>
    <who name="Brent Fulgham">bfulgham</who>
    <bug_when>2015-05-19 12:40:14 -0700</bug_when>
    <thetext>I don&apos;t have a good non-flaky automatic test for this. It&apos;s pretty easy to test manually.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1096013</commentid>
    <comment_count>6</comment_count>
      <attachid>253349</attachid>
    <who name="Dean Jackson">dino</who>
    <bug_when>2015-05-19 13:14:25 -0700</bug_when>
    <thetext>Comment on attachment 253349
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=253349&amp;action=review

&gt; Source/WebCore/ChangeLog:8
&gt; +        No new tests (OOPS!).

Oops.

&gt; Source/WebCore/ChangeLog:14
&gt; +        * platform/cocoa/ScrollController.mm:
&gt; +        (WebCore::ScrollController::processWheelEventForScrollSnapOnAxis): Don&apos;t begin a scroll sn

This sentence does not e</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1096035</commentid>
    <comment_count>7</comment_count>
      <attachid>253349</attachid>
    <who name="Brent Fulgham">bfulgham</who>
    <bug_when>2015-05-19 14:05:09 -0700</bug_when>
    <thetext>Comment on attachment 253349
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=253349&amp;action=review

&gt;&gt; Source/WebCore/ChangeLog:8
&gt;&gt; +        No new tests (OOPS!).
&gt; 
&gt; Oops.

Oops!

&gt;&gt; Source/WebCore/ChangeLog:14
&gt;&gt; +        (WebCore::ScrollController::processWheelEventForScrollSnapOnAxis): Don&apos;t begin a scroll sn
&gt; 
&gt; This sentence does not e

Oops!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1096048</commentid>
    <comment_count>8</comment_count>
    <who name="Brent Fulgham">bfulgham</who>
    <bug_when>2015-05-19 14:27:39 -0700</bug_when>
    <thetext>Committed r184589: &lt;http://trac.webkit.org/changeset/184589&gt;</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>253349</attachid>
            <date>2015-05-18 15:58:29 -0700</date>
            <delta_ts>2015-05-19 13:14:25 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-145148-20150518155827.patch</filename>
            <type>text/plain</type>
            <size>1674</size>
            <attacher name="Brent Fulgham">bfulgham</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9XZWJDb3JlL0NoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBTb3VyY2UvV2Vi
Q29yZS9DaGFuZ2VMb2cJKHJldmlzaW9uIDE4NDUxNykKKysrIFNvdXJjZS9XZWJDb3JlL0NoYW5n
ZUxvZwkod29ya2luZyBjb3B5KQpAQCAtMSwzICsxLDE4IEBACisyMDE1LTA1LTE4ICBCcmVudCBG
dWxnaGFtICA8YmZ1bGdoYW1AYXBwbGUuY29tPgorCisgICAgICAgIFNjcm9sbC1zbmFwIGFuaW1h
dGlvbnMgc2hvdWxkIG5vdCBzdGFydCBvbiBheGVzIHdpdGggemVyby1kZWx0YQorICAgICAgICBo
dHRwczovL2J1Z3Mud2Via2l0Lm9yZy9zaG93X2J1Zy5jZ2k/aWQ9MTQ1MTQ4CisKKyAgICAgICAg
UmV2aWV3ZWQgYnkgTk9CT0RZIChPT1BTISkuCisKKyAgICAgICAgTm8gbmV3IHRlc3RzIChPT1BT
ISkuCisKKyAgICAgICAgRG9uJ3QgYmVnaW4gYSBzY3JvbGwgc25hcCBhbmltYXRpb24gb24gYW4g
YXhpcyB0aGF0IGhhZCBubyBjaGFuZ2UgaW4gcG9zaXRpb24gKG9uIHRoYXQgYXhpcykKKyAgICAg
ICAgZHVyaW5nIHRoZSBnZXN0dXJlLgorCisgICAgICAgICogcGxhdGZvcm0vY29jb2EvU2Nyb2xs
Q29udHJvbGxlci5tbToKKyAgICAgICAgKFdlYkNvcmU6OlNjcm9sbENvbnRyb2xsZXI6OnByb2Nl
c3NXaG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ud2hlZWxEZWx0YVdpbmRvd1NpemUpICYmIHNuYXBT
dGF0ZS5hdmVyYWdlSW5pdGlhbFdoZWVsRGVsdGEoKSkKICAgICAgICAgICAgICAgICBiZWdpblNj
cm9sbFNuYXBBbmltYXRpb24oYXhpcywgU2Nyb2xsU25hcFN0YXRlOjpHbGlkaW5nKTsKICAgICAg
ICAgfQogICAgICAgICBicmVhazsK
</data>
<flag name="review"
          id="278243"
          type_id="1"
          status="+"
          setter="dino"
    />
          </attachment>
      

    </bug>

</bugzilla>