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

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

Issue 2366243002: Remove all ordering requirements in CSSValueKeywords.in (WIP) (Closed)
Patch Set: Some mor efixes Created 4 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
Index: third_party/WebKit/Source/core/css/FontSize.h
diff --git a/third_party/WebKit/Source/core/css/FontSize.h b/third_party/WebKit/Source/core/css/FontSize.h
index d8c9d5bc20adaed0af47c080785d84c7c7ecf6aa..506e9b6c89b871889b6337c4a00889e773535cb5 100644
--- a/third_party/WebKit/Source/core/css/FontSize.h
+++ b/third_party/WebKit/Source/core/css/FontSize.h
@@ -51,11 +51,31 @@ class FontSize {
// values from '1' to '8'.
static unsigned keywordSize(CSSValueID valueID) {
ASSERT(isValidValueID(valueID));
- return valueID - CSSValueXxSmall + 1;
+ switch (valueID) {
+ case CSSValueXxSmall:
+ return 1;
+ case CSSValueXSmall:
+ return 2;
+ case CSSValueSmall:
+ return 3;
+ case CSSValueMedium:
+ return 4;
+ case CSSValueLarge:
+ return 5;
+ case CSSValueXLarge:
+ return 6;
+ case CSSValueXxLarge:
+ return 7;
+ case CSSValueWebkitXxxLarge:
+ return 8;
+ default:
+ NOTREACHED();
+ return 1;
+ }
}
static bool isValidValueID(CSSValueID valueID) {
- return valueID >= CSSValueXxSmall && valueID <= CSSValueWebkitXxxLarge;
+ return valueID == CSSValueXxSmall || valueID == CSSValueXSmall || valueID == CSSValueSmall || valueID == CSSValueMedium || valueID == CSSValueLarge || valueID == CSSValueXLarge || valueID == CSSValueXxLarge || valueID == CSSValueWebkitXxxLarge;
}
static CSSValueID initialValueID() { return CSSValueMedium; }
« no previous file with comments | « third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp ('k') | third_party/WebKit/Source/core/css/StyleColor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698