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

Unified Diff: sky/engine/core/css/FontSize.cpp

Issue 711203002: Remove zoom() and effectiveZoom(). (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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 | « sky/engine/core/css/FontSize.h ('k') | sky/engine/core/css/resolver/AnimatedStyleBuilder.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/css/FontSize.cpp
diff --git a/sky/engine/core/css/FontSize.cpp b/sky/engine/core/css/FontSize.cpp
index 86e688d06aecb48eb086e63df477cba25857ec68..9bfedd64c7a4dd181697f7167f9159c1e8f8bb8e 100644
--- a/sky/engine/core/css/FontSize.cpp
+++ b/sky/engine/core/css/FontSize.cpp
@@ -35,7 +35,7 @@
namespace blink {
-float FontSize::getComputedSizeFromSpecifiedSize(const Document* document, float zoomFactor, bool isAbsoluteSize, float specifiedSize, ESmartMinimumForFontSize useSmartMinimumForFontSize)
+float FontSize::getComputedSizeFromSpecifiedSize(const Document* document, bool isAbsoluteSize, float specifiedSize, ESmartMinimumForFontSize useSmartMinimumForFontSize)
{
// Text with a 0px font size should not be visible and therefore needs to be
// exempt from minimum font size rules. Acid3 relies on this for pixel-perfect
@@ -60,22 +60,21 @@ float FontSize::getComputedSizeFromSpecifiedSize(const Document* document, float
int minSize = 0;
int minLogicalSize = 0;
- float zoomedSize = specifiedSize * zoomFactor;
// Apply the hard minimum first. We only apply the hard minimum if after zooming we're still too small.
- if (zoomedSize < minSize)
- zoomedSize = minSize;
+ if (specifiedSize < minSize)
+ specifiedSize = minSize;
// Now apply the "smart minimum." This minimum is also only applied if we're still too small
// after zooming. The font size must either be relative to the user default or the original size
// must have been acceptable. In other words, we only apply the smart minimum whenever we're positive
// doing so won't disrupt the layout.
- if (useSmartMinimumForFontSize && zoomedSize < minLogicalSize && (specifiedSize >= minLogicalSize || !isAbsoluteSize))
- zoomedSize = minLogicalSize;
+ if (useSmartMinimumForFontSize && specifiedSize < minLogicalSize && (specifiedSize >= minLogicalSize || !isAbsoluteSize))
+ specifiedSize = minLogicalSize;
// Also clamp to a reasonable maximum to prevent insane font sizes from causing crashes on various
// platforms (I'm looking at you, Windows.)
- return std::min(maximumAllowedFontSize, zoomedSize);
+ return std::min(maximumAllowedFontSize, specifiedSize);
}
const int fontSizeTableMax = 16;
« no previous file with comments | « sky/engine/core/css/FontSize.h ('k') | sky/engine/core/css/resolver/AnimatedStyleBuilder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698