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

Unified Diff: third_party/WebKit/Source/core/editing/EditingStyle.cpp

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/editing/EditingStyle.cpp
diff --git a/third_party/WebKit/Source/core/editing/EditingStyle.cpp b/third_party/WebKit/Source/core/editing/EditingStyle.cpp
index 1f67ac5d878431c45a118778b5025b5744bca78e..770e011bbcda80b32205caba4396698f95efb4fd 100644
--- a/third_party/WebKit/Source/core/editing/EditingStyle.cpp
+++ b/third_party/WebKit/Source/core/editing/EditingStyle.cpp
@@ -2003,9 +2003,24 @@ int legacyFontSizeFromCSSValue(Document* document,
if (value->isIdentifierValue()) {
const CSSIdentifierValue& identifierValue = toCSSIdentifierValue(*value);
- if (CSSValueXSmall <= identifierValue.getValueID() &&
- identifierValue.getValueID() <= CSSValueWebkitXxxLarge)
- return identifierValue.getValueID() - CSSValueXSmall + 1;
+ switch (identifierValue.getValueID()) {
+ case CSSValueXSmall:
+ return 1;
+ case CSSValueSmall:
+ return 2;
+ case CSSValueMedium:
+ return 3;
+ case CSSValueLarge:
+ return 4;
+ case CSSValueXLarge:
+ return 5;
+ case CSSValueXxLarge:
+ return 6;
+ case CSSValueWebkitXxxLarge:
+ return 7;
+ default:
+ return 0;
+ }
}
return 0;

Powered by Google App Engine
This is Rietveld 408576698