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

Unified Diff: third_party/WebKit/Source/core/css/FontSize.cpp

Issue 2575863002: Ignore minimum font-size for SVG text (Closed)
Patch Set: Created 4 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: third_party/WebKit/Source/core/css/FontSize.cpp
diff --git a/third_party/WebKit/Source/core/css/FontSize.cpp b/third_party/WebKit/Source/core/css/FontSize.cpp
index f77d40ddc1c11cca73c3bc645422b0e2cad94d0d..a67b01f80be96d174a32a09ead4ea39983a14d35 100644
--- a/third_party/WebKit/Source/core/css/FontSize.cpp
+++ b/third_party/WebKit/Source/core/css/FontSize.cpp
@@ -41,7 +41,7 @@ float FontSize::getComputedSizeFromSpecifiedSize(
float zoomFactor,
bool isAbsoluteSize,
float specifiedSize,
- ESmartMinimumForFontSize useSmartMinimumForFontSize) {
+ ApplyMinimumFontSize applyMinimumFontSize) {
// 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
// rendering. This is also compatible with other browsers that have minimum
@@ -65,24 +65,25 @@ float FontSize::getComputedSizeFromSpecifiedSize(
if (!settings)
return 1.0f;
- int minSize = settings->minimumFontSize();
- int minLogicalSize = settings->minimumLogicalFontSize();
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;
-
- // 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 (applyMinimumFontSize) {
+ int minSize = settings->minimumFontSize();
+ int minLogicalSize = settings->minimumLogicalFontSize();
+
+ // Apply the hard minimum first. We only apply the hard minimum if after
+ // zooming we're still too small.
+ if (zoomedSize < minSize)
+ zoomedSize = 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 (zoomedSize < minLogicalSize &&
+ (specifiedSize >= minLogicalSize || !isAbsoluteSize))
+ zoomedSize = 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);
« no previous file with comments | « third_party/WebKit/Source/core/css/FontSize.h ('k') | third_party/WebKit/Source/core/layout/svg/LayoutSVGInlineText.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698