| Index: Source/core/animation/Interpolation.cpp
|
| diff --git a/Source/core/animation/Interpolation.cpp b/Source/core/animation/Interpolation.cpp
|
| index 1738b817f533f9a98d670160a2a91f1ae70aaa9c..4284c83327978840ad8869c6cd50e38bdd1404de 100644
|
| --- a/Source/core/animation/Interpolation.cpp
|
| +++ b/Source/core/animation/Interpolation.cpp
|
| @@ -136,7 +136,7 @@ static PassRefPtrWillBeRawPtr<CSSCalcExpressionNode> constructCalcExpression(Pas
|
|
|
| }
|
|
|
| -PassRefPtrWillBeRawPtr<CSSValue> LengthStyleInterpolation::interpolableValueToLength(InterpolableValue* value)
|
| +PassRefPtrWillBeRawPtr<CSSValue> LengthStyleInterpolation::interpolableValueToLength(InterpolableValue* value, ValueRange range)
|
| {
|
| InterpolableList* listValue = toInterpolableList(value);
|
| unsigned unitCount = 0;
|
| @@ -153,18 +153,22 @@ PassRefPtrWillBeRawPtr<CSSValue> LengthStyleInterpolation::interpolableValueToLe
|
| case 1:
|
| for (size_t i = 0; i < CSSPrimitiveValue::LengthUnitTypeCount; i++) {
|
| const InterpolableNumber* subValue = toInterpolableNumber(listValue->get(i));
|
| - if (subValue->value()) {
|
| - return CSSPrimitiveValue::create(subValue->value(), toUnitType(i));
|
| + double value = subValue->value();
|
| + if (value) {
|
| + if (range == ValueRangeNonNegative && value < 0)
|
| + value = 0;
|
| + return CSSPrimitiveValue::create(value, toUnitType(i));
|
| }
|
| }
|
| + ASSERT_NOT_REACHED();
|
| default:
|
| - return CSSPrimitiveValue::create(CSSCalcValue::create(constructCalcExpression(nullptr, listValue, 0)));
|
| + return CSSPrimitiveValue::create(CSSCalcValue::create(constructCalcExpression(nullptr, listValue, 0), range));
|
| }
|
| }
|
|
|
| void LengthStyleInterpolation::apply(StyleResolverState& state) const
|
| {
|
| - StyleBuilder::applyProperty(m_id, state, interpolableValueToLength(m_cachedValue.get()).get());
|
| + StyleBuilder::applyProperty(m_id, state, interpolableValueToLength(m_cachedValue.get(), m_range).get());
|
| }
|
|
|
| void LengthStyleInterpolation::trace(Visitor* visitor)
|
|
|