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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 } | 58 } |
59 | 59 |
60 static AnimationPlayer* animate(Element& element, PassRefPtr<AnimationEffect
> effect) | 60 static AnimationPlayer* animate(Element& element, PassRefPtr<AnimationEffect
> effect) |
61 { | 61 { |
62 return animateInternal(element, effect, Timing()); | 62 return animateInternal(element, effect, Timing()); |
63 } | 63 } |
64 | 64 |
65 static AnimationPlayer* animate(Element& element, const Vector<Dictionary>&
keyframeDictionaryVector, const Dictionary& timingInputDictionary, ExceptionStat
e& exceptionState) | 65 static AnimationPlayer* animate(Element& element, const Vector<Dictionary>&
keyframeDictionaryVector, const Dictionary& timingInputDictionary, ExceptionStat
e& exceptionState) |
66 { | 66 { |
67 RefPtr<AnimationEffect> effect = EffectInput::convert(&element, keyframe
DictionaryVector, exceptionState); | 67 RefPtr<AnimationEffect> effect = EffectInput::convert(&element, keyframe
DictionaryVector, exceptionState); |
68 if (exceptionState.hadException()) | 68 if (exceptionState.had_exception()) |
69 return 0; | 69 return 0; |
70 ASSERT(effect); | 70 ASSERT(effect); |
71 return animateInternal(element, effect.release(), TimingInput::convert(t
imingInputDictionary)); | 71 return animateInternal(element, effect.release(), TimingInput::convert(t
imingInputDictionary)); |
72 } | 72 } |
73 | 73 |
74 static AnimationPlayer* animate(Element& element, const Vector<Dictionary>&
keyframeDictionaryVector, double duration, ExceptionState& exceptionState) | 74 static AnimationPlayer* animate(Element& element, const Vector<Dictionary>&
keyframeDictionaryVector, double duration, ExceptionState& exceptionState) |
75 { | 75 { |
76 RefPtr<AnimationEffect> effect = EffectInput::convert(&element, keyframe
DictionaryVector, exceptionState); | 76 RefPtr<AnimationEffect> effect = EffectInput::convert(&element, keyframe
DictionaryVector, exceptionState); |
77 if (exceptionState.hadException()) | 77 if (exceptionState.had_exception()) |
78 return 0; | 78 return 0; |
79 ASSERT(effect); | 79 ASSERT(effect); |
80 return animateInternal(element, effect.release(), TimingInput::convert(d
uration)); | 80 return animateInternal(element, effect.release(), TimingInput::convert(d
uration)); |
81 } | 81 } |
82 | 82 |
83 static AnimationPlayer* animate(Element& element, const Vector<Dictionary>&
keyframeDictionaryVector, ExceptionState& exceptionState) | 83 static AnimationPlayer* animate(Element& element, const Vector<Dictionary>&
keyframeDictionaryVector, ExceptionState& exceptionState) |
84 { | 84 { |
85 RefPtr<AnimationEffect> effect = EffectInput::convert(&element, keyframe
DictionaryVector, exceptionState); | 85 RefPtr<AnimationEffect> effect = EffectInput::convert(&element, keyframe
DictionaryVector, exceptionState); |
86 if (exceptionState.hadException()) | 86 if (exceptionState.had_exception()) |
87 return 0; | 87 return 0; |
88 ASSERT(effect); | 88 ASSERT(effect); |
89 return animateInternal(element, effect.release(), Timing()); | 89 return animateInternal(element, effect.release(), Timing()); |
90 } | 90 } |
91 | 91 |
92 static Vector<RefPtr<AnimationPlayer> > getAnimationPlayers(Element& element
) | 92 static Vector<RefPtr<AnimationPlayer> > getAnimationPlayers(Element& element
) |
93 { | 93 { |
94 Vector<RefPtr<AnimationPlayer> > animationPlayers; | 94 Vector<RefPtr<AnimationPlayer> > animationPlayers; |
95 | 95 |
96 if (!element.hasActiveAnimations()) | 96 if (!element.hasActiveAnimations()) |
(...skipping 13 matching lines...) Expand all Loading... |
110 static AnimationPlayer* animateInternal(Element& element, PassRefPtr<Animati
onEffect> effect, const Timing& timing) | 110 static AnimationPlayer* animateInternal(Element& element, PassRefPtr<Animati
onEffect> effect, const Timing& timing) |
111 { | 111 { |
112 RefPtr<Animation> animation = Animation::create(&element, effect, timing
); | 112 RefPtr<Animation> animation = Animation::create(&element, effect, timing
); |
113 return element.document().timeline().play(animation.get()); | 113 return element.document().timeline().play(animation.get()); |
114 } | 114 } |
115 }; | 115 }; |
116 | 116 |
117 } // namespace blink | 117 } // namespace blink |
118 | 118 |
119 #endif // SKY_ENGINE_CORE_ANIMATION_ELEMENTANIMATION_H_ | 119 #endif // SKY_ENGINE_CORE_ANIMATION_ELEMENTANIMATION_H_ |
OLD | NEW |