Chromium Code Reviews| Index: Source/core/svg/SVGLength.cpp |
| diff --git a/Source/core/svg/SVGLength.cpp b/Source/core/svg/SVGLength.cpp |
| index 1c37407b3be6f355b4f2c65a2cbe972992ca76fb..ab61b0a8e72f34e531732048e0ebc7aca7a0352b 100644 |
| --- a/Source/core/svg/SVGLength.cpp |
| +++ b/Source/core/svg/SVGLength.cpp |
| @@ -63,6 +63,8 @@ inline const char* lengthTypeToString(SVGLengthType type) |
| return "pc"; |
| case LengthTypeREMS: |
| return "rem"; |
| + case LengthTypeCHS: |
| + return "ch"; |
| } |
| ASSERT_NOT_REACHED(); |
| @@ -103,6 +105,8 @@ SVGLengthType stringToLengthType(const CharType*& ptr, const CharType* end) |
| if (thirdChar == 'm') |
| type = LengthTypeREMS; |
| } |
| + } else if (firstChar == 'c' && secondChar == 'h') { |
|
fs
2015/04/10 12:17:24
Merge this with the other case starting with 'c' (
Shanmuga Pandi
2015/04/10 13:09:19
Done.
|
| + type = LengthTypeCHS; |
| } else if (firstChar == 'c' && secondChar == 'm') { |
| type = LengthTypeCM; |
| } else if (firstChar == 'm' && secondChar == 'm') { |
| @@ -311,6 +315,9 @@ PassRefPtrWillBeRawPtr<SVGLength> SVGLength::fromCSSPrimitiveValue(CSSPrimitiveV |
| case CSSPrimitiveValue::CSS_REMS: |
| svgType = LengthTypeREMS; |
| break; |
| + case CSSPrimitiveValue::CSS_CHS: |
| + svgType = LengthTypeCHS; |
| + break; |
| default: |
| ASSERT(value->primitiveType() == CSSPrimitiveValue::CSS_PC); |
| svgType = LengthTypePC; |
| @@ -363,6 +370,9 @@ PassRefPtrWillBeRawPtr<CSSPrimitiveValue> SVGLength::toCSSPrimitiveValue(PassRef |
| case LengthTypeREMS: |
| cssType = CSSPrimitiveValue::CSS_REMS; |
| break; |
| + case LengthTypeCHS: |
| + cssType = CSSPrimitiveValue::CSS_CHS; |
| + break; |
| }; |
| return CSSPrimitiveValue::create(length->valueInSpecifiedUnits(), cssType); |
| @@ -416,7 +426,7 @@ PassRefPtrWillBeRawPtr<SVGLength> SVGLength::blend(PassRefPtrWillBeRawPtr<SVGLen |
| || toType == LengthTypeUnknown |
| || (!from->isZero() && fromType != LengthTypePercentage && toType == LengthTypePercentage) |
| || (!isZero() && fromType == LengthTypePercentage && toType != LengthTypePercentage) |
| - || (!from->isZero() && !isZero() && (fromType == LengthTypeEMS || fromType == LengthTypeEXS || fromType == LengthTypeREMS) && fromType != toType)) |
| + || (!from->isZero() && !isZero() && (fromType == LengthTypeEMS || fromType == LengthTypeEXS || fromType == LengthTypeREMS || fromType == LengthTypeCHS) && fromType != toType)) |
| return clone(); |
| RefPtrWillBeRawPtr<SVGLength> length = create(); |
| @@ -428,7 +438,7 @@ PassRefPtrWillBeRawPtr<SVGLength> SVGLength::blend(PassRefPtrWillBeRawPtr<SVGLen |
| return length; |
| } |
| - if (fromType == toType || from->isZero() || isZero() || fromType == LengthTypeEMS || fromType == LengthTypeEXS || fromType == LengthTypeREMS) { |
| + if (fromType == toType || from->isZero() || isZero() || fromType == LengthTypeEMS || fromType == LengthTypeEXS || fromType == LengthTypeREMS || fromType == LengthTypeCHS) { |
| float fromValue = from->valueInSpecifiedUnits(); |
| float toValue = valueInSpecifiedUnits(); |
| if (isZero()) |