| 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/AnimationPlayer.h" | 38 #include "core/animation/AnimationPlayer.h" |
| 38 #include "core/animation/CompositorAnimations.h" | 39 #include "core/animation/CompositorAnimations.h" |
| 39 #include "core/animation/DocumentTimeline.h" | 40 #include "core/animation/DocumentTimeline.h" |
| 40 #include "core/animation/Interpolation.h" | 41 #include "core/animation/Interpolation.h" |
| 41 #include "core/animation/KeyframeEffectModel.h" | 42 #include "core/animation/KeyframeEffectModel.h" |
| 42 #include "core/dom/Element.h" | 43 #include "core/dom/Element.h" |
| 43 #include "core/rendering/RenderLayer.h" | 44 #include "core/rendering/RenderLayer.h" |
| 44 | 45 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 57 PassRefPtr<Animation> Animation::create(Element* element, PassRefPtrWillBeRawPtr
<AnimationEffect> effect, double duration) | 58 PassRefPtr<Animation> Animation::create(Element* element, PassRefPtrWillBeRawPtr
<AnimationEffect> effect, double duration) |
| 58 { | 59 { |
| 59 ASSERT(RuntimeEnabledFeatures::webAnimationsAPIEnabled()); | 60 ASSERT(RuntimeEnabledFeatures::webAnimationsAPIEnabled()); |
| 60 return create(element, effect, TimingInput::convert(duration)); | 61 return create(element, effect, TimingInput::convert(duration)); |
| 61 } | 62 } |
| 62 PassRefPtr<Animation> Animation::create(Element* element, PassRefPtrWillBeRawPtr
<AnimationEffect> effect) | 63 PassRefPtr<Animation> Animation::create(Element* element, PassRefPtrWillBeRawPtr
<AnimationEffect> effect) |
| 63 { | 64 { |
| 64 ASSERT(RuntimeEnabledFeatures::webAnimationsAPIEnabled()); | 65 ASSERT(RuntimeEnabledFeatures::webAnimationsAPIEnabled()); |
| 65 return create(element, effect, Timing()); | 66 return create(element, effect, Timing()); |
| 66 } | 67 } |
| 67 PassRefPtr<Animation> Animation::create(Element* element, const Vector<Dictionar
y>& keyframeDictionaryVector, const Dictionary& timingInputDictionary) | 68 PassRefPtr<Animation> Animation::create(Element* element, const Vector<Dictionar
y>& keyframeDictionaryVector, const Dictionary& timingInputDictionary, Exception
State& exceptionState) |
| 68 { | 69 { |
| 69 ASSERT(RuntimeEnabledFeatures::webAnimationsAPIEnabled()); | 70 ASSERT(RuntimeEnabledFeatures::webAnimationsAPIEnabled()); |
| 70 return create(element, EffectInput::convert(element, keyframeDictionaryVecto
r), TimingInput::convert(timingInputDictionary)); | 71 return create(element, EffectInput::convert(element, keyframeDictionaryVecto
r, exceptionState), TimingInput::convert(timingInputDictionary)); |
| 71 } | 72 } |
| 72 PassRefPtr<Animation> Animation::create(Element* element, const Vector<Dictionar
y>& keyframeDictionaryVector, double duration) | 73 PassRefPtr<Animation> Animation::create(Element* element, const Vector<Dictionar
y>& keyframeDictionaryVector, double duration, ExceptionState& exceptionState) |
| 73 { | 74 { |
| 74 ASSERT(RuntimeEnabledFeatures::webAnimationsAPIEnabled()); | 75 ASSERT(RuntimeEnabledFeatures::webAnimationsAPIEnabled()); |
| 75 return create(element, EffectInput::convert(element, keyframeDictionaryVecto
r), TimingInput::convert(duration)); | 76 return create(element, EffectInput::convert(element, keyframeDictionaryVecto
r, exceptionState), TimingInput::convert(duration)); |
| 76 } | 77 } |
| 77 PassRefPtr<Animation> Animation::create(Element* element, const Vector<Dictionar
y>& keyframeDictionaryVector) | 78 PassRefPtr<Animation> Animation::create(Element* element, const Vector<Dictionar
y>& keyframeDictionaryVector, ExceptionState& exceptionState) |
| 78 { | 79 { |
| 79 ASSERT(RuntimeEnabledFeatures::webAnimationsAPIEnabled()); | 80 ASSERT(RuntimeEnabledFeatures::webAnimationsAPIEnabled()); |
| 80 return create(element, EffectInput::convert(element, keyframeDictionaryVecto
r), Timing()); | 81 return create(element, EffectInput::convert(element, keyframeDictionaryVecto
r, exceptionState), Timing()); |
| 81 } | 82 } |
| 82 | 83 |
| 83 Animation::Animation(PassRefPtr<Element> target, PassRefPtrWillBeRawPtr<Animatio
nEffect> effect, const Timing& timing, Priority priority, PassOwnPtr<EventDelega
te> eventDelegate) | 84 Animation::Animation(PassRefPtr<Element> target, PassRefPtrWillBeRawPtr<Animatio
nEffect> effect, const Timing& timing, Priority priority, PassOwnPtr<EventDelega
te> eventDelegate) |
| 84 : TimedItem(timing, eventDelegate) | 85 : TimedItem(timing, eventDelegate) |
| 85 , m_target(target) | 86 , m_target(target) |
| 86 , m_effect(effect) | 87 , m_effect(effect) |
| 87 , m_activeInAnimationStack(false) | 88 , m_activeInAnimationStack(false) |
| 88 , m_priority(priority) | 89 , m_priority(priority) |
| 89 { | 90 { |
| 90 } | 91 } |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 void Animation::pauseAnimationForTestingOnCompositor(double pauseTime) | 242 void Animation::pauseAnimationForTestingOnCompositor(double pauseTime) |
| 242 { | 243 { |
| 243 ASSERT(hasActiveAnimationsOnCompositor()); | 244 ASSERT(hasActiveAnimationsOnCompositor()); |
| 244 if (!m_target || !m_target->renderer()) | 245 if (!m_target || !m_target->renderer()) |
| 245 return; | 246 return; |
| 246 for (size_t i = 0; i < m_compositorAnimationIds.size(); ++i) | 247 for (size_t i = 0; i < m_compositorAnimationIds.size(); ++i) |
| 247 CompositorAnimations::instance()->pauseAnimationForTestingOnCompositor(*
m_target.get(), m_compositorAnimationIds[i], pauseTime); | 248 CompositorAnimations::instance()->pauseAnimationForTestingOnCompositor(*
m_target.get(), m_compositorAnimationIds[i], pauseTime); |
| 248 } | 249 } |
| 249 | 250 |
| 250 } // namespace WebCore | 251 } // namespace WebCore |
| OLD | NEW |