Bug 142705

Summary: [iOS] scroll snap points are animating to the wrong position.
Product: WebKit Reporter: Brent Fulgham <bfulgham>
Component: Layout and RenderingAssignee: Brent Fulgham <bfulgham>
Status: RESOLVED FIXED    
Severity: Critical CC: benjamin, bfulgham, buildbot, cmarcelo, commit-queue, dino, jamesr, luiz, rniwa, simon.fraser, thorton, tonikitoo, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: iPhone / iPad   
OS: All   
See Also: https://bugs.webkit.org/show_bug.cgi?id=142706
Attachments:
Description Flags
Patch
none
Archive of layout-test-results from ews105 for mac-mavericks-wk2
none
Archive of layout-test-results from ews100 for mac-mavericks
none
Patch v2 (Revised to correct test crash) simon.fraser: review+

Brent Fulgham
Reported 2015-03-14 20:31:36 PDT
Mainframe scroll snap animation on iOS are not landing on the right spots. The amount we are "off" of expected varies with markup.
Attachments
Patch (5.17 KB, patch)
2015-03-14 20:48 PDT, Brent Fulgham
no flags
Archive of layout-test-results from ews105 for mac-mavericks-wk2 (663.52 KB, application/zip)
2015-03-14 21:07 PDT, Build Bot
no flags
Archive of layout-test-results from ews100 for mac-mavericks (631.65 KB, application/zip)
2015-03-14 21:13 PDT, Build Bot
no flags
Patch v2 (Revised to correct test crash) (5.63 KB, patch)
2015-03-14 21:52 PDT, Brent Fulgham
simon.fraser: review+
Brent Fulgham
Comment 1 2015-03-14 20:32:23 PDT
Brent Fulgham
Comment 2 2015-03-14 20:48:22 PDT
Brent Fulgham
Comment 3 2015-03-14 20:53:09 PDT
Scroll snapping was landing in the wrong place on iOS because of two problems: (1) It was searching for the closest snap offset point using unscaled 'screen' pixels, which caused it to always choose one of the earliest snap point options. (2) It was then selecting a scaled snap point coordinate and passing it back to UIKit to animate the snap. This caused it to select a target point beyond the 'screen' pixel we want to hit. The solution to both problems are to scale the scroll destination UIKit suggests so that we search among the scaled points with a valid value. Then, we need to scale the returned value back to screen units before handing it back to UIKit to process.
Build Bot
Comment 4 2015-03-14 21:07:10 PDT
Comment on attachment 248664 [details] Patch Attachment 248664 [details] did not pass mac-wk2-ews (mac-wk2): Output: http://webkit-queues.appspot.com/results/5213893995528192 New failing tests: css3/scroll-snap/scroll-snap-position-values.html css3/scroll-snap/scroll-snap-initial.html
Build Bot
Comment 5 2015-03-14 21:07:17 PDT
Created attachment 248665 [details] Archive of layout-test-results from ews105 for mac-mavericks-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: ews105 Port: mac-mavericks-wk2 Platform: Mac OS X 10.9.5
Brent Fulgham
Comment 6 2015-03-14 21:08:09 PDT
I will correct the test expectations when landing.
Build Bot
Comment 7 2015-03-14 21:13:38 PDT
Comment on attachment 248664 [details] Patch Attachment 248664 [details] did not pass mac-ews (mac): Output: http://webkit-queues.appspot.com/results/6102462599528448 New failing tests: css3/scroll-snap/scroll-snap-position-values.html css3/scroll-snap/scroll-snap-initial.html
Build Bot
Comment 8 2015-03-14 21:13:44 PDT
Created attachment 248666 [details] Archive of layout-test-results from ews100 for mac-mavericks The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: ews100 Port: mac-mavericks Platform: Mac OS X 10.9.5
Brent Fulgham
Comment 9 2015-03-14 21:52:56 PDT
Created attachment 248669 [details] Patch v2 (Revised to correct test crash)
Brent Fulgham
Comment 10 2015-03-14 22:11:49 PDT
Note You need to log in before you can comment on or make changes to this bug.