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

Unified Diff: third_party/WebKit/Source/core/animation/KeyframeEffect.cpp

Issue 2814523002: Web Animations: Coalesce constructors where possible. (Closed)
Patch Set: Rebase Created 3 years, 8 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: third_party/WebKit/Source/core/animation/KeyframeEffect.cpp
diff --git a/third_party/WebKit/Source/core/animation/KeyframeEffect.cpp b/third_party/WebKit/Source/core/animation/KeyframeEffect.cpp
index 20fa6dfb024aa993ac5047f823d2a41122077df0..646e25fe0c1b596f2c09e0867ed30bbed68f2175 100644
--- a/third_party/WebKit/Source/core/animation/KeyframeEffect.cpp
+++ b/third_party/WebKit/Source/core/animation/KeyframeEffect.cpp
@@ -32,6 +32,7 @@
#include "bindings/core/v8/Dictionary.h"
#include "bindings/core/v8/ExceptionState.h"
+#include "bindings/core/v8/UnrestrictedDoubleOrKeyframeEffectOptions.h"
#include "core/animation/AnimationEffectTiming.h"
#include "core/animation/EffectInput.h"
#include "core/animation/KeyframeEffectOptions.h"
@@ -55,28 +56,7 @@ KeyframeEffect* KeyframeEffect::Create(
ExecutionContext* execution_context,
Element* element,
const DictionarySequenceOrDictionary& effect_input,
- double duration,
- ExceptionState& exception_state) {
- DCHECK(RuntimeEnabledFeatures::webAnimationsAPIEnabled());
- if (element) {
- UseCounter::Count(
- element->GetDocument(),
- UseCounter::kAnimationConstructorKeyframeListEffectObjectTiming);
- }
- Timing timing;
- if (!TimingInput::Convert(duration, timing, exception_state))
- return nullptr;
- return Create(element,
- EffectInput::Convert(element, effect_input, execution_context,
- exception_state),
- timing);
-}
-
-KeyframeEffect* KeyframeEffect::Create(
- ExecutionContext* execution_context,
- Element* element,
- const DictionarySequenceOrDictionary& effect_input,
- const KeyframeEffectOptions& timing_input,
+ const UnrestrictedDoubleOrKeyframeEffectOptions& options,
ExceptionState& exception_state) {
DCHECK(RuntimeEnabledFeatures::webAnimationsAPIEnabled());
if (element) {
@@ -86,7 +66,7 @@ KeyframeEffect* KeyframeEffect::Create(
}
Timing timing;
Document* document = element ? &element->GetDocument() : nullptr;
- if (!TimingInput::Convert(timing_input, timing, document, exception_state))
+ if (!TimingInput::Convert(options, timing, document, exception_state))
return nullptr;
return Create(element,
EffectInput::Convert(element, effect_input, execution_context,
« no previous file with comments | « third_party/WebKit/Source/core/animation/KeyframeEffect.h ('k') | third_party/WebKit/Source/core/animation/KeyframeEffect.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698