Index: third_party/WebKit/Source/core/animation/Animation.cpp |
diff --git a/third_party/WebKit/Source/core/animation/Animation.cpp b/third_party/WebKit/Source/core/animation/Animation.cpp |
index 19b5e3029b9b64cf1495bc2cd1f8be67a091d3dd..a2adea9d035e0ea04a5030343f495e9319b711bf 100644 |
--- a/third_party/WebKit/Source/core/animation/Animation.cpp |
+++ b/third_party/WebKit/Source/core/animation/Animation.cpp |
@@ -32,6 +32,7 @@ |
#include "core/animation/AnimationTimeline.h" |
#include "core/animation/CompositorPendingAnimations.h" |
+#include "core/animation/DocumentTimeline.h" |
#include "core/animation/KeyframeEffectReadOnly.h" |
#include "core/animation/css/CSSAnimations.h" |
#include "core/dom/DOMNodeIds.h" |
@@ -70,6 +71,7 @@ Animation* Animation::Create(AnimationEffectReadOnly* effect, |
AnimationTimeline* timeline) { |
if (!timeline) { |
// FIXME: Support creating animations without a timeline. |
+ NOTREACHED(); |
return nullptr; |
} |
@@ -84,6 +86,28 @@ Animation* Animation::Create(AnimationEffectReadOnly* effect, |
return animation; |
} |
+Animation* Animation::Create(ExecutionContext* execution_context, |
+ AnimationEffectReadOnly* effect, |
+ ExceptionState& exception_state) { |
+ DCHECK(RuntimeEnabledFeatures::WebAnimationsAPIEnabled()); |
+ |
+ Document* document = ToDocument(execution_context); |
+ return Create(effect, &document->Timeline()); |
+} |
+ |
+Animation* Animation::Create(ExecutionContext* execution_context, |
+ AnimationEffectReadOnly* effect, |
+ AnimationTimeline* timeline, |
+ ExceptionState& exception_state) { |
+ DCHECK(RuntimeEnabledFeatures::WebAnimationsAPIEnabled()); |
+ |
+ if (!timeline) { |
+ return Create(execution_context, effect, exception_state); |
+ } |
+ |
+ return Create(effect, timeline); |
+} |
+ |
Animation::Animation(ExecutionContext* execution_context, |
AnimationTimeline& timeline, |
AnimationEffectReadOnly* content) |