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

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: Add missing test file 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..43fc83f032aee71e017b985cb625ad49132325a3 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,13 @@ 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);
-
- RefPtrWillBeRawPtr<AnimatableValue> to = StyleResolver::createAnimatableValueSnapshot(*element, property, toCSSValue);
- toStringPropertySpecificKeyframe(end)->m_animatableValueCache = to;
+ if (!m_animatableValueCache && !LegacyStyleInterpolation::interpolationRequiresStyleResolve(*fromCSSValue))
+ m_animatableValueCache = StyleResolver::applyAndSnapshotAnimatableValue(*element, property, *fromCSSValue);
+ StringPropertySpecificKeyframe& endKeyframe = toStringPropertySpecificKeyframe(*end);
+ if (!endKeyframe.m_animatableValueCache && !LegacyStyleInterpolation::interpolationRequiresStyleResolve(*toCSSValue))
+ endKeyframe.m_animatableValueCache = StyleResolver::applyAndSnapshotAnimatableValue(*element, property, *toCSSValue);
- return LegacyStyleInterpolation::create(m_animatableValueCache.get(), to.release(), property);
+ return LegacyStyleInterpolation::create(*fromCSSValue, *toCSSValue, property, *element);
}
PassOwnPtrWillBeRawPtr<Keyframe::PropertySpecificKeyframe> StringKeyframe::PropertySpecificKeyframe::neutralKeyframe(double offset, PassRefPtr<TimingFunction> easing) const
« 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