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

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

Issue 196053009: Web Animations API: Constructing an Animation from a partial keyframe throws a JS exception (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@SyntheticKeyframesFix
Patch Set: Created 6 years, 9 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/KeyframeEffectModel.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/animation/KeyframeEffectModel.cpp
diff --git a/Source/core/animation/KeyframeEffectModel.cpp b/Source/core/animation/KeyframeEffectModel.cpp
index 860452c01879ecefb52197031b3a2f187d688745..a5e7eea045902062da620e5c9c2115da2534efd1 100644
--- a/Source/core/animation/KeyframeEffectModel.cpp
+++ b/Source/core/animation/KeyframeEffectModel.cpp
@@ -244,24 +244,39 @@ void KeyframeEffectModel::ensureInterpolationEffect() const
}
}
+bool KeyframeEffectModel::isReplaceOnly()
+{
+ ensureKeyframeGroups();
+ for (KeyframeGroupMap::iterator iter = m_keyframeGroups->begin(); iter != m_keyframeGroups->end(); ++iter) {
+ const PropertySpecificKeyframeVector& keyframeVector = iter->value->keyframes();
+ for (size_t i = 0; i < keyframeVector.size(); ++i) {
+ if (keyframeVector[i]->composite() != AnimationEffect::CompositeReplace)
+ return false;
+ }
+ }
+ return true;
+}
+
KeyframeEffectModel::PropertySpecificKeyframe::PropertySpecificKeyframe(double offset, PassRefPtr<TimingFunction> easing, const AnimatableValue* value, CompositeOperation composite)
: m_offset(offset)
, m_easing(easing)
+ , m_composite(composite)
{
m_value = AnimatableValue::takeConstRef(value);
}
-KeyframeEffectModel::PropertySpecificKeyframe::PropertySpecificKeyframe(double offset, PassRefPtr<TimingFunction> easing, PassRefPtr<AnimatableValue> value)
+KeyframeEffectModel::PropertySpecificKeyframe::PropertySpecificKeyframe(double offset, PassRefPtr<TimingFunction> easing, PassRefPtr<AnimatableValue> value, CompositeOperation composite)
: m_offset(offset)
, m_easing(easing)
, m_value(value)
+ , m_composite(composite)
{
ASSERT(!isNull(m_offset));
}
PassOwnPtr<KeyframeEffectModel::PropertySpecificKeyframe> KeyframeEffectModel::PropertySpecificKeyframe::cloneWithOffset(double offset) const
{
- return adoptPtr(new PropertySpecificKeyframe(offset, m_easing, m_value));
+ return adoptPtr(new PropertySpecificKeyframe(offset, m_easing, m_value, m_composite));
}
« no previous file with comments | « Source/core/animation/KeyframeEffectModel.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698