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

Side by Side Diff: Source/core/animation/Animation.cpp

Issue 190763007: [WIP] Web Animations API: Constructing an Animation from partial keyframes throws a JS exception (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Replace manual checks with check for dependsOnUnderlyingValue Created 6 years, 9 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
« no previous file with comments | « Source/core/animation/Animation.h ('k') | Source/core/animation/Animation.idl » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 14 matching lines...) Expand all
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 #include "config.h" 31 #include "config.h"
32 #include "core/animation/Animation.h" 32 #include "core/animation/Animation.h"
33 33
34 #include "bindings/v8/Dictionary.h" 34 #include "bindings/v8/Dictionary.h"
35 #include "bindings/v8/ExceptionState.h"
35 #include "core/animation/ActiveAnimations.h" 36 #include "core/animation/ActiveAnimations.h"
36 #include "core/animation/AnimationHelpers.h" 37 #include "core/animation/AnimationHelpers.h"
37 #include "core/animation/CompositorAnimations.h" 38 #include "core/animation/CompositorAnimations.h"
38 #include "core/animation/DocumentTimeline.h" 39 #include "core/animation/DocumentTimeline.h"
39 #include "core/animation/KeyframeEffectModel.h" 40 #include "core/animation/KeyframeEffectModel.h"
40 #include "core/animation/Player.h" 41 #include "core/animation/Player.h"
41 #include "core/dom/Element.h" 42 #include "core/dom/Element.h"
42 #include "core/rendering/RenderLayer.h" 43 #include "core/rendering/RenderLayer.h"
43 44
44 namespace WebCore { 45 namespace WebCore {
(...skipping 11 matching lines...) Expand all
56 PassRefPtr<Animation> Animation::create(Element* element, PassRefPtrWillBeRawPtr <AnimationEffect> effect, double duration) 57 PassRefPtr<Animation> Animation::create(Element* element, PassRefPtrWillBeRawPtr <AnimationEffect> effect, double duration)
57 { 58 {
58 ASSERT(RuntimeEnabledFeatures::webAnimationsAPIEnabled()); 59 ASSERT(RuntimeEnabledFeatures::webAnimationsAPIEnabled());
59 return create(element, effect, TimingInput::convert(duration)); 60 return create(element, effect, TimingInput::convert(duration));
60 } 61 }
61 PassRefPtr<Animation> Animation::create(Element* element, PassRefPtrWillBeRawPtr <AnimationEffect> effect) 62 PassRefPtr<Animation> Animation::create(Element* element, PassRefPtrWillBeRawPtr <AnimationEffect> effect)
62 { 63 {
63 ASSERT(RuntimeEnabledFeatures::webAnimationsAPIEnabled()); 64 ASSERT(RuntimeEnabledFeatures::webAnimationsAPIEnabled());
64 return create(element, effect, Timing()); 65 return create(element, effect, Timing());
65 } 66 }
66 PassRefPtr<Animation> Animation::create(Element* element, const Vector<Dictionar y>& keyframeDictionaryVector, const Dictionary& timingInputDictionary) 67 PassRefPtr<Animation> Animation::create(Element* element, const Vector<Dictionar y>& keyframeDictionaryVector, const Dictionary& timingInputDictionary, Exception State& exceptionState)
67 { 68 {
68 ASSERT(RuntimeEnabledFeatures::webAnimationsAPIEnabled()); 69 ASSERT(RuntimeEnabledFeatures::webAnimationsAPIEnabled());
69 return create(element, EffectInput::convert(element, keyframeDictionaryVecto r), TimingInput::convert(timingInputDictionary)); 70 return create(element, EffectInput::convert(element, keyframeDictionaryVecto r, exceptionState), TimingInput::convert(timingInputDictionary));
70 } 71 }
71 PassRefPtr<Animation> Animation::create(Element* element, const Vector<Dictionar y>& keyframeDictionaryVector, double duration) 72 PassRefPtr<Animation> Animation::create(Element* element, const Vector<Dictionar y>& keyframeDictionaryVector, double duration, ExceptionState& exceptionState)
72 { 73 {
73 ASSERT(RuntimeEnabledFeatures::webAnimationsAPIEnabled()); 74 ASSERT(RuntimeEnabledFeatures::webAnimationsAPIEnabled());
74 return create(element, EffectInput::convert(element, keyframeDictionaryVecto r), TimingInput::convert(duration)); 75 return create(element, EffectInput::convert(element, keyframeDictionaryVecto r, exceptionState), TimingInput::convert(duration));
75 } 76 }
76 PassRefPtr<Animation> Animation::create(Element* element, const Vector<Dictionar y>& keyframeDictionaryVector) 77 PassRefPtr<Animation> Animation::create(Element* element, const Vector<Dictionar y>& keyframeDictionaryVector, ExceptionState& exceptionState)
77 { 78 {
78 ASSERT(RuntimeEnabledFeatures::webAnimationsAPIEnabled()); 79 ASSERT(RuntimeEnabledFeatures::webAnimationsAPIEnabled());
79 return create(element, EffectInput::convert(element, keyframeDictionaryVecto r), Timing()); 80 return create(element, EffectInput::convert(element, keyframeDictionaryVecto r, exceptionState), Timing());
80 } 81 }
81 82
82 Animation::Animation(PassRefPtr<Element> target, PassRefPtrWillBeRawPtr<Animatio nEffect> effect, const Timing& timing, Priority priority, PassOwnPtr<EventDelega te> eventDelegate) 83 Animation::Animation(PassRefPtr<Element> target, PassRefPtrWillBeRawPtr<Animatio nEffect> effect, const Timing& timing, Priority priority, PassOwnPtr<EventDelega te> eventDelegate)
83 : TimedItem(timing, eventDelegate) 84 : TimedItem(timing, eventDelegate)
84 , m_target(target) 85 , m_target(target)
85 , m_effect(effect) 86 , m_effect(effect)
86 , m_activeInAnimationStack(false) 87 , m_activeInAnimationStack(false)
87 , m_priority(priority) 88 , m_priority(priority)
88 { 89 {
89 } 90 }
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 void Animation::pauseAnimationForTestingOnCompositor(double pauseTime) 241 void Animation::pauseAnimationForTestingOnCompositor(double pauseTime)
241 { 242 {
242 ASSERT(hasActiveAnimationsOnCompositor()); 243 ASSERT(hasActiveAnimationsOnCompositor());
243 if (!m_target || !m_target->renderer()) 244 if (!m_target || !m_target->renderer())
244 return; 245 return;
245 for (size_t i = 0; i < m_compositorAnimationIds.size(); ++i) 246 for (size_t i = 0; i < m_compositorAnimationIds.size(); ++i)
246 CompositorAnimations::instance()->pauseAnimationForTestingOnCompositor(* m_target.get(), m_compositorAnimationIds[i], pauseTime); 247 CompositorAnimations::instance()->pauseAnimationForTestingOnCompositor(* m_target.get(), m_compositorAnimationIds[i], pauseTime);
247 } 248 }
248 249
249 } // namespace WebCore 250 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/animation/Animation.h ('k') | Source/core/animation/Animation.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698