OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007 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 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 } | 247 } |
248 | 248 |
249 // Add this to the animation order map. | 249 // Add this to the animation order map. |
250 if (keyframeAnim) | 250 if (keyframeAnim) |
251 m_keyframeAnimationOrderMap.append(keyframeAnim->name().impl
()); | 251 m_keyframeAnimationOrderMap.append(keyframeAnim->name().impl
()); |
252 } | 252 } |
253 } | 253 } |
254 } | 254 } |
255 | 255 |
256 // Make a list of animations to be removed. | 256 // Make a list of animations to be removed. |
257 Vector<AtomicStringImpl*> animsToBeRemoved; | 257 Vector<StringImpl*> animsToBeRemoved; |
258 kfend = m_keyframeAnimations.end(); | 258 kfend = m_keyframeAnimations.end(); |
259 for (AnimationNameMap::const_iterator it = m_keyframeAnimations.begin(); it
!= kfend; ++it) { | 259 for (AnimationNameMap::const_iterator it = m_keyframeAnimations.begin(); it
!= kfend; ++it) { |
260 KeyframeAnimation* keyframeAnim = it->value.get(); | 260 KeyframeAnimation* keyframeAnim = it->value.get(); |
261 if (keyframeAnim->index() < 0) { | 261 if (keyframeAnim->index() < 0) { |
262 animsToBeRemoved.append(keyframeAnim->name().impl()); | 262 animsToBeRemoved.append(keyframeAnim->name().impl()); |
263 animationController()->animationWillBeRemoved(keyframeAnim); | 263 animationController()->animationWillBeRemoved(keyframeAnim); |
264 keyframeAnim->clear(); | 264 keyframeAnim->clear(); |
265 } | 265 } |
266 } | 266 } |
267 | 267 |
(...skipping 18 matching lines...) Expand all Loading... |
286 CSSPropertyTransitionsMap::const_iterator end = m_transitions.end(); | 286 CSSPropertyTransitionsMap::const_iterator end = m_transitions.end(); |
287 for (CSSPropertyTransitionsMap::const_iterator it = m_transitions.be
gin(); it != end; ++it) { | 287 for (CSSPropertyTransitionsMap::const_iterator it = m_transitions.be
gin(); it != end; ++it) { |
288 if (ImplicitAnimation* anim = it->value.get()) | 288 if (ImplicitAnimation* anim = it->value.get()) |
289 anim->animate(this, renderer, currentStyle, targetStyle, res
ultStyle); | 289 anim->animate(this, renderer, currentStyle, targetStyle, res
ultStyle); |
290 } | 290 } |
291 } | 291 } |
292 } | 292 } |
293 | 293 |
294 // Now that we have animation objects ready, let them know about the new goa
l state. We want them | 294 // Now that we have animation objects ready, let them know about the new goa
l state. We want them |
295 // to fill in a RenderStyle*& only if needed. | 295 // to fill in a RenderStyle*& only if needed. |
296 for (Vector<AtomicStringImpl*>::const_iterator it = m_keyframeAnimationOrder
Map.begin(); it != m_keyframeAnimationOrderMap.end(); ++it) { | 296 for (Vector<StringImpl*>::const_iterator it = m_keyframeAnimationOrderMap.be
gin(); it != m_keyframeAnimationOrderMap.end(); ++it) { |
297 RefPtr<KeyframeAnimation> keyframeAnim = m_keyframeAnimations.get(*it); | 297 RefPtr<KeyframeAnimation> keyframeAnim = m_keyframeAnimations.get(*it); |
298 if (keyframeAnim) | 298 if (keyframeAnim) |
299 keyframeAnim->animate(this, renderer, currentStyle, targetStyle, res
ultStyle); | 299 keyframeAnim->animate(this, renderer, currentStyle, targetStyle, res
ultStyle); |
300 } | 300 } |
301 | 301 |
302 return resultStyle ? resultStyle.release() : targetStyle; | 302 return resultStyle ? resultStyle.release() : targetStyle; |
303 } | 303 } |
304 | 304 |
305 PassRefPtr<RenderStyle> CompositeAnimation::getAnimatedStyle() const | 305 PassRefPtr<RenderStyle> CompositeAnimation::getAnimatedStyle() const |
306 { | 306 { |
307 RefPtr<RenderStyle> resultStyle; | 307 RefPtr<RenderStyle> resultStyle; |
308 CSSPropertyTransitionsMap::const_iterator end = m_transitions.end(); | 308 CSSPropertyTransitionsMap::const_iterator end = m_transitions.end(); |
309 for (CSSPropertyTransitionsMap::const_iterator it = m_transitions.begin(); i
t != end; ++it) { | 309 for (CSSPropertyTransitionsMap::const_iterator it = m_transitions.begin(); i
t != end; ++it) { |
310 if (ImplicitAnimation* implicitAnimation = it->value.get()) | 310 if (ImplicitAnimation* implicitAnimation = it->value.get()) |
311 implicitAnimation->getAnimatedStyle(resultStyle); | 311 implicitAnimation->getAnimatedStyle(resultStyle); |
312 } | 312 } |
313 | 313 |
314 m_keyframeAnimations.checkConsistency(); | 314 m_keyframeAnimations.checkConsistency(); |
315 | 315 |
316 for (Vector<AtomicStringImpl*>::const_iterator it = m_keyframeAnimationOrder
Map.begin(); it != m_keyframeAnimationOrderMap.end(); ++it) { | 316 for (Vector<StringImpl*>::const_iterator it = m_keyframeAnimationOrderMap.be
gin(); it != m_keyframeAnimationOrderMap.end(); ++it) { |
317 RefPtr<KeyframeAnimation> keyframeAnimation = m_keyframeAnimations.get(*
it); | 317 RefPtr<KeyframeAnimation> keyframeAnimation = m_keyframeAnimations.get(*
it); |
318 if (keyframeAnimation) | 318 if (keyframeAnimation) |
319 keyframeAnimation->getAnimatedStyle(resultStyle); | 319 keyframeAnimation->getAnimatedStyle(resultStyle); |
320 } | 320 } |
321 | 321 |
322 return resultStyle; | 322 return resultStyle; |
323 } | 323 } |
324 | 324 |
325 double CompositeAnimation::timeToNextService() const | 325 double CompositeAnimation::timeToNextService() const |
326 { | 326 { |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
520 ImplicitAnimation* anim = it->value.get(); | 520 ImplicitAnimation* anim = it->value.get(); |
521 if (anim->running()) | 521 if (anim->running()) |
522 ++count; | 522 ++count; |
523 } | 523 } |
524 } | 524 } |
525 | 525 |
526 return count; | 526 return count; |
527 } | 527 } |
528 | 528 |
529 } // namespace WebCore | 529 } // namespace WebCore |
OLD | NEW |