Chromium Code Reviews| Index: Source/core/css/CSSPrimitiveValue.cpp |
| diff --git a/Source/core/css/CSSPrimitiveValue.cpp b/Source/core/css/CSSPrimitiveValue.cpp |
| index d374c542df1dcf1ec4d9f15b0f90cdf07b99f96c..bdfdad6aace7a5e5ea6be0bd931f05b33ce760db 100644 |
| --- a/Source/core/css/CSSPrimitiveValue.cpp |
| +++ b/Source/core/css/CSSPrimitiveValue.cpp |
| @@ -665,7 +665,7 @@ double CSSPrimitiveValue::computeLengthDouble(const CSSToLengthConversionData& c |
| return result * conversionData.zoom(); |
| } |
| -void CSSPrimitiveValue::accumulateLengthArray(CSSLengthArray& lengthArray, double multiplier) const |
| +void CSSPrimitiveValue::accumulateLengthArray(CSSLengthArray& lengthArray, CSSLengthTypeArray& lengthTypeArray, double multiplier) const |
| { |
| ASSERT(lengthArray.size() == LengthUnitTypeCount); |
| @@ -675,8 +675,19 @@ void CSSPrimitiveValue::accumulateLengthArray(CSSLengthArray& lengthArray, doubl |
| } |
| LengthUnitType lengthType; |
| - if (unitTypeToLengthUnitType(static_cast<UnitType>(m_primitiveUnitType), lengthType)) |
| + if (unitTypeToLengthUnitType(static_cast<UnitType>(m_primitiveUnitType), lengthType)) { |
| lengthArray.at(lengthType) += m_value.num * conversionToCanonicalUnitsScaleFactor(static_cast<UnitType>(m_primitiveUnitType)) * multiplier; |
| + lengthTypeArray.set(lengthType); |
| + } |
| +} |
| + |
| +void CSSPrimitiveValue::accumulateLengthArray(CSSLengthArray& lengthArray, double multiplier) const |
| +{ |
| + CSSLengthTypeArray zeroLengthTypeArray; |
|
samli
2014/12/22 06:23:10
lengthTypeArray is fine
evemj (not active)
2014/12/22 23:05:15
Done.
|
| + zeroLengthTypeArray.resize(CSSPrimitiveValue::LengthUnitTypeCount); |
| + for (size_t i = 0; i < CSSPrimitiveValue::LengthUnitTypeCount; ++i) |
| + zeroLengthTypeArray.clear(i); |
| + return accumulateLengthArray(lengthArray, zeroLengthTypeArray, multiplier); |
| } |
| double CSSPrimitiveValue::conversionToCanonicalUnitsScaleFactor(UnitType unitType) |