Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(702)

Unified Diff: third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinator.cpp

Issue 1648293003: Fix smooth scroll jump when switching scroll handling between MT and CC (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove fn to clear all main thread scrolling reasons Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinator.cpp
diff --git a/third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinator.cpp b/third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinator.cpp
index 3a64da20ff27cc8540beb7a5f16fa4fe72774714..08995a430ac8fca7eea22fcd79aa36bb8e61aab6 100644
--- a/third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinator.cpp
+++ b/third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinator.cpp
@@ -686,10 +686,15 @@ void ScrollingCoordinator::setShouldUpdateScrollLayerPositionOnMainThread(MainTh
return;
if (WebLayer* scrollLayer = toWebLayer(m_page->deprecatedLocalMainFrame()->view()->layerForScrolling())) {
m_lastMainThreadScrollingReasons = mainThreadScrollingReasons;
- if (mainThreadScrollingReasons)
+ if (mainThreadScrollingReasons) {
scrollLayer->addMainThreadScrollingReasons(mainThreadScrollingReasons);
- else
- scrollLayer->clearMainThreadScrollingReasons();
+ } else {
+ // Clear all main thread scrolling reasons except the one that's set
+ // if there is a running scroll animation.
+ uint32_t mainThreadScrollingReasonsToClear = ~0;
skobes 2016/02/04 20:04:40 I had to change this to ~0u to compile on Windows.
ymalik 2016/02/04 21:53:20 Thanks! Fixed.
+ mainThreadScrollingReasonsToClear &= ~MainThreadScrollingReason::kAnimatingScollOnMainThread;
+ scrollLayer->clearMainThreadScrollingReasons(mainThreadScrollingReasonsToClear);
+ }
}
}

Powered by Google App Engine
This is Rietveld 408576698