Index: Source/core/svg/SVGLength.cpp |
diff --git a/Source/core/svg/SVGLength.cpp b/Source/core/svg/SVGLength.cpp |
index 7b37c161fd9f5d31a7893774fd9767157be1d57c..cf5d734742338ddeaa22f77ec30b70049c77f0be 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,8 +105,11 @@ SVGLengthType stringToLengthType(const CharType*& ptr, const CharType* end) |
if (thirdChar == 'm') |
type = LengthTypeREMS; |
} |
- } else if (firstChar == 'c' && secondChar == 'm') { |
- type = LengthTypeCM; |
+ } else if (firstChar == 'c') { |
+ if (secondChar == 'h') |
+ type = LengthTypeCHS; |
+ if (secondChar == 'm') |
+ type = LengthTypeCM; |
} else if (firstChar == 'm' && secondChar == 'm') { |
type = LengthTypeMM; |
} else if (firstChar == 'i' && secondChar == 'n') { |
@@ -311,6 +316,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 +371,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 +427,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 +439,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()) |