Bug 147215 - Coordinates-based snap offsets don't update correctly when container is scrolled
Summary: Coordinates-based snap offsets don't update correctly when container is scrolled
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2015-07-22 18:37 PDT by Wenson Hsieh
Modified: 2015-07-28 20:59 PDT (History)
7 users (show)

See Also:


Attachments
Patch (5.55 KB, patch)
2015-07-22 18:56 PDT, Wenson Hsieh
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>