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 18 matching lines...) Expand all Loading... |
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/core/v8/Dictionary.h" | 34 #include "bindings/core/v8/Dictionary.h" |
35 #include "bindings/core/v8/ExceptionState.h" | 35 #include "bindings/core/v8/ExceptionState.h" |
36 #include "core/animation/ActiveAnimations.h" | 36 #include "core/animation/ActiveAnimations.h" |
37 #include "core/animation/AnimationPlayer.h" | 37 #include "core/animation/AnimationPlayer.h" |
38 #include "core/animation/AnimationTimeline.h" | 38 #include "core/animation/AnimationTimeline.h" |
| 39 #include "core/animation/AnimationTimingProperties.h" |
39 #include "core/animation/CompositorAnimations.h" | 40 #include "core/animation/CompositorAnimations.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/dom/NodeLayoutStyle.h" | 44 #include "core/dom/NodeLayoutStyle.h" |
44 #include "core/frame/UseCounter.h" | 45 #include "core/frame/UseCounter.h" |
45 #include "core/layout/Layer.h" | 46 #include "core/layout/Layer.h" |
46 | 47 |
47 namespace blink { | 48 namespace blink { |
48 | 49 |
49 PassRefPtrWillBeRawPtr<Animation> Animation::create(Element* target, PassRefPtrW
illBeRawPtr<AnimationEffect> effect, const Timing& timing, Priority priority, Pa
ssOwnPtrWillBeRawPtr<EventDelegate> eventDelegate) | 50 PassRefPtrWillBeRawPtr<Animation> Animation::create(Element* target, PassRefPtrW
illBeRawPtr<AnimationEffect> effect, const Timing& timing, Priority priority, Pa
ssOwnPtrWillBeRawPtr<EventDelegate> eventDelegate) |
50 { | 51 { |
51 return adoptRefWillBeNoop(new Animation(target, effect, timing, priority, ev
entDelegate)); | 52 return adoptRefWillBeNoop(new Animation(target, effect, timing, priority, ev
entDelegate)); |
52 } | 53 } |
53 | 54 |
54 PassRefPtrWillBeRawPtr<Animation> Animation::create(Element* element, PassRefPtr
WillBeRawPtr<AnimationEffect> effect, const Dictionary& timingInputDictionary) | 55 PassRefPtrWillBeRawPtr<Animation> Animation::create(Element* element, const Vect
or<Dictionary>& keyframeDictionaryVector, double duration, ExceptionState& excep
tionState) |
55 { | |
56 ASSERT(RuntimeEnabledFeatures::webAnimationsAPIEnabled()); | |
57 return create(element, effect, TimingInput::convert(timingInputDictionary)); | |
58 } | |
59 PassRefPtrWillBeRawPtr<Animation> Animation::create(Element* element, PassRefPtr
WillBeRawPtr<AnimationEffect> effect, double duration) | |
60 { | |
61 ASSERT(RuntimeEnabledFeatures::webAnimationsAPIEnabled()); | |
62 return create(element, effect, TimingInput::convert(duration)); | |
63 } | |
64 PassRefPtrWillBeRawPtr<Animation> Animation::create(Element* element, PassRefPtr
WillBeRawPtr<AnimationEffect> effect) | |
65 { | |
66 ASSERT(RuntimeEnabledFeatures::webAnimationsAPIEnabled()); | |
67 return create(element, effect, Timing()); | |
68 } | |
69 PassRefPtrWillBeRawPtr<Animation> Animation::create(Element* element, const Vect
or<Dictionary>& keyframeDictionaryVector, const Dictionary& timingInputDictionar
y, ExceptionState& exceptionState) | |
70 { | 56 { |
71 ASSERT(RuntimeEnabledFeatures::webAnimationsAPIEnabled()); | 57 ASSERT(RuntimeEnabledFeatures::webAnimationsAPIEnabled()); |
72 if (element) | 58 if (element) |
73 UseCounter::count(element->document(), UseCounter::AnimationConstructorK
eyframeListEffectObjectTiming); | 59 UseCounter::count(element->document(), UseCounter::AnimationConstructorK
eyframeListEffectObjectTiming); |
74 return create(element, EffectInput::convert(element, keyframeDictionaryVecto
r, exceptionState), TimingInput::convert(timingInputDictionary)); | 60 return create(element, EffectInput::convert(element, keyframeDictionaryVecto
r, exceptionState), TimingInput::convert(duration)); |
75 } | 61 } |
76 PassRefPtrWillBeRawPtr<Animation> Animation::create(Element* element, const Vect
or<Dictionary>& keyframeDictionaryVector, double duration, ExceptionState& excep
tionState) | 62 PassRefPtrWillBeRawPtr<Animation> Animation::create(Element* element, const Vect
or<Dictionary>& keyframeDictionaryVector, const AnimationTimingProperties& timin
gInput, ExceptionState& exceptionState) |
77 { | 63 { |
78 ASSERT(RuntimeEnabledFeatures::webAnimationsAPIEnabled()); | 64 ASSERT(RuntimeEnabledFeatures::webAnimationsAPIEnabled()); |
79 if (element) | 65 if (element) |
80 UseCounter::count(element->document(), UseCounter::AnimationConstructorK
eyframeListEffectDoubleTiming); | 66 UseCounter::count(element->document(), UseCounter::AnimationConstructorK
eyframeListEffectObjectTiming); |
81 return create(element, EffectInput::convert(element, keyframeDictionaryVecto
r, exceptionState), TimingInput::convert(duration)); | 67 return create(element, EffectInput::convert(element, keyframeDictionaryVecto
r, exceptionState), TimingInput::convert(timingInput)); |
82 } | 68 } |
83 PassRefPtrWillBeRawPtr<Animation> Animation::create(Element* element, const Vect
or<Dictionary>& keyframeDictionaryVector, ExceptionState& exceptionState) | 69 PassRefPtrWillBeRawPtr<Animation> Animation::create(Element* element, const Vect
or<Dictionary>& keyframeDictionaryVector, ExceptionState& exceptionState) |
84 { | 70 { |
85 ASSERT(RuntimeEnabledFeatures::webAnimationsAPIEnabled()); | 71 ASSERT(RuntimeEnabledFeatures::webAnimationsAPIEnabled()); |
86 if (element) | 72 if (element) |
87 UseCounter::count(element->document(), UseCounter::AnimationConstructorK
eyframeListEffectNoTiming); | 73 UseCounter::count(element->document(), UseCounter::AnimationConstructorK
eyframeListEffectNoTiming); |
88 return create(element, EffectInput::convert(element, keyframeDictionaryVecto
r, exceptionState), Timing()); | 74 return create(element, EffectInput::convert(element, keyframeDictionaryVecto
r, exceptionState), Timing()); |
89 } | 75 } |
90 | 76 |
91 Animation::Animation(Element* target, PassRefPtrWillBeRawPtr<AnimationEffect> ef
fect, const Timing& timing, Priority priority, PassOwnPtrWillBeRawPtr<EventDeleg
ate> eventDelegate) | 77 Animation::Animation(Element* target, PassRefPtrWillBeRawPtr<AnimationEffect> ef
fect, const Timing& timing, Priority priority, PassOwnPtrWillBeRawPtr<EventDeleg
ate> eventDelegate) |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 | 309 |
324 void Animation::trace(Visitor* visitor) | 310 void Animation::trace(Visitor* visitor) |
325 { | 311 { |
326 visitor->trace(m_target); | 312 visitor->trace(m_target); |
327 visitor->trace(m_effect); | 313 visitor->trace(m_effect); |
328 visitor->trace(m_sampledEffect); | 314 visitor->trace(m_sampledEffect); |
329 AnimationNode::trace(visitor); | 315 AnimationNode::trace(visitor); |
330 } | 316 } |
331 | 317 |
332 } // namespace blink | 318 } // namespace blink |
OLD | NEW |