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

Unified Diff: Source/web/PageScaleConstraintsSet.cpp

Issue 82083002: Move viewport unit resolution to style recalc time (Closed) Base URL: https://chromium.googlesource.com/chromium/blink@master
Patch Set: rename browser zoom to page zoom Created 6 years, 12 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/platform/LengthFunctions.cpp ('k') | Source/web/WebViewImpl.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/PageScaleConstraintsSet.cpp
diff --git a/Source/web/PageScaleConstraintsSet.cpp b/Source/web/PageScaleConstraintsSet.cpp
index 474556d50d2fd95734556d7e5c03eaea3fdc33e5..aed2fbc813c6ea1201a808446fa5e725cd8cf736 100644
--- a/Source/web/PageScaleConstraintsSet.cpp
+++ b/Source/web/PageScaleConstraintsSet.cpp
@@ -145,7 +145,7 @@ void PageScaleConstraintsSet::adjustForAndroidWebViewQuirks(const ViewportDescri
if (description.zoom == -1) {
if (description.maxWidth.isAuto() || description.maxWidth.type() == ExtendToZoom)
resetInitialScale = true;
- if (useWideViewport || description.maxWidth == Length(100, ViewportPercentageWidth))
+ if (useWideViewport || description.maxWidth.type() == DeviceWidth)
resetInitialScale = true;
}
if (resetInitialScale)
@@ -162,7 +162,7 @@ void PageScaleConstraintsSet::adjustForAndroidWebViewQuirks(const ViewportDescri
m_pageDefinedConstraints.initialScale *= targetDensityDPIFactor;
m_pageDefinedConstraints.minimumScale *= targetDensityDPIFactor;
m_pageDefinedConstraints.maximumScale *= targetDensityDPIFactor;
- if (wideViewportQuirkEnabled && (!useWideViewport || description.maxWidth == Length(100, ViewportPercentageWidth))) {
+ if (wideViewportQuirkEnabled && (!useWideViewport || description.maxWidth.type() == DeviceWidth)) {
adjustedLayoutSizeWidth /= targetDensityDPIFactor;
adjustedLayoutSizeHeight /= targetDensityDPIFactor;
}
@@ -173,10 +173,10 @@ void PageScaleConstraintsSet::adjustForAndroidWebViewQuirks(const ViewportDescri
adjustedLayoutSizeWidth = layoutFallbackWidth;
adjustedLayoutSizeHeight = computeHeightByAspectRatio(adjustedLayoutSizeWidth, viewSize);
} else if (!useWideViewport) {
- const float nonWideScale = description.zoom < 1 && !description.maxWidth.isViewportPercentage() ? -1 : oldInitialScale;
+ const float nonWideScale = description.zoom < 1 && description.maxWidth.type() != DeviceWidth && description.maxWidth.type() != DeviceHeight ? -1 : oldInitialScale;
adjustedLayoutSizeWidth = getLayoutWidthForNonWideViewport(viewSize, nonWideScale) / targetDensityDPIFactor;
float newInitialScale = targetDensityDPIFactor;
- if (m_userAgentConstraints.initialScale != -1 && (description.maxWidth == Length(100, ViewportPercentageWidth) || ((description.maxWidth.isAuto() || description.maxWidth.type() == ExtendToZoom) && description.zoom == -1))) {
+ if (m_userAgentConstraints.initialScale != -1 && (description.maxWidth.type() == DeviceWidth || ((description.maxWidth.isAuto() || description.maxWidth.type() == ExtendToZoom) && description.zoom == -1))) {
adjustedLayoutSizeWidth /= m_userAgentConstraints.initialScale;
newInitialScale = m_userAgentConstraints.initialScale;
}
@@ -193,7 +193,7 @@ void PageScaleConstraintsSet::adjustForAndroidWebViewQuirks(const ViewportDescri
m_pageDefinedConstraints.initialScale = targetDensityDPIFactor;
m_pageDefinedConstraints.minimumScale = m_pageDefinedConstraints.initialScale;
m_pageDefinedConstraints.maximumScale = m_pageDefinedConstraints.initialScale;
- if (description.maxWidth.isAuto() || description.maxWidth.type() == ExtendToZoom || description.maxWidth == Length(100, ViewportPercentageWidth)) {
+ if (description.maxWidth.isAuto() || description.maxWidth.type() == ExtendToZoom || description.maxWidth.type() == DeviceWidth) {
adjustedLayoutSizeWidth = viewSize.width() / targetDensityDPIFactor;
adjustedLayoutSizeHeight = computeHeightByAspectRatio(adjustedLayoutSizeWidth, viewSize);
}
« no previous file with comments | « Source/platform/LengthFunctions.cpp ('k') | Source/web/WebViewImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698