Commit 4236a863 authored by dgozman@chromium.org's avatar dgozman@chromium.org

[DevTools] Update media queries when resizing with emulation on.

Media query evaluator assumes that device size cannot change, which is
wrong in emulation mode.

BUG=327641,386142

Review URL: https://codereview.chromium.org/308003007

git-svn-id: svn://svn.chromium.org/blink/trunk@176420 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent da1ac85d
...@@ -1619,6 +1619,16 @@ void WebViewImpl::resize(const WebSize& newSize) ...@@ -1619,6 +1619,16 @@ void WebViewImpl::resize(const WebSize& newSize)
if (pinchVirtualViewportEnabled()) if (pinchVirtualViewportEnabled())
page()->frameHost().pinchViewport().setSize(m_size); 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) { if (settings()->viewportEnabled() && !m_fixedLayoutSizeLock) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment