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

Unified Diff: Source/core/css/parser/SizesCalcParserTest.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: Attempt no2 at fixing linux oilpan errors 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
Index: Source/core/css/parser/SizesCalcParserTest.cpp
diff --git a/Source/core/css/parser/SizesCalcParserTest.cpp b/Source/core/css/parser/SizesCalcParserTest.cpp
index cefcc31a9fffa64d2d5685e69ec83ff2a477f4fd..a83c7bf457bb75edcd4fcbadcfca0356574a3127 100644
--- a/Source/core/css/parser/SizesCalcParserTest.cpp
+++ b/Source/core/css/parser/SizesCalcParserTest.cpp
@@ -29,14 +29,23 @@ static void initLengthArray(CSSLengthArray& lengthArray)
lengthArray.at(i) = 0;
}
+static void initLengthTypeArray(CSSLengthTypeArray& lengthTypeArray)
+{
+ lengthTypeArray.resize(CSSPrimitiveValue::LengthUnitTypeCount);
+ for (size_t i = 0; i < CSSPrimitiveValue::LengthUnitTypeCount; ++i)
+ lengthTypeArray.clear(i);
+}
+
static void verifyCSSCalc(String text, double value, bool valid, unsigned fontSize, unsigned viewportWidth, unsigned viewportHeight)
{
CSSLengthArray lengthArray;
initLengthArray(lengthArray);
+ CSSLengthTypeArray lengthTypeArray;
+ initLengthTypeArray(lengthTypeArray);
RefPtrWillBeRawPtr<CSSValue> cssValue = CSSParser::parseSingleValue(CSSPropertyLeft, text);
CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(cssValue.get());
if (primitiveValue)
- primitiveValue->accumulateLengthArray(lengthArray);
+ primitiveValue->accumulateLengthArray(lengthArray, lengthTypeArray);
samli 2014/12/22 03:38:05 Not actually used here, so we can remove it if we
evemj (not active) 2014/12/22 06:09:06 Done.
else
ASSERT_EQ(valid, false);
float length = lengthArray.at(CSSPrimitiveValue::UnitTypePixels);
« Source/core/css/CSSPrimitiveValue.h ('K') | « Source/core/css/CSSPrimitiveValue.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698