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

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

Issue 1326443003: Web Animations: Enable additive animations in experimental (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Update missed tests Created 5 years, 3 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/EffectInput.h ('k') | Source/core/animation/ElementAnimation.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/animation/EffectInput.cpp
diff --git a/Source/core/animation/EffectInput.cpp b/Source/core/animation/EffectInput.cpp
index 89a3d6034f14f7d1b917abcb4e3d436ae8f3799e..2a73456ee375947ee390dc1487767417e641ebf0 100644
--- a/Source/core/animation/EffectInput.cpp
+++ b/Source/core/animation/EffectInput.cpp
@@ -241,6 +241,7 @@ EffectModel* EffectInput::convert(Element* element, const Vector<Dictionary>& ke
DictionaryHelper::get(keyframeDictionary, "composite", compositeString);
if (compositeString == "add")
keyframe->setComposite(EffectModel::CompositeAdd);
+ // TODO(alancutter): Support "accumulate" keyframe composition.
String timingFunctionString;
if (DictionaryHelper::get(keyframeDictionary, "easing", timingFunctionString)) {
@@ -277,25 +278,32 @@ EffectModel* EffectInput::convert(Element* element, const Vector<Dictionary>& ke
}
StringKeyframeEffectModel* keyframeEffectModel = StringKeyframeEffectModel::create(keyframes);
- if (keyframeEffectModel->hasSyntheticKeyframes()) {
- exceptionState.throwDOMException(NotSupportedError, "Partial keyframes are not supported.");
- return nullptr;
- }
- if (!keyframeEffectModel->isReplaceOnly()) {
- exceptionState.throwDOMException(NotSupportedError, "Additive animations are not supported.");
- return nullptr;
+ if (!RuntimeEnabledFeatures::additiveAnimationsEnabled()) {
+ if (keyframeEffectModel->hasSyntheticKeyframes()) {
+ exceptionState.throwDOMException(NotSupportedError, "Partial keyframes are not supported.");
+ return nullptr;
+ }
+ if (!keyframeEffectModel->isReplaceOnly()) {
+ exceptionState.throwDOMException(NotSupportedError, "Additive animations are not supported.");
+ return nullptr;
+ }
}
keyframeEffectModel->forceConversionsToAnimatableValues(*element, element->computedStyle());
return keyframeEffectModel;
}
-EffectModel* EffectInput::convert(Element* element, const EffectModelOrDictionarySequence& effectInput, ExceptionState& exceptionState)
+EffectModel* EffectInput::convert(Element* element, const EffectModelOrDictionarySequenceOrDictionary& effectInput, ExceptionState& exceptionState)
{
if (effectInput.isEffectModel())
return effectInput.getAsEffectModel();
if (effectInput.isDictionarySequence())
return convert(element, effectInput.getAsDictionarySequence(), exceptionState);
+ if (effectInput.isDictionary()) {
+ Vector<Dictionary> keyframes;
+ keyframes.append(effectInput.getAsDictionary());
+ return convert(element, keyframes, exceptionState);
+ }
return nullptr;
}
« no previous file with comments | « Source/core/animation/EffectInput.h ('k') | Source/core/animation/ElementAnimation.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698