In Bug 145216, I corrected a problem where programmatic scrolls did not update the scroll snap state. Unfortunately, I did not recognize that these changes were not sufficient to correct the problem in iOS, because many of the ScrollAnimator methods used on Mac are stubbed out on iOS. This needs to be corrected so that the iOS ScrollAnimator knows about the current scroll snap offset index, so that its default '0' value doesn't keep getting retrieved by WebCore code and resetting the offset. It may be that iOS should keep around a ScrollController object so that we can share the axis offset handling code between the two ports.
This bug manifests as a scroll area (with snap points), where calling 'scrollIntoViewIfNeeded" causes the right scroll snap region to move into view, only to flash back to the zeroth scroll element.
<rdar://problem/21081501>
Created attachment 255161 [details] WIP Patch
Created attachment 255172 [details] Patch
Comment on attachment 255172 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=255172&action=review > Source/WebCore/page/scrolling/ScrollingStateScrollingNode.h:54 > + HorizontalSnapOffsetIndex, > + VerticalSnapOffsetIndex, Maybe these should have "Current" in the name. > Source/WebCore/page/scrolling/ScrollingStateScrollingNode.h:115 > + unsigned m_currentHorizontalSnapPointIndex { 0 }; > + unsigned m_currentVerticalSnapPointIndex { 0 }; Do we need to distinguish between "not set" and 0? > Source/WebCore/platform/cocoa/ScrollController.mm:134 > , m_lastMomentumScrollTimestamp(0) > +#if ENABLE(RUBBER_BANDING) > , m_startTime(0) Could use C++11 initialization to avoid these.
Comment on attachment 255172 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=255172&action=review >> Source/WebCore/page/scrolling/ScrollingStateScrollingNode.h:54 >> + VerticalSnapOffsetIndex, > > Maybe these should have "Current" in the name. I like that better. I'll change to that. >> Source/WebCore/page/scrolling/ScrollingStateScrollingNode.h:115 >> + unsigned m_currentVerticalSnapPointIndex { 0 }; > > Do we need to distinguish between "not set" and 0? No. "non set" is indicated by empty snap offset vectors. >> Source/WebCore/platform/cocoa/ScrollController.mm:134 >> , m_startTime(0) > > Could use C++11 initialization to avoid these. Good idea.
Committed r185762: <http://trac.webkit.org/changeset/185762>