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) { |