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

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

Issue 851693007: Prepare for responsive CSS animations. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 5 years, 10 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
Index: Source/core/animation/StringKeyframe.cpp
diff --git a/Source/core/animation/StringKeyframe.cpp b/Source/core/animation/StringKeyframe.cpp
index f4bba26b2017d6e227e38baba5c416dd12336039..2911dc5ccf0d103b6f9e1024bb6dc02fef57f613 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/ColorStyleInterpolation.h"
+#include "core/animation/CompositorAnimations.h"
#include "core/animation/ConstantStyleInterpolation.h"
#include "core/animation/DeferredLegacyStyleInterpolation.h"
#include "core/animation/DoubleStyleInterpolation.h"
@@ -38,6 +39,13 @@ void StringKeyframe::setPropertyValue(CSSPropertyID property, const String& valu
m_propertySet->setProperty(property, value, false, styleSheetContents);
}
+void StringKeyframe::setPropertyValue(CSSPropertyID property, PassRefPtr<CSSValue> value)
+{
+ ASSERT(property != CSSPropertyInvalid);
+ ASSERT(CSSAnimations::isAllowedAnimation(property));
+ m_propertySet->setProperty(property, value, false);
+}
+
PropertySet StringKeyframe::properties() const
{
// This is not used in time-critical code, so we probably don't need to
@@ -75,6 +83,11 @@ StringKeyframe::PropertySpecificKeyframe::PropertySpecificKeyframe(double offset
ASSERT(!isNull(m_offset));
}
+void StringKeyframe::PropertySpecificKeyframe::setAnimatableValue(PassRefPtr<AnimatableValue> value)
+{
+ m_animatableValueCache = value;
+}
+
namespace {
InterpolationRange setRange(CSSPropertyID id)
{
@@ -117,6 +130,12 @@ PassRefPtrWillBeRawPtr<Interpolation> StringKeyframe::PropertySpecificKeyframe::
// FIXME: Remove this flag once we can rely on legacy's behaviour being correct.
bool forceDefaultInterpolation = false;
+ // FIXME: Remove this check once neutral keyframes are implemented in StringKeyframes.
+ if (!fromCSSValue || !toCSSValue)
+ return DeferredLegacyStyleInterpolation::create(fromCSSValue, toCSSValue, property);
+
+ ASSERT(fromCSSValue && toCSSValue);
+
if (!CSSPropertyMetadata::isAnimatableProperty(property)) {
if (fromCSSValue == toCSSValue)
return ConstantStyleInterpolation::create(fromCSSValue, property);

Powered by Google App Engine
This is Rietveld 408576698