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

Unified Diff: Source/web/WebViewImpl.cpp

Issue 23592015: Use constrained values for shouldDisableDesktopWorkarounds. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebased Created 7 years, 3 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 | Source/web/tests/WebFrameTest.cpp » ('j') | 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 801fc8e469e17063a06f51af349e03f94e4c8c4d..43cd67980c49073e0a48c64f21ae4fb84342a5bc 100644
--- a/Source/web/WebViewImpl.cpp
+++ b/Source/web/WebViewImpl.cpp
@@ -4106,9 +4106,18 @@ void WebViewImpl::pointerLockMouseEvent(const WebInputEvent& event)
bool WebViewImpl::shouldDisableDesktopWorkarounds()
{
- ViewportArguments arguments = mainFrameImpl()->frame()->document()->viewportArguments();
- return arguments.width == ViewportArguments::ValueDeviceWidth || !arguments.userZoom
- || (arguments.minZoom == arguments.maxZoom && arguments.minZoom != ViewportArguments::ValueAuto);
+ if (!settings()->viewportEnabled() || !isFixedLayoutModeEnabled())
+ return false;
+
+ // A document is considered adapted to small screen UAs if one of these holds:
+ // 1. The author specified viewport has a constrained width that is equal to
+ // the initial viewport width.
+ // 2. The author has disabled viewport zoom.
+
+ const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefinedConstraints();
+
+ return fixedLayoutSize().width == m_size.width
+ || (constraints.minimumScale == constraints.maximumScale && constraints.minimumScale != -1);
}
} // namespace WebKit
« no previous file with comments | « no previous file | Source/web/tests/WebFrameTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698