Changeset 179884 in webkit
- Timestamp:
- Feb 10, 2015, 2:40:00 PM (12 years ago)
- Location:
- branches/safari-600.5-branch
- Files:
-
- 4 edited
- 1 copied
-
ChangeLog (modified) (1 diff)
-
ManualTests/programmatic-scroll-flicker.html (copied) (copied from trunk/ManualTests/programmatic-scroll-flicker.html )
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/page/FrameView.cpp (modified) (3 diffs)
-
Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/safari-600.5-branch/ChangeLog
r179528 r179884 1 2015-02-10 Lucas Forschler <lforschler@apple.com> 2 3 Merge r176899 4 5 2014-12-05 Simon Fraser <simon.fraser@apple.com> 6 7 Programmatic scrolling and content changes are not always synchronized 8 https://bugs.webkit.org/show_bug.cgi?id=139245 9 rdar://problem/18833612 10 11 Reviewed by Anders Carlsson. 12 13 Manual test that tries to sync layout with programmatic scrolling. 14 15 * ManualTests/programmatic-scroll-flicker.html: Added. 16 1 17 2015-01-21 Babak Shafiei <bshafiei@apple.com> 2 18 -
branches/safari-600.5-branch/Source/WebCore/ChangeLog
r179761 r179884 1 2015-02-10 Lucas Forschler <lforschler@apple.com> 2 3 Merge r176899 4 5 2014-12-05 Simon Fraser <simon.fraser@apple.com> 6 7 Programmatic scrolling and content changes are not always synchronized 8 https://bugs.webkit.org/show_bug.cgi?id=139245 9 rdar://problem/18833612 10 11 Reviewed by Anders Carlsson. 12 13 For programmatic scrolls, AsyncScrollingCoordinator::requestScrollPositionUpdate() 14 calls updateScrollPositionAfterAsyncScroll(), then dispatches the requested 15 scroll position to the scrolling thread. 16 17 Once the scrolling thread commits, it calls back to the main thread via 18 scheduleUpdateScrollPositionAfterAsyncScroll(), which schedules a second 19 call to updateScrollPositionAfterAsyncScroll() on a timer. That's a problem, 20 because some other scroll may have happened in the meantime; when the timer 21 fires, it can sometimes restore a stale scroll position. 22 23 Fix by bailing early from scheduleUpdateScrollPositionAfterAsyncScroll() 24 for programmatic scrolls, since we know that requestScrollPositionUpdate() 25 already did the updateScrollPositionAfterAsyncScroll(). 26 27 Test: 28 ManualTests/programmatic-scroll-flicker.html 29 30 * page/FrameView.cpp: 31 (WebCore::FrameView::reset): nullptr. 32 (WebCore::FrameView::setScrollPosition): Ditto. 33 (WebCore::FrameView::setWasScrolledByUser): Ditto. 34 * page/scrolling/AsyncScrollingCoordinator.cpp: 35 (WebCore::AsyncScrollingCoordinator::requestScrollPositionUpdate): Use a local variable for 36 isProgrammaticScroll just to make sure we use the same value for the duration of this function. 37 (WebCore::AsyncScrollingCoordinator::scheduleUpdateScrollPositionAfterAsyncScroll): Do nothing 38 if this is a programmatic scroll. 39 1 40 2015-02-06 Babak Shafiei <bshafiei@apple.com> 2 41 -
branches/safari-600.5-branch/Source/WebCore/page/FrameView.cpp
r179531 r179884 271 271 m_isVisuallyNonEmpty = false; 272 272 m_firstVisuallyNonEmptyLayoutCallbackPending = true; 273 m_maintainScrollPositionAnchor = 0;273 m_maintainScrollPositionAnchor = nullptr; 274 274 } 275 275 … … 2005 2005 { 2006 2006 TemporaryChange<bool> changeInProgrammaticScroll(m_inProgrammaticScroll, true); 2007 m_maintainScrollPositionAnchor = 0;2007 m_maintainScrollPositionAnchor = nullptr; 2008 2008 ScrollView::setScrollPosition(scrollPoint); 2009 2009 } … … 3600 3600 if (m_inProgrammaticScroll) 3601 3601 return; 3602 m_maintainScrollPositionAnchor = 0;3602 m_maintainScrollPositionAnchor = nullptr; 3603 3603 if (m_wasScrolledByUser == wasScrolledByUser) 3604 3604 return; -
branches/safari-600.5-branch/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp
r178505 r179884 154 154 return false; 155 155 156 if (frameView->inProgrammaticScroll() || frameView->frame().document()->inPageCache()) 157 updateScrollPositionAfterAsyncScroll(frameView->scrollLayerID(), scrollPosition, frameView->inProgrammaticScroll(), SetScrollingLayerPosition); 156 bool isProgrammaticScroll = frameView->inProgrammaticScroll(); 157 if (isProgrammaticScroll || frameView->frame().document()->inPageCache()) 158 updateScrollPositionAfterAsyncScroll(frameView->scrollLayerID(), scrollPosition, isProgrammaticScroll, SetScrollingLayerPosition); 158 159 159 160 // If this frame view's document is being put into the page cache, we don't want to update our … … 166 167 return false; 167 168 168 stateNode->setRequestedScrollPosition(scrollPosition, frameView->inProgrammaticScroll());169 stateNode->setRequestedScrollPosition(scrollPosition, isProgrammaticScroll); 169 170 return true; 170 171 } … … 174 175 ScheduledScrollUpdate scrollUpdate(nodeID, scrollPosition, programmaticScroll, scrollingLayerPositionAction); 175 176 177 // For programmatic scrolls, requestScrollPositionUpdate() has already called updateScrollPositionAfterAsyncScroll(). 178 if (programmaticScroll) 179 return; 180 176 181 if (m_updateNodeScrollPositionTimer.isActive()) { 177 182 if (m_scheduledScrollUpdate.matchesUpdateType(scrollUpdate)) {
Note:
See TracChangeset
for help on using the changeset viewer.