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

Unified Diff: Source/web/WebViewImpl.cpp

Issue 308003007: [DevTools] Update media queries when resizing with emulation on. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase, updated comment, removed test Created 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/WebViewImpl.cpp
diff --git a/Source/web/WebViewImpl.cpp b/Source/web/WebViewImpl.cpp
index b504683a18b5ec9dd7eae7d3fda0e1f0bf490529..02d797b32bc6ae2504705a7ce4d4532268e309b6 100644
--- a/Source/web/WebViewImpl.cpp
+++ b/Source/web/WebViewImpl.cpp
@@ -1619,6 +1619,16 @@ void WebViewImpl::resize(const WebSize& newSize)
if (pinchVirtualViewportEnabled())
page()->frameHost().pinchViewport().setSize(m_size);
+
+ // When device emulation is enabled, device size values may change - they are
+ // usually set equal to the view size. These values are not considered viewport-dependent
+ // (see MediaQueryExp::isViewportDependent), since they are only viewport-dependent in emulation mode,
+ // and thus will not be invalidated in |FrameView::performPreLayoutTasks|.
+ // Therefore we should force explicit media queries invalidation here.
+ if (page()->inspectorController().deviceEmulationEnabled()) {
+ if (Document* document = mainFrameImpl()->frame()->document())
+ document->mediaQueryAffectingValueChanged();
+ }
}
if (settings()->viewportEnabled() && !m_fixedLayoutSizeLock) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698