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

Unified Diff: Source/core/animation/ElementAnimation.h

Issue 254423004: Web Animations API: Element.animate should accept a null effect (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 8 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/AnimationEffect.idl ('k') | Source/core/animation/ElementAnimation.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/animation/ElementAnimation.h
diff --git a/Source/core/animation/ElementAnimation.h b/Source/core/animation/ElementAnimation.h
index 52a099eb61eef231df5d0a7127373b58b4329965..da1500551d3edf3d75513bb9c32b2a3e8dacabc5 100644
--- a/Source/core/animation/ElementAnimation.h
+++ b/Source/core/animation/ElementAnimation.h
@@ -61,17 +61,29 @@ public:
static AnimationPlayer* animate(Element& element, const Vector<Dictionary>& keyframeDictionaryVector, const Dictionary& timingInputDictionary, ExceptionState& exceptionState)
{
- return animateInternal(element, EffectInput::convert(&element, keyframeDictionaryVector, exceptionState), TimingInput::convert(timingInputDictionary));
+ RefPtrWillBeRawPtr<AnimationEffect> effect = EffectInput::convert(&element, keyframeDictionaryVector, exceptionState);
+ if (exceptionState.hadException())
+ return 0;
+ ASSERT(effect);
+ return animateInternal(element, effect.release(), TimingInput::convert(timingInputDictionary));
}
static AnimationPlayer* animate(Element& element, const Vector<Dictionary>& keyframeDictionaryVector, double duration, ExceptionState& exceptionState)
{
- return animateInternal(element, EffectInput::convert(&element, keyframeDictionaryVector, exceptionState), TimingInput::convert(duration));
+ RefPtrWillBeRawPtr<AnimationEffect> effect = EffectInput::convert(&element, keyframeDictionaryVector, exceptionState);
+ if (exceptionState.hadException())
+ return 0;
+ ASSERT(effect);
+ return animateInternal(element, effect.release(), TimingInput::convert(duration));
}
static AnimationPlayer* animate(Element& element, const Vector<Dictionary>& keyframeDictionaryVector, ExceptionState& exceptionState)
{
- return animateInternal(element, EffectInput::convert(&element, keyframeDictionaryVector, exceptionState), Timing());
+ RefPtrWillBeRawPtr<AnimationEffect> effect = EffectInput::convert(&element, keyframeDictionaryVector, exceptionState);
+ if (exceptionState.hadException())
+ return 0;
+ ASSERT(effect);
+ return animateInternal(element, effect.release(), Timing());
}
private:
« no previous file with comments | « Source/core/animation/AnimationEffect.idl ('k') | Source/core/animation/ElementAnimation.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698