Summary: | [iOS] scrollIntoViewIfNeeded is not working with scroll-snap points | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Brent Fulgham <bfulgham> | ||||||
Component: | Layout and Rendering | Assignee: | Brent Fulgham <bfulgham> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | bdakin, bfulgham, cmarcelo, commit-queue, esprehn+autocc, glenn, jamesr, kondapallykalyan, luiz, simon.fraser, 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=145216 | ||||||||
Bug Depends on: | |||||||||
Bug Blocks: | 172349 | ||||||||
Attachments: |
|
Description
Brent Fulgham
2015-05-22 14:00:14 PDT
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. 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> |