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

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

Issue 182063005: Web Animations API: Refactor IDL input conversion out of Animation (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Remove templates Created 6 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/ElementAnimation.h
diff --git a/Source/core/animation/ElementAnimation.h b/Source/core/animation/ElementAnimation.h
index a27a0f34f453880028b8c8a2a8b968438f7bfa9c..c2c0a0689cb5c882626204e0a7710c04aa7366fc 100644
--- a/Source/core/animation/ElementAnimation.h
+++ b/Source/core/animation/ElementAnimation.h
@@ -31,19 +31,57 @@
#ifndef ElementAnimation_h
#define ElementAnimation_h
-#include "wtf/Vector.h"
+#include "RuntimeEnabledFeatures.h"
+#include "core/animation/Animation.h"
+#include "core/animation/DocumentTimeline.h"
+#include "core/animation/EffectInput.h"
+#include "core/animation/TimingInput.h"
+#include "core/dom/Element.h"
namespace WebCore {
-class Animation;
class Dictionary;
-class Element;
class ElementAnimation {
public:
- static Animation* animate(Element&, Vector<Dictionary> keyframesDictionaryVector, Dictionary timingInput);
- static Animation* animate(Element&, Vector<Dictionary> keyframesDictionaryVector, double timingInput);
- static Animation* animate(Element&, Vector<Dictionary> keyframesDictionaryVector);
+ static Animation* animate(Element& element, PassRefPtrWillBeRawPtr<AnimationEffect> effect, const Dictionary& timingInputDictionary)
+ {
+ return animateImpl(element, effect, TimingInput::convert(timingInputDictionary));
+ }
+
+ static Animation* animate(Element& element, PassRefPtrWillBeRawPtr<AnimationEffect> effect, double duration)
+ {
+ return animateImpl(element, effect, TimingInput::convert(duration));
+ }
+
+ static Animation* animate(Element& element, PassRefPtrWillBeRawPtr<AnimationEffect> effect)
+ {
+ return animateImpl(element, effect, TimingInput::convert());
+ }
+
+ static Animation* animate(Element& element, Vector<Dictionary> keyframeDictionaryVector, const Dictionary& timingInputDictionary)
+ {
+ return animateImpl(element, EffectInput::convert(&element, keyframeDictionaryVector), TimingInput::convert(timingInputDictionary));
+ }
+
+ static Animation* animate(Element& element, Vector<Dictionary> keyframeDictionaryVector, double duration)
+ {
+ return animateImpl(element, EffectInput::convert(&element, keyframeDictionaryVector), TimingInput::convert(duration));
+ }
+
+ static Animation* animate(Element& element, Vector<Dictionary> keyframeDictionaryVector)
+ {
+ return animateImpl(element, EffectInput::convert(&element, keyframeDictionaryVector), TimingInput::convert());
+ }
+
+private:
+ static Animation* animateImpl(Element& element, PassRefPtrWillBeRawPtr<AnimationEffect> effect, Timing timing)
esprehn 2014/03/04 00:59:42 animateInternal?
alancutter (OOO until 2018) 2014/03/04 01:21:41 Done.
+ {
+ ASSERT(RuntimeEnabledFeatures::webAnimationsAPIEnabled());
+ RefPtr<Animation> animation = Animation::create(&element, effect, timing);
+ element.document().timeline().play(animation.get());
+ return animation.get();
+ }
};
} // namespace WebCore

Powered by Google App Engine
This is Rietveld 408576698