OLD | NEW |
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 Loading... |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |