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

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

Issue 2096633002: Adds scroll position/scale emulation to DevTools. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sync changes from patches 2111203004 + 2118773002. Created 4 years, 6 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 4b444f9b9237fa328f1dcbec4003f9b4d6c1f077..3203191ddf31b12f5ff9e342fcf1d51582ab0bae 100644
--- a/third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinator.cpp
+++ b/third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinator.cpp
@@ -393,7 +393,7 @@ bool ScrollingCoordinator::scrollableAreaScrollLayerDidChange(ScrollableArea* sc
WebLayer* containerLayer = toWebLayer(scrollableArea->layerForContainer());
if (webLayer) {
webLayer->setScrollClipLayer(containerLayer);
- DoublePoint scrollPosition(scrollableArea->scrollPositionDouble() - scrollableArea->minimumScrollPositionDouble());
+ DoublePoint scrollPosition(scrollableArea->scrollPositionDouble() + toDoubleSize(scrollableArea->scrollOrigin()));
webLayer->setScrollPositionDouble(scrollPosition);
webLayer->setBounds(scrollableArea->contentsSize());
@@ -671,6 +671,7 @@ void ScrollingCoordinator::setShouldUpdateScrollLayerPositionOnMainThread(MainTh
if (!m_page->mainFrame()->isLocalFrame() || !m_page->deprecatedLocalMainFrame()->view())
return;
+ WebLayer* visualViewportScrollLayer = toWebLayer(m_page->frameHost().visualViewport().scrollLayer());
GraphicsLayer* layer = m_page->deprecatedLocalMainFrame()->view()->layerForScrolling();
if (WebLayer* scrollLayer = toWebLayer(layer)) {
m_lastMainThreadScrollingReasons = mainThreadScrollingReasons;
@@ -680,12 +681,16 @@ void ScrollingCoordinator::setShouldUpdateScrollLayerPositionOnMainThread(MainTh
scrollAnimator->takeOverCompositorAnimation();
}
scrollLayer->addMainThreadScrollingReasons(mainThreadScrollingReasons);
+ if (visualViewportScrollLayer)
+ visualViewportScrollLayer->addMainThreadScrollingReasons(mainThreadScrollingReasons);
} else {
// Clear all main thread scrolling reasons except the one that's set
// if there is a running scroll animation.
uint32_t mainThreadScrollingReasonsToClear = ~0u;
mainThreadScrollingReasonsToClear &= ~MainThreadScrollingReason::kAnimatingScrollOnMainThread;
scrollLayer->clearMainThreadScrollingReasons(mainThreadScrollingReasonsToClear);
+ if (visualViewportScrollLayer)
+ visualViewportScrollLayer->clearMainThreadScrollingReasons(mainThreadScrollingReasonsToClear);
}
}
}

Powered by Google App Engine
This is Rietveld 408576698