Changeset 286719 in webkit
- Timestamp:
- Dec 8, 2021, 1:25:44 PM (5 years ago)
- Location:
- branches/safari-612.4.2.1-branch/Source/WebCore
- Files:
-
- 3 edited
-
ChangeLog (modified) (1 diff)
-
page/scrolling/ScrollingTree.cpp (modified) (1 diff)
-
page/scrolling/ThreadedScrollingTree.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/safari-612.4.2.1-branch/Source/WebCore/ChangeLog
r286718 r286719 1 2021-12-02 Russell Epstein <repstein@apple.com> 2 3 Cherry-pick r286411. rdar://problem/85928816 4 5 Scrolling complex websites can stutter: scrolling thread frame can fail to process wheel events 6 https://bugs.webkit.org/show_bug.cgi?id=233739 7 rdar://85946176 8 9 Reviewed by Tim Horton. 10 11 While the scrolling thread is chilling in 12 ThreadedScrollingTree::waitForRenderingUpdateCompletionOrTimeout(), waiting up to half a 13 frame to allow the main thread to handle the commit (for scroll synchronization), wheel 14 events may have been dispatched to the scrolling thread. 15 16 If we blow the timeout and commit anyway, we need to make sure we've handled these wheel 17 events first, so that the current frame can commit some layer movement. We can achieve this 18 by dispatching the applyLayerPositions(), which will enqueue it behind any waiting wheel 19 event dispatch from EventDispatcher::internalWheelEvent(). 20 21 * page/scrolling/ScrollingTree.cpp: 22 (WebCore::ScrollingTree::applyLayerPositions): 23 * page/scrolling/ThreadedScrollingTree.cpp: 24 (WebCore::ThreadedScrollingTree::waitForRenderingUpdateCompletionOrTimeout): 25 26 git-svn-id: https://svn.webkit.org/repository/webkit/trunk@286411 268f45cc-cd09-0410-ab3c-d52691b4dbfc 27 28 2021-12-01 Simon Fraser <simon.fraser@apple.com> 29 30 Scrolling complex websites can stutter: scrolling thread frame can fail to process wheel events 31 https://bugs.webkit.org/show_bug.cgi?id=233739 32 rdar://85946176 33 34 Reviewed by Tim Horton. 35 36 While the scrolling thread is chilling in 37 ThreadedScrollingTree::waitForRenderingUpdateCompletionOrTimeout(), waiting up to half a 38 frame to allow the main thread to handle the commit (for scroll synchronization), wheel 39 events may have been dispatched to the scrolling thread. 40 41 If we blow the timeout and commit anyway, we need to make sure we've handled these wheel 42 events first, so that the current frame can commit some layer movement. We can achieve this 43 by dispatching the applyLayerPositions(), which will enqueue it behind any waiting wheel 44 event dispatch from EventDispatcher::internalWheelEvent(). 45 46 * page/scrolling/ScrollingTree.cpp: 47 (WebCore::ScrollingTree::applyLayerPositions): 48 * page/scrolling/ThreadedScrollingTree.cpp: 49 (WebCore::ThreadedScrollingTree::waitForRenderingUpdateCompletionOrTimeout): 50 1 51 2021-12-01 Alan Coon <alancoon@apple.com> 2 52 -
branches/safari-612.4.2.1-branch/Source/WebCore/page/scrolling/ScrollingTree.cpp
r286718 r286719 417 417 void ScrollingTree::applyLayerPositions() 418 418 { 419 ASSERT(isMainThread());420 419 Locker locker { m_treeLock }; 421 420 -
branches/safari-612.4.2.1-branch/Source/WebCore/page/scrolling/ThreadedScrollingTree.cpp
r286718 r286719 338 338 // At this point we know the main thread is taking too long in the rendering update, 339 339 // so we give up trying to sync with the main thread and update layers here on the scrolling thread. 340 if (canUpdateLayersOnScrollingThread()) 341 applyLayerPositionsInternal(); 340 if (canUpdateLayersOnScrollingThread()) { 341 // Dispatch to allow for the scrolling thread to handle any outstanding wheel events before we commit layers. 342 ScrollingThread::dispatch([protectedThis = makeRef(*this)]() { 343 protectedThis->applyLayerPositions(); 344 }); 345 } 342 346 tracePoint(ScrollingThreadRenderUpdateSyncEnd, 1); 343 347 } else
Note:
See TracChangeset
for help on using the changeset viewer.