| Index: Source/core/animation/StringKeyframe.cpp
|
| diff --git a/Source/core/animation/StringKeyframe.cpp b/Source/core/animation/StringKeyframe.cpp
|
| index c7124255aece91cecf5e98d473ec7efce8f881a9..1854d679a949da3d001f20ec0b150316bccb1ec3 100644
|
| --- a/Source/core/animation/StringKeyframe.cpp
|
| +++ b/Source/core/animation/StringKeyframe.cpp
|
| @@ -6,6 +6,7 @@
|
| #include "core/animation/StringKeyframe.h"
|
|
|
| #include "core/animation/Interpolation.h"
|
| +#include "core/animation/LegacyStyleInterpolation.h"
|
| #include "core/animation/css/CSSAnimations.h"
|
| #include "core/css/resolver/StyleResolver.h"
|
| #include "core/rendering/style/RenderStyle.h"
|
| @@ -71,10 +72,14 @@ PassRefPtrWillBeRawPtr<Interpolation> StringKeyframe::PropertySpecificKeyframe::
|
| return DefaultStyleInterpolation::create(fromCSSValue, toCSSValue, property);
|
|
|
| switch (property) {
|
| + case CSSPropertyBorderBottomWidth:
|
| + case CSSPropertyBorderLeftWidth:
|
| + case CSSPropertyBorderRightWidth:
|
| + case CSSPropertyBorderTopWidth:
|
| + case CSSPropertyHeight:
|
| case CSSPropertyLeft:
|
| case CSSPropertyRight:
|
| case CSSPropertyWidth:
|
| - case CSSPropertyHeight:
|
| if (LengthStyleInterpolation::canCreateFrom(*fromCSSValue) && LengthStyleInterpolation::canCreateFrom(*toCSSValue))
|
| return LengthStyleInterpolation::create(fromCSSValue, toCSSValue, property);
|
| break;
|
| @@ -84,13 +89,20 @@ PassRefPtrWillBeRawPtr<Interpolation> StringKeyframe::PropertySpecificKeyframe::
|
|
|
| // FIXME: Remove the use of AnimatableValues, RenderStyles and Elements here.
|
| // FIXME: Remove this cache
|
| - if (!m_animatableValueCache)
|
| - m_animatableValueCache = StyleResolver::createAnimatableValueSnapshot(*element, property, fromCSSValue);
|
| + if (!m_interpolableValuePromiseCache)
|
| + m_interpolableValuePromiseCache = InterpolableValuePromise::create(*element, property, fromCSSValue);
|
|
|
| - RefPtrWillBeRawPtr<AnimatableValue> to = StyleResolver::createAnimatableValueSnapshot(*element, property, toCSSValue);
|
| - toStringPropertySpecificKeyframe(end)->m_animatableValueCache = to;
|
| + RefPtrWillBeRawPtr<InterpolableValuePromise> to = InterpolableValuePromise::create(*element, property, toCSSValue);
|
| + toStringPropertySpecificKeyframe(end)->m_interpolableValuePromiseCache = to;
|
|
|
| - return LegacyStyleInterpolation::create(m_animatableValueCache.get(), to.release(), property);
|
| + return LegacyStyleInterpolation::create(m_interpolableValuePromiseCache, to.release(), property);
|
| +}
|
| +
|
| +const PassRefPtrWillBeRawPtr<AnimatableValue> StringKeyframe::PropertySpecificKeyframe::getAnimatableValue() const
|
| +{
|
| + if (m_interpolableValuePromiseCache)
|
| + return m_interpolableValuePromiseCache->extractAnimatableValue();
|
| + return nullptr;
|
| }
|
|
|
| PassOwnPtrWillBeRawPtr<Keyframe::PropertySpecificKeyframe> StringKeyframe::PropertySpecificKeyframe::neutralKeyframe(double offset, PassRefPtr<TimingFunction> easing) const
|
| @@ -101,14 +113,14 @@ PassOwnPtrWillBeRawPtr<Keyframe::PropertySpecificKeyframe> StringKeyframe::Prope
|
| PassOwnPtrWillBeRawPtr<Keyframe::PropertySpecificKeyframe> StringKeyframe::PropertySpecificKeyframe::cloneWithOffset(double offset) const
|
| {
|
| Keyframe::PropertySpecificKeyframe* theClone = new PropertySpecificKeyframe(offset, m_easing, m_value.get());
|
| - toStringPropertySpecificKeyframe(theClone)->m_animatableValueCache = m_animatableValueCache;
|
| + toStringPropertySpecificKeyframe(theClone)->m_interpolableValuePromiseCache = m_interpolableValuePromiseCache;
|
| return adoptPtrWillBeNoop(theClone);
|
| }
|
|
|
| void StringKeyframe::PropertySpecificKeyframe::trace(Visitor* visitor)
|
| {
|
| visitor->trace(m_value);
|
| - visitor->trace(m_animatableValueCache);
|
| + visitor->trace(m_interpolableValuePromiseCache);
|
| Keyframe::PropertySpecificKeyframe::trace(visitor);
|
| }
|
|
|
|
|