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

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

Issue 468793003: Make style building for 'font-size' less custom. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix regression related to FontDescriptions with isAbsolute=true. Created 6 years, 3 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/core/css/FontSize.h ('k') | Source/core/css/resolver/FontBuilder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/FontSize.cpp
diff --git a/Source/core/css/FontSize.cpp b/Source/core/css/FontSize.cpp
index 10d144080f0f95fd09e52585292e2314191e2119..6f482d0f9ffe1b8ba36fa9b7e51aba2968a4b3b7 100644
--- a/Source/core/css/FontSize.cpp
+++ b/Source/core/css/FontSize.cpp
@@ -128,9 +128,9 @@ static int inline rowFromMediumFontSizeInRange(const Settings* settings, bool qu
return -1;
}
-float FontSize::fontSizeForKeyword(const Document* document, CSSValueID keyword, FixedPitchFontType fixedPitchFontType)
+float FontSize::fontSizeForKeyword(const Document* document, unsigned keyword, FixedPitchFontType fixedPitchFontType)
{
- ASSERT(keyword >= CSSValueXxSmall && keyword <= CSSValueWebkitXxxLarge);
+ ASSERT(keyword >= 1 && keyword <= 8);
const Settings* settings = document->settings();
if (!settings)
return 1.0f;
@@ -139,13 +139,13 @@ float FontSize::fontSizeForKeyword(const Document* document, CSSValueID keyword,
int mediumSize = 0;
int row = rowFromMediumFontSizeInRange(settings, quirksMode, fixedPitchFontType, mediumSize);
if (row >= 0) {
- int col = (keyword - CSSValueXxSmall);
+ int col = (keyword - 1);
return quirksMode ? quirksFontSizeTable[row][col] : strictFontSizeTable[row][col];
}
// Value is outside the range of the table. Apply the scale factor instead.
float minLogicalSize = std::max(settings->minimumLogicalFontSize(), 1);
- return std::max(fontSizeFactors[keyword - CSSValueXxSmall] * mediumSize, minLogicalSize);
+ return std::max(fontSizeFactors[keyword - 1] * mediumSize, minLogicalSize);
}
« no previous file with comments | « Source/core/css/FontSize.h ('k') | Source/core/css/resolver/FontBuilder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698