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

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

Issue 2096633002: Adds scroll position/scale emulation to DevTools. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sync, patch in 2169483002 (+ regression test), add DevTools tests. Created 4 years, 5 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 848f4e121489e3eb3daee48891475e134128abbc..9e0b170d82c0e4d5a6c01afed5ea7399df8b0a99 100644
--- a/third_party/WebKit/Source/web/DevToolsEmulator.cpp
+++ b/third_party/WebKit/Source/web/DevToolsEmulator.cpp
@@ -239,9 +239,10 @@ void DevToolsEmulator::disableDeviceEmulation()
disableMobileEmulation();
m_webViewImpl->setCompositorDeviceScaleFactorOverride(0.f);
m_webViewImpl->setRootLayerTransform(WebSize(0.f, 0.f), 1.f);
- m_webViewImpl->setPageScaleFactor(1.f);
+ m_webViewImpl->resetScaleStateImmediately();
// mainFrameImpl() could be null during cleanup or remote <-> local swap.
if (m_webViewImpl->mainFrameImpl()) {
+ m_webViewImpl->mainFrameImpl()->frameView()->layout();
if (Document* document = m_webViewImpl->mainFrameImpl()->frame()->document())
document->mediaQueryAffectingValueChanged();
}
@@ -314,9 +315,6 @@ void DevToolsEmulator::disableMobileEmulation()
m_webViewImpl->setDefaultPageScaleLimits(
m_originalDefaultMinimumPageScaleFactor,
m_originalDefaultMaximumPageScaleFactor);
- // mainFrameImpl() could be null during cleanup or remote <-> local swap.
- if (m_webViewImpl->mainFrameImpl())
- m_webViewImpl->mainFrameImpl()->frameView()->layout();
dgozman 2016/07/21 20:54:08 This is still needed when we toggle between mobile
Eric Seckler 2016/07/22 14:44:48 Right, thanks. I think it still makes sense to res
}
void DevToolsEmulator::setTouchEventEmulationEnabled(bool enabled)

Powered by Google App Engine
This is Rietveld 408576698