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

Unified Diff: Source/core/page/PageScaleConstraintsSet.cpp

Issue 23742003: Use css-device-adapt constraining for legacy viewport tags. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Review issue: one assignent per line/statement 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 | « Source/core/page/PageScaleConstraintsSet.h ('k') | Source/core/testing/Internals.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/page/PageScaleConstraintsSet.cpp
diff --git a/Source/core/page/PageScaleConstraintsSet.cpp b/Source/core/page/PageScaleConstraintsSet.cpp
index 651e9d5a3806f0995040fd663df14fa778cb35a7..ec1a4ec9c2e4749954706e0f3ac2c4ebaa6144d1 100644
--- a/Source/core/page/PageScaleConstraintsSet.cpp
+++ b/Source/core/page/PageScaleConstraintsSet.cpp
@@ -51,9 +51,9 @@ PageScaleConstraints PageScaleConstraintsSet::defaultConstraints() const
return PageScaleConstraints(-1, defaultMinimumScale, defaultMaximumScale);
}
-void PageScaleConstraintsSet::updatePageDefinedConstraints(const ViewportArguments& arguments, IntSize viewSize, int layoutFallbackWidth)
+void PageScaleConstraintsSet::updatePageDefinedConstraints(const ViewportArguments& arguments, IntSize viewSize)
{
- m_pageDefinedConstraints = arguments.resolve(viewSize, layoutFallbackWidth);
+ m_pageDefinedConstraints = arguments.resolve(viewSize);
m_constraintsDirty = true;
}
@@ -125,7 +125,7 @@ void PageScaleConstraintsSet::adjustPageDefinedConstraintsForAndroidWebView(cons
{
float initialScale = m_pageDefinedConstraints.initialScale;
if (arguments.zoom == -1 && !loadWithOverviewMode) {
- if (arguments.width == -1 || (useWideViewport && arguments.width != ViewportArguments::ValueDeviceWidth))
+ if (arguments.maxWidth.isAuto() || (useWideViewport && arguments.maxWidth.isFixed()))
m_pageDefinedConstraints.initialScale = 1.0f;
}
@@ -136,12 +136,12 @@ void PageScaleConstraintsSet::adjustPageDefinedConstraintsForAndroidWebView(cons
m_pageDefinedConstraints.maximumScale *= targetDensityDPIFactor;
float adjustedLayoutSizeWidth = m_pageDefinedConstraints.layoutSize.width();
- if (useWideViewport && arguments.width == -1 && arguments.zoom != 1.0f)
+ if (useWideViewport && arguments.maxWidth.type() == ExtendToZoom && arguments.zoom != 1.0f)
adjustedLayoutSizeWidth = layoutFallbackWidth;
else {
if (!useWideViewport)
adjustedLayoutSizeWidth = getLayoutWidthForNonWideViewport(viewSize, initialScale);
- if (!useWideViewport || arguments.width == -1 || arguments.width == ViewportArguments::ValueDeviceWidth)
+ if (!useWideViewport || arguments.maxWidth.type() == ExtendToZoom || arguments.maxWidth.isViewportPercentage())
adjustedLayoutSizeWidth /= targetDensityDPIFactor;
}
« no previous file with comments | « Source/core/page/PageScaleConstraintsSet.h ('k') | Source/core/testing/Internals.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698