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

Side by Side Diff: third_party/WebKit/Source/core/animation/ElementAnimation.h

Issue 1851003002: Throw TypeError if easing string is invalid. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 class Dictionary; 48 class Dictionary;
49 49
50 class ElementAnimation { 50 class ElementAnimation {
51 STATIC_ONLY(ElementAnimation); 51 STATIC_ONLY(ElementAnimation);
52 public: 52 public:
53 static Animation* animate(ExecutionContext* executionContext, Element& eleme nt, const EffectModelOrDictionarySequenceOrDictionary& effectInput, double durat ion, ExceptionState& exceptionState) 53 static Animation* animate(ExecutionContext* executionContext, Element& eleme nt, const EffectModelOrDictionarySequenceOrDictionary& effectInput, double durat ion, ExceptionState& exceptionState)
54 { 54 {
55 EffectModel* effect = EffectInput::convert(&element, effectInput, execut ionContext, exceptionState); 55 EffectModel* effect = EffectInput::convert(&element, effectInput, execut ionContext, exceptionState);
56 if (exceptionState.hadException()) 56 if (exceptionState.hadException())
57 return 0; 57 return 0;
58 return animateInternal(element, effect, TimingInput::convert(duration)); 58 Timing timing;
59 ASSERT(TimingInput::convert(duration, timing));
alancutter (OOO until 2018) 2016/04/05 04:50:06 ASSERTs don't get compiled into official builds, y
suzyh_UTC10 (ex-contributor) 2016/04/12 08:04:23 Oooh, whoops. Good catch, fixed.
suzyh_UTC10 (ex-contributor) 2016/04/12 08:59:21 Hmmm, I'm getting a compile failure on chromeos_am
Timothy Loh 2016/04/12 13:21:12 DCHECK should work (previously this was called ASS
60 return animateInternal(element, effect, timing);
59 } 61 }
60 62
61 static Animation* animate(ExecutionContext* executionContext, Element& eleme nt, const EffectModelOrDictionarySequenceOrDictionary& effectInput, const Keyfra meEffectOptions& options, ExceptionState& exceptionState) 63 static Animation* animate(ExecutionContext* executionContext, Element& eleme nt, const EffectModelOrDictionarySequenceOrDictionary& effectInput, const Keyfra meEffectOptions& options, ExceptionState& exceptionState)
62 { 64 {
63 EffectModel* effect = EffectInput::convert(&element, effectInput, execut ionContext, exceptionState); 65 EffectModel* effect = EffectInput::convert(&element, effectInput, execut ionContext, exceptionState);
64 if (exceptionState.hadException()) 66 Timing timing;
67 bool success = TimingInput::convert(options, timing, exceptionState);
68 if (!success || exceptionState.hadException())
65 return 0; 69 return 0;
66 70
67 Animation* animation = animateInternal(element, effect, TimingInput::con vert(options)); 71 Animation* animation = animateInternal(element, effect, timing);
68 animation->setId(options.id()); 72 animation->setId(options.id());
69 return animation; 73 return animation;
70 } 74 }
71 75
72 static Animation* animate(ExecutionContext* executionContext, Element& eleme nt, const EffectModelOrDictionarySequenceOrDictionary& effectInput, ExceptionSta te& exceptionState) 76 static Animation* animate(ExecutionContext* executionContext, Element& eleme nt, const EffectModelOrDictionarySequenceOrDictionary& effectInput, ExceptionSta te& exceptionState)
73 { 77 {
74 EffectModel* effect = EffectInput::convert(&element, effectInput, execut ionContext, exceptionState); 78 EffectModel* effect = EffectInput::convert(&element, effectInput, execut ionContext, exceptionState);
75 if (exceptionState.hadException()) 79 if (exceptionState.hadException())
76 return 0; 80 return 0;
77 return animateInternal(element, effect, Timing()); 81 return animateInternal(element, effect, Timing());
(...skipping 18 matching lines...) Expand all
96 static Animation* animateInternal(Element& element, EffectModel* effect, con st Timing& timing) 100 static Animation* animateInternal(Element& element, EffectModel* effect, con st Timing& timing)
97 { 101 {
98 KeyframeEffect* keyframeEffect = KeyframeEffect::create(&element, effect , timing); 102 KeyframeEffect* keyframeEffect = KeyframeEffect::create(&element, effect , timing);
99 return element.document().timeline().play(keyframeEffect); 103 return element.document().timeline().play(keyframeEffect);
100 } 104 }
101 }; 105 };
102 106
103 } // namespace blink 107 } // namespace blink
104 108
105 #endif // ElementAnimation_h 109 #endif // ElementAnimation_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698