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

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

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/CSSProperties.in ('k') | Source/core/css/FontSize.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/FontSize.h
diff --git a/Source/core/css/FontSize.h b/Source/core/css/FontSize.h
index a864114419e9bd87da50201fb01054c4cbb63236..79ad500456c9e36fdca17d6b9e6f16cfd3b0802d 100644
--- a/Source/core/css/FontSize.h
+++ b/Source/core/css/FontSize.h
@@ -40,9 +40,19 @@ private:
public:
static float getComputedSizeFromSpecifiedSize(const Document*, float zoomFactor, bool isAbsoluteSize, float specifiedSize, ESmartMinimumForFontSize = UseSmartMinimumForFontFize);
- // Given a CSS keyword in the range (xx-small to -webkit-xxx-large), this function will return
- // the correct font size scaled relative to the user's default (medium).
- static float fontSizeForKeyword(const Document*, CSSValueID keyword, FixedPitchFontType);
+ // Given a CSS keyword in the range (xx-small to -webkit-xxx-large), this function returns
+ // values from '1' to '8'.
+ static unsigned keywordSize(CSSValueID valueID)
+ {
+ ASSERT(valueID >= CSSValueXxSmall && valueID <= CSSValueWebkitXxxLarge);
+ return valueID - CSSValueXxSmall + 1;
+ }
+
+ static unsigned initialKeywordSize() { return 4; } // CSSValueMedium
+
+ // Given a keyword size in the range (1 to 8), this function will return
+ // the correct font size scaled relative to the user's default (4).
+ static float fontSizeForKeyword(const Document*, unsigned keyword, FixedPitchFontType);
// Given a font size in pixel, this function will return legacy font size between 1 and 7.
static int legacyFontSize(const Document*, int pixelFontSize, FixedPitchFontType);
« no previous file with comments | « Source/core/css/CSSProperties.in ('k') | Source/core/css/FontSize.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698