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

Unified Diff: Source/core/css/CSSPrimitiveValue.cpp

Issue 813233002: Animation: Fix loss of type information when interpolating value of 0 (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Removed changes to core.gypi, moved StringKeyframe, increased testing, added extra accumulate lengt… Created 6 years 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
« no previous file with comments | « Source/core/css/CSSPrimitiveValue.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)
« no previous file with comments | « Source/core/css/CSSPrimitiveValue.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698