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; |