| Index: Source/core/animation/LengthInterpolationType.cpp
|
| diff --git a/Source/core/animation/LengthInterpolationType.cpp b/Source/core/animation/LengthInterpolationType.cpp
|
| index b623ac3d8eb0c4c100cd96d4a65a2e85e9d3177d..bc8d65ff076eb167c897e2e00354547fce99afca 100644
|
| --- a/Source/core/animation/LengthInterpolationType.cpp
|
| +++ b/Source/core/animation/LengthInterpolationType.cpp
|
| @@ -32,6 +32,11 @@ static PassOwnPtrWillBeRawPtr<InterpolableList> createNeutralValue()
|
| return listOfValuesAndTypes.release();
|
| }
|
|
|
| +float LengthInterpolationType::effectiveZoom(const ComputedStyle& style) const
|
| +{
|
| + return LengthPropertyFunctions::hasZoomedLength(m_property) ? style.effectiveZoom() : 1;
|
| +}
|
| +
|
| PassOwnPtrWillBeRawPtr<InterpolationValue> LengthInterpolationType::maybeConvertLength(const Length& length, float zoom) const
|
| {
|
| if (!length.isSpecified())
|
| @@ -45,8 +50,8 @@ PassOwnPtrWillBeRawPtr<InterpolationValue> LengthInterpolationType::maybeConvert
|
| values.set(CSSPrimitiveValue::UnitTypePercentage, InterpolableNumber::create(pixelsAndPercent.percent));
|
|
|
| InterpolableList& types = toInterpolableList(*valuesAndTypes->get(1));
|
| - types.set(CSSPrimitiveValue::UnitTypePixels, InterpolableNumber::create(1));
|
| - types.set(CSSPrimitiveValue::UnitTypePercentage, InterpolableNumber::create(1));
|
| + types.set(CSSPrimitiveValue::UnitTypePixels, InterpolableNumber::create(pixelsAndPercent.pixels != 0));
|
| + types.set(CSSPrimitiveValue::UnitTypePercentage, InterpolableNumber::create(length.hasPercent()));
|
|
|
| return InterpolationValue::create(*this, valuesAndTypes.release());
|
| }
|
| @@ -68,7 +73,7 @@ private:
|
| {
|
| Length parentLength;
|
| if (!LengthPropertyFunctions::getLength(m_property, *state.parentStyle(), parentLength))
|
| - return true;
|
| + return false;
|
| return parentLength == m_length;
|
| }
|
|
|
| @@ -102,7 +107,7 @@ PassOwnPtrWillBeRawPtr<InterpolationValue> LengthInterpolationType::maybeConvert
|
| if (!LengthPropertyFunctions::getLength(m_property, *state->parentStyle(), inheritedLength))
|
| return nullptr;
|
| conversionCheckers.append(ParentLengthChecker::create(m_property, inheritedLength));
|
| - return maybeConvertLength(inheritedLength, state->parentStyle()->effectiveZoom());
|
| + return maybeConvertLength(inheritedLength, effectiveZoom(*state->parentStyle()));
|
| }
|
|
|
| PassOwnPtrWillBeRawPtr<InterpolationValue> LengthInterpolationType::maybeConvertValue(const CSSValue& value, const StyleResolverState* state, ConversionCheckers& conversionCheckers) const
|
| @@ -151,7 +156,7 @@ PassOwnPtrWillBeRawPtr<InterpolationValue> LengthInterpolationType::maybeConvert
|
| Length underlyingLength;
|
| if (!LengthPropertyFunctions::getLength(m_property, *state.style(), underlyingLength))
|
| return nullptr;
|
| - return maybeConvertLength(underlyingLength, state.style()->effectiveZoom());
|
| + return maybeConvertLength(underlyingLength, effectiveZoom(*state.style()));
|
| }
|
|
|
| void LengthInterpolationType::apply(const InterpolableValue& interpolableValue, const NonInterpolableValue*, StyleResolverState& state) const
|
| @@ -159,8 +164,7 @@ void LengthInterpolationType::apply(const InterpolableValue& interpolableValue,
|
| // TODO(alancutter): Make all length interpolation functions operate on ValueRanges instead of InterpolationRanges.
|
| InterpolationRange range = m_valueRange == ValueRangeNonNegative ? RangeNonNegative : RangeAll;
|
| // TODO(alancutter): Set arbitrary property Lengths on ComputedStyle without using cross compilation unit member function getters (Windows runtime doesn't like it).
|
| - ASSERT(m_property == CSSPropertyLeft);
|
| - LengthStyleInterpolation::applyInterpolableValue(m_property, interpolableValue, range, state, &ComputedStyle::setLeft);
|
| + LengthStyleInterpolation::applyInterpolableValue(m_property, interpolableValue, range, state);
|
| }
|
|
|
| } // namespace blink
|
|
|