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

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: Yet another comment fix Created 7 years, 4 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
Index: Source/web/WebViewImpl.cpp
diff --git a/Source/web/WebViewImpl.cpp b/Source/web/WebViewImpl.cpp
index f683d8da5bf72dbf502816424c0d61f3372b599e..9cf0e2101e85d176d7b521ab4c8c5f0495486c38 100644
--- a/Source/web/WebViewImpl.cpp
+++ b/Source/web/WebViewImpl.cpp
@@ -4117,9 +4117,18 @@ void WebViewImpl::pointerLockMouseEvent(const WebInputEvent& event)
bool WebViewImpl::shouldDisableDesktopWorkarounds()
kenneth.r.christiansen 2013/08/29 13:35:55 If these are quirks, should we suffix the methods
rune 2013/08/29 13:57:53 You mean negate it and call it shouldApplyDesktopW
aelias_OOO_until_Jul13 2013/08/29 18:29:35 It's used to decide whether to trigger Chromium's
{
- 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') | Source/web/tests/data/disambiguation_popup_viewport_site.html » ('J')

Powered by Google App Engine
This is Rietveld 408576698