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

Unified Diff: third_party/WebKit/Source/web/DevToolsEmulator.cpp

Issue 2015783002: Invalidate touchEventTargetRects in ScrollingCoordinator when toggling touch emulation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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/web/DevToolsEmulator.cpp
diff --git a/third_party/WebKit/Source/web/DevToolsEmulator.cpp b/third_party/WebKit/Source/web/DevToolsEmulator.cpp
index f87f2e7aca8c984765512bddb16f8cd47627b737..8e46ad489fc8de44be9dfce0d3a7c9f51fdfa207 100644
--- a/third_party/WebKit/Source/web/DevToolsEmulator.cpp
+++ b/third_party/WebKit/Source/web/DevToolsEmulator.cpp
@@ -8,6 +8,7 @@
#include "core/frame/FrameView.h"
#include "core/frame/Settings.h"
#include "core/page/Page.h"
+#include "core/page/scrolling/ScrollingCoordinator.h"
#include "core/style/ComputedStyle.h"
#include "platform/RuntimeEnabledFeatures.h"
#include "public/platform/WebLayerTreeView.h"
@@ -335,6 +336,12 @@ void DevToolsEmulator::setTouchEventEmulationEnabled(bool enabled)
m_webViewImpl->page()->settings().setMaxTouchPoints(enabled ? 1 : m_originalMaxTouchPoints);
}
m_touchEventEmulationEnabled = enabled;
+ if (ScrollingCoordinator* scrollingCoordinator = m_webViewImpl->page()->scrollingCoordinator()) {
+ // We only have to invalidate touch event target rects below, while using big hammer notifyGeometryChanged.
+ // But touch is not toggled often, and so it's fine to do more work vs introducing more fine-grained methods.
+ scrollingCoordinator->notifyGeometryChanged();
+ scrollingCoordinator->updateAfterCompositingChangeIfNeeded();
+ }
// TODO(dgozman): mainFrameImpl() check in this class should be unnecessary.
// It is only needed when we reattach and restore InspectorEmulationAgent,
// which happens before everything has been setup correctly, and therefore
« no previous file with comments | « third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinator.cpp ('k') | third_party/WebKit/Source/web/WebViewImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698