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

Unified Diff: third_party/WebKit/Source/core/animation/SVGLengthInterpolationType.cpp

Issue 2097383002: Added support of calc() for SVGLength (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nits Created 4 years, 5 months 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: third_party/WebKit/Source/core/animation/SVGLengthInterpolationType.cpp
diff --git a/third_party/WebKit/Source/core/animation/SVGLengthInterpolationType.cpp b/third_party/WebKit/Source/core/animation/SVGLengthInterpolationType.cpp
index 29b6bf2e67ec83eb4032dca12989053576860714..b870c60f80302cfbee3cbb0058823d95f4da8048 100644
--- a/third_party/WebKit/Source/core/animation/SVGLengthInterpolationType.cpp
+++ b/third_party/WebKit/Source/core/animation/SVGLengthInterpolationType.cpp
@@ -103,11 +103,18 @@ std::unique_ptr<InterpolableValue> SVGLengthInterpolationType::neutralInterpolab
InterpolationValue SVGLengthInterpolationType::convertSVGLength(const SVGLength& length)
{
- double value = length.valueInSpecifiedUnits();
- LengthInterpolatedUnit unitType = convertToInterpolatedUnit(length.typeWithCalcResolved(), value);
+ const CSSPrimitiveValue* primitiveValue = length.asCSSPrimitiveValue();
+
+ CSSLengthArray lengthArray;
+ primitiveValue->accumulateLengthArray(lengthArray);
double values[numLengthInterpolatedUnits] = { };
- values[unitType] = value;
+
+ for (size_t i = 0; i < CSSPrimitiveValue::LengthUnitTypeCount; i++) {
+ double value = lengthArray.values[i];
+ LengthInterpolatedUnit unitType = convertToInterpolatedUnit(SVGLength::toUnitType(i), value);
fs 2016/07/16 21:13:02 Couldn't we take this opportunity to transition to
Shanmuga Pandi 2016/07/18 13:35:32 That's good thought.. :) Done!!
fs 2016/07/18 13:56:48 Looks great, thanks!
+ values[unitType] = value;
+ }
std::unique_ptr<InterpolableList> listOfValues = InterpolableList::create(numLengthInterpolatedUnits);
for (size_t i = 0; i < numLengthInterpolatedUnits; ++i)

Powered by Google App Engine
This is Rietveld 408576698