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

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: Rebased, added comment 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 | « LayoutTests/inspector/device-emulation/device-emulation-mq-on-resize-expected.txt ('k') | 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 51c45460b378c2f15239fceba6f3b17969307127..0f8af0913004786143820c8fcd6dbee1a94d463f 100644
--- a/Source/web/WebViewImpl.cpp
+++ b/Source/web/WebViewImpl.cpp
@@ -1621,6 +1621,15 @@ 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), and will not be invalidated in |FrameView::performPreLayoutTasks|.
ojan 2014/06/10 17:22:37 I would add something like... These values are no
dgozman 2014/06/18 13:15:43 Done.
+ // 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 | « LayoutTests/inspector/device-emulation/device-emulation-mq-on-resize-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698