Chromium Code Reviews| 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()) |
|
dstockwell
2014/02/27 09:49:36
Body should stay in cpp.
I think this would work
shans
2014/02/27 20:39:33
Body can't remain in cpp. This is the joy, the won
alancutter (OOO until 2018)
2014/02/28 00:40:22
AFAICT this is the same as using a default paramet
dstockwell
2014/02/28 00:56:37
The result is the same, but it's more readable.
alancutter (OOO until 2018)
2014/03/03 05:09:45
Done.
|
| + { |
| + ASSERT(RuntimeEnabledFeatures::webAnimationsAPIEnabled()); |
| + RefPtr<Animation> animation = Animation::create(&element, effect, timing); |
| + element.document().timeline().play(animation.get()); |
| + return animation.get(); |
| + } |
| }; |
| } // namespace WebCore |