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

Unified Diff: Source/core/animation/StringKeyframe.cpp

Issue 273683005: Web Animations API: Deferred computation of interpolated values (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 7 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
« no previous file with comments | « Source/core/animation/StringKeyframe.h ('k') | Source/core/animation/css/CSSAnimations.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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:
alancutter (OOO until 2018) 2014/05/08 12:34:13 The border width properties can change value accor
+ 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);
}
« no previous file with comments | « Source/core/animation/StringKeyframe.h ('k') | Source/core/animation/css/CSSAnimations.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698