Bug 147215

Summary: Coordinates-based snap offsets don't update correctly when container is scrolled
Product: WebKit Reporter: Wenson Hsieh <wenson_hsieh>
Component: WebCore Misc.Assignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: bfulgham, cmarcelo, commit-queue, jamesr, luiz, tonikitoo, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

Description Wenson Hsieh 2015-07-22 18:37:09 PDT
If a snap scrolling container with child snap-coordinate elements is scrolled and then snap offsets are recomputed, the snap offset computation will not take the parent scroll offset into account, resulting in incorrectly computed snap offsets. You can reproduce this behavior by following these steps:

  1. Go to whsieh.github.io/examples/grid.html
  2. Scroll somewhere near the lower right corner
  3. Resize the window by any amount
  4. Try scrolling again. Observe that scroll snapping is completely broken
Comment 1 Wenson Hsieh 2015-07-22 18:56:51 PDT
Created attachment 257321 [details]
Patch
Comment 2 Brent Fulgham 2015-07-22 20:19:10 PDT
Comment on attachment 257321 [details]
Patch

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

This looks great! If the tests pass I think this is ready to go!

> LayoutTests/css3/scroll-snap/scroll-snap-coordinate-overflow-resize.html:33
> +            container.style.width = "425px";

Great! We're finally testing resize cases. Nice work!
Comment 3 WebKit Commit Bot 2015-07-22 21:25:32 PDT
Comment on attachment 257321 [details]
Patch

Clearing flags on attachment: 257321

Committed r187210: <http://trac.webkit.org/changeset/187210>
Comment 4 WebKit Commit Bot 2015-07-22 21:25:35 PDT
All reviewed patches have been landed.  Closing bug.
Comment 5 Wenson Hsieh 2015-07-28 20:59:09 PDT
<rdar://problem/22044550>