OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007, 2008, 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008, 2009 Apple 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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 ASSERT(input == AnimationStateInputStartTimerFired || input == Anima
tionStateInputPlayStatePaused); | 184 ASSERT(input == AnimationStateInputStartTimerFired || input == Anima
tionStateInputPlayStatePaused); |
185 | 185 |
186 if (input == AnimationStateInputStartTimerFired) { | 186 if (input == AnimationStateInputStartTimerFired) { |
187 ASSERT(param >= 0); | 187 ASSERT(param >= 0); |
188 // Start timer has fired, tell the animation to start and wait f
or it to respond with start time | 188 // Start timer has fired, tell the animation to start and wait f
or it to respond with start time |
189 m_animState = AnimationStateStartWaitStyleAvailable; | 189 m_animState = AnimationStateStartWaitStyleAvailable; |
190 m_compAnim->animationController()->addToAnimationsWaitingForStyl
e(this); | 190 m_compAnim->animationController()->addToAnimationsWaitingForStyl
e(this); |
191 | 191 |
192 // Trigger a render so we can start the animation | 192 // Trigger a render so we can start the animation |
193 if (m_object) | 193 if (m_object) |
194 m_compAnim->animationController()->addNodeChangeToDispatch(m
_object->styledGeneratingNode()); | 194 m_compAnim->animationController()->addNodeChangeToDispatch(m
_object->node()); |
195 } else { | 195 } else { |
196 ASSERT(!paused()); | 196 ASSERT(!paused()); |
197 // We're waiting for the start timer to fire and we got a pause.
Cancel the timer, pause and wait | 197 // We're waiting for the start timer to fire and we got a pause.
Cancel the timer, pause and wait |
198 m_pauseTime = beginAnimationUpdateTime(); | 198 m_pauseTime = beginAnimationUpdateTime(); |
199 m_animState = AnimationStatePausedWaitTimer; | 199 m_animState = AnimationStatePausedWaitTimer; |
200 } | 200 } |
201 break; | 201 break; |
202 case AnimationStateStartWaitStyleAvailable: | 202 case AnimationStateStartWaitStyleAvailable: |
203 ASSERT(input == AnimationStateInputStyleAvailable || input == Animat
ionStateInputPlayStatePaused); | 203 ASSERT(input == AnimationStateInputStyleAvailable || input == Animat
ionStateInputPlayStatePaused); |
204 | 204 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 } | 245 } |
246 | 246 |
247 // Now that we know the start time, fire the start event. | 247 // Now that we know the start time, fire the start event. |
248 onAnimationStart(0); // The elapsedTime is 0. | 248 onAnimationStart(0); // The elapsedTime is 0. |
249 | 249 |
250 // Decide whether to go into looping or ending state | 250 // Decide whether to go into looping or ending state |
251 goIntoEndingOrLoopingState(); | 251 goIntoEndingOrLoopingState(); |
252 | 252 |
253 // Dispatch updateStyleIfNeeded so we can start the animation | 253 // Dispatch updateStyleIfNeeded so we can start the animation |
254 if (m_object) | 254 if (m_object) |
255 m_compAnim->animationController()->addNodeChangeToDispatch(m
_object->styledGeneratingNode()); | 255 m_compAnim->animationController()->addNodeChangeToDispatch(m
_object->node()); |
256 } else { | 256 } else { |
257 // We are pausing while waiting for a start response. Cancel the
animation and wait. When | 257 // We are pausing while waiting for a start response. Cancel the
animation and wait. When |
258 // we unpause, we will act as though the start timer just fired | 258 // we unpause, we will act as though the start timer just fired |
259 m_pauseTime = beginAnimationUpdateTime(); | 259 m_pauseTime = beginAnimationUpdateTime(); |
260 pauseAnimation(beginAnimationUpdateTime() - m_startTime); | 260 pauseAnimation(beginAnimationUpdateTime() - m_startTime); |
261 m_animState = AnimationStatePausedWaitResponse; | 261 m_animState = AnimationStatePausedWaitResponse; |
262 } | 262 } |
263 break; | 263 break; |
264 case AnimationStateLooping: | 264 case AnimationStateLooping: |
265 ASSERT(input == AnimationStateInputLoopTimerFired || input == Animat
ionStateInputPlayStatePaused); | 265 ASSERT(input == AnimationStateInputLoopTimerFired || input == Animat
ionStateInputPlayStatePaused); |
(...skipping 25 matching lines...) Expand all Loading... |
291 | 291 |
292 m_animState = AnimationStateDone; | 292 m_animState = AnimationStateDone; |
293 | 293 |
294 if (m_object) { | 294 if (m_object) { |
295 if (m_animation->fillsForwards()) | 295 if (m_animation->fillsForwards()) |
296 m_animState = AnimationStateFillingForwards; | 296 m_animState = AnimationStateFillingForwards; |
297 else | 297 else |
298 resumeOverriddenAnimations(); | 298 resumeOverriddenAnimations(); |
299 | 299 |
300 // Fire off another style change so we can set the final val
ue | 300 // Fire off another style change so we can set the final val
ue |
301 m_compAnim->animationController()->addNodeChangeToDispatch(m
_object->styledGeneratingNode()); | 301 m_compAnim->animationController()->addNodeChangeToDispatch(m
_object->node()); |
302 } | 302 } |
303 } else { | 303 } else { |
304 // We are pausing while running. Cancel the animation and wait | 304 // We are pausing while running. Cancel the animation and wait |
305 m_pauseTime = beginAnimationUpdateTime(); | 305 m_pauseTime = beginAnimationUpdateTime(); |
306 pauseAnimation(beginAnimationUpdateTime() - m_startTime); | 306 pauseAnimation(beginAnimationUpdateTime() - m_startTime); |
307 m_animState = AnimationStatePausedRun; | 307 m_animState = AnimationStatePausedRun; |
308 } | 308 } |
309 // |this| may be deleted here | 309 // |this| may be deleted here |
310 break; | 310 break; |
311 case AnimationStatePausedWaitTimer: | 311 case AnimationStatePausedWaitTimer: |
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
633 { | 633 { |
634 // FIXME: implement this method | 634 // FIXME: implement this method |
635 } | 635 } |
636 | 636 |
637 void AnimationBase::pause() | 637 void AnimationBase::pause() |
638 { | 638 { |
639 // FIXME: implement this method | 639 // FIXME: implement this method |
640 } | 640 } |
641 | 641 |
642 } // namespace WebCore | 642 } // namespace WebCore |
OLD | NEW |