When content manually scrolls the view (e.g., 'Element.scrollIntoViewIfNeeded()', 'Window.scrollTo'), we need to make sure that we are actively updating our scroll snap state so that we do not try to snap back to a far off snap point once the programmatic scroll completes.
<rdar://problem/21051035>
<rdar://problem/21051039>
Created attachment 253492 [details] Patch
Comment on attachment 253492 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=253492&action=review > Source/WebCore/platform/ScrollAnimator.cpp:172 > + updateActiveScrollSnapIndexForOffset(); I'm worried this might get hit too frequently, but in my tests it only seems to get called from "notifyPositionChanged" coming from Async scrolling notifications, so I think it's okay.
Comment on attachment 253492 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=253492&action=review > Source/WebCore/platform/cocoa/ScrollController.mm:730 > + (void)closestSnapOffset<LayoutUnit, float>(snapState.m_snapOffsets, clampedOffset, 0, activeIndex); For my own information, why do you need to cast here?
Comment on attachment 253492 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=253492&action=review >> Source/WebCore/platform/cocoa/ScrollController.mm:730 >> + (void)closestSnapOffset<LayoutUnit, float>(snapState.m_snapOffsets, clampedOffset, 0, activeIndex); > > For my own information, why do you need to cast here? 'closestSnapOffset' returns a LayoutUnit, which I don't care about. So instead of assigning it to a temporary, and saying (void)temporary (or UNUSED_ALWAYS(blah)) I just do the cast here to tell the compiler that I don't care about the return value.
Committed r184728: <http://trac.webkit.org/changeset/184728>