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

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

Issue 22574004: Make targetDensity-dpi account for deviceScaleFactor correctly. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: add test 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
« 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/core/page/PageScaleConstraintsSet.cpp
diff --git a/Source/core/page/PageScaleConstraintsSet.cpp b/Source/core/page/PageScaleConstraintsSet.cpp
index a5df3e1550f4d867b59bc540180127f51e668d75..a2159b4fa3f6d7aa1bd7649944882f787b6d37d8 100644
--- a/Source/core/page/PageScaleConstraintsSet.cpp
+++ b/Source/core/page/PageScaleConstraintsSet.cpp
@@ -111,7 +111,9 @@ static float computeDeprecatedTargetDensityDPIFactor(const ViewportArguments& ar
targetDPI = 240.0f;
else if (arguments.deprecatedTargetDensityDPI != ViewportArguments::ValueAuto)
targetDPI = arguments.deprecatedTargetDensityDPI;
- return targetDPI > 0 ? (deviceScaleFactor * 120.0f) / targetDPI : 1.0f;
+ // Since the return value is multiplied by deviceScaleFactor and deviceScaleFactor is displayDPI / 160.0 the below expands to:
aelias_OOO_until_Jul13 2013/08/08 18:34:37 I suggest deleting this comment, I find it more di
mkosiba (inactive) 2013/08/09 09:35:25 Done.
+ // (160.0f / targetDPI) * (displayDPI / 160.0f) which is the same as displayDPI / targetDPI, which is what we want to determine.
+ return targetDPI > 0 ? 160.0f / targetDPI : 1.0f;
}
static float getLayoutWidthForNonWideViewport(const FloatSize& deviceSize, float initialScale)
« 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