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 |