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

Unified Diff: Source/web/WebViewImpl.cpp

Issue 82083002: Move viewport unit resolution to style recalc time (Closed) Base URL: https://chromium.googlesource.com/chromium/blink@master
Patch Set: rebased.. Created 7 years 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 8850f2841003095d8eb022e720cc164e89e74e5e..5fc70546600f534409912c3a177ba41c5b7f11a1 100644
--- a/Source/web/WebViewImpl.cpp
+++ b/Source/web/WebViewImpl.cpp
@@ -2987,9 +2987,9 @@ void WebViewImpl::updatePageDefinedViewportConstraints(const ViewportDescription
adjustedDescription.maxWidth = Length(); // auto
const int legacyWidthSnappingMagicNumber = 320;
if (adjustedDescription.maxWidth.isFixed() && adjustedDescription.maxWidth.value() <= legacyWidthSnappingMagicNumber)
- adjustedDescription.maxWidth = Length(100, ViewportPercentageWidth);
+ adjustedDescription.maxWidth = Length(-1, Percent);
if (adjustedDescription.maxHeight.isFixed() && adjustedDescription.maxWidth.value() <= m_size.height)
- adjustedDescription.maxHeight = Length(100, ViewportPercentageHeight);
+ adjustedDescription.maxHeight = Length(-2, Percent);
esprehn 2013/12/04 06:02:28 This makes me nervous... why the magic lengths?
adjustedDescription.minWidth = adjustedDescription.maxWidth;
adjustedDescription.minHeight = adjustedDescription.maxHeight;
}
@@ -2999,7 +2999,7 @@ void WebViewImpl::updatePageDefinedViewportConstraints(const ViewportDescription
if (settingsImpl()->clobberUserAgentInitialScaleQuirk()
&& m_pageScaleConstraintsSet.userAgentConstraints().initialScale != -1
&& m_pageScaleConstraintsSet.userAgentConstraints().initialScale * deviceScaleFactor() <= 1) {
- if (description.maxWidth == Length(100, ViewportPercentageWidth)
+ if (description.maxWidth == Length(-1, Percent)
|| (description.maxWidth.type() == ExtendToZoom && m_pageScaleConstraintsSet.pageDefinedConstraints().initialScale == 1.0f))
setInitialPageScaleOverride(-1);
}
« Source/core/rendering/style/RenderStyle.h ('K') | « Source/web/PageScaleConstraintsSet.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698