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

Unified Diff: third_party/WebKit/Source/core/animation/ElementAnimation.h

Issue 1906463002: Web Animations: Throw TypeErrors for invalid timing parameters (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix unit tests Created 4 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/ElementAnimation.h
diff --git a/third_party/WebKit/Source/core/animation/ElementAnimation.h b/third_party/WebKit/Source/core/animation/ElementAnimation.h
index b1375fdc52a4582cff02acad53a5002eeb9f3fa3..1ac4ecc72d18946078d2ec5184a6fe2ab582a6c3 100644
--- a/third_party/WebKit/Source/core/animation/ElementAnimation.h
+++ b/third_party/WebKit/Source/core/animation/ElementAnimation.h
@@ -54,17 +54,24 @@ public:
{
EffectModel* effect = EffectInput::convert(&element, effectInput, executionContext, exceptionState);
if (exceptionState.hadException())
- return 0;
- return animateInternal(element, effect, TimingInput::convert(duration));
+ return nullptr;
+
+ Timing timing;
+ if (!TimingInput::convert(duration, timing, exceptionState))
+ return nullptr;
+
+ return animateInternal(element, effect, timing);
}
static Animation* animate(ExecutionContext* executionContext, Element& element, const EffectModelOrDictionarySequenceOrDictionary& effectInput, const KeyframeEffectOptions& options, ExceptionState& exceptionState)
{
EffectModel* effect = EffectInput::convert(&element, effectInput, executionContext, exceptionState);
+ if (exceptionState.hadException())
+ return nullptr;
+
Timing timing;
- bool success = TimingInput::convert(options, timing, &element.document(), exceptionState);
- if (!success || exceptionState.hadException())
- return 0;
+ if (!TimingInput::convert(options, timing, &element.document(), exceptionState))
+ return nullptr;
Animation* animation = animateInternal(element, effect, timing);
animation->setId(options.id());
@@ -75,7 +82,7 @@ public:
{
EffectModel* effect = EffectInput::convert(&element, effectInput, executionContext, exceptionState);
if (exceptionState.hadException())
- return 0;
+ return nullptr;
return animateInternal(element, effect, Timing());
}

Powered by Google App Engine
This is Rietveld 408576698