Index: Source/core/animation/ElementAnimation.h |
diff --git a/Source/core/animation/ElementAnimation.h b/Source/core/animation/ElementAnimation.h |
index a27a0f34f453880028b8c8a2a8b968438f7bfa9c..549d6c9a8e1c6a2aeb089117fd3182c16cd51764 100644 |
--- a/Source/core/animation/ElementAnimation.h |
+++ b/Source/core/animation/ElementAnimation.h |
@@ -31,19 +31,23 @@ |
#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/Timing.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); |
+ template<typename E, typename T = double> |
+ static Animation* animate(Element& element, E effect, T timing = Timing::initialIterationDuration()) |
+ { |
+ ASSERT(RuntimeEnabledFeatures::webAnimationsAPIEnabled()); |
+ RefPtr<Animation> animation = Animation::create(&element, effect, timing); |
+ element.document().timeline().play(animation.get()); |
+ return animation.get(); |
+ } |
}; |
} // namespace WebCore |