Index: third_party/WebKit/Source/core/animation/CSSLengthInterpolationType.cpp |
diff --git a/third_party/WebKit/Source/core/animation/CSSLengthInterpolationType.cpp b/third_party/WebKit/Source/core/animation/CSSLengthInterpolationType.cpp |
index 8a97b542f2130403c2d5c14bfad8256cadeecffe..46b17a8c73c549cb68dee2155347710594bf2d1c 100644 |
--- a/third_party/WebKit/Source/core/animation/CSSLengthInterpolationType.cpp |
+++ b/third_party/WebKit/Source/core/animation/CSSLengthInterpolationType.cpp |
@@ -105,6 +105,18 @@ void CSSLengthInterpolationType::composite( |
underlyingNonInterpolableValue = CSSLengthNonInterpolableValue::merge(underlyingNonInterpolableValue.get(), nonInterpolableValue); |
} |
+void CSSLengthInterpolationType::subtractFromOneHundredPercent(InterpolationValue& result) |
+{ |
+ InterpolableList& list = toInterpolableList(*result.interpolableValue); |
+ for (size_t i = 0; i < CSSPrimitiveValue::LengthUnitTypeCount; i++) { |
+ double value = -toInterpolableNumber(*list.get(i)).value(); |
+ if (i == CSSPrimitiveValue::UnitTypePercentage) |
+ value += 100; |
+ toInterpolableNumber(*list.getMutable(i)).set(value); |
+ } |
+ result.nonInterpolableValue = CSSLengthNonInterpolableValue::create(true); |
+} |
+ |
InterpolationValue CSSLengthInterpolationType::maybeConvertCSSValue(const CSSValue& value) |
{ |
if (!value.isPrimitiveValue()) |