| 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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 // ImplicitAnimations are always hashed by actual properties, ne
ver animateAll. | 114 // ImplicitAnimations are always hashed by actual properties, ne
ver animateAll. |
| 115 ASSERT(prop >= firstCSSProperty && prop < (firstCSSProperty + nu
mCSSProperties)); | 115 ASSERT(prop >= firstCSSProperty && prop < (firstCSSProperty + nu
mCSSProperties)); |
| 116 | 116 |
| 117 // If there is a running animation for this property, the transi
tion is overridden | 117 // If there is a running animation for this property, the transi
tion is overridden |
| 118 // and we have to use the unanimatedStyle from the animation. We
do the test | 118 // and we have to use the unanimatedStyle from the animation. We
do the test |
| 119 // against the unanimated style here, but we "override" the tran
sition later. | 119 // against the unanimated style here, but we "override" the tran
sition later. |
| 120 RefPtr<KeyframeAnimation> keyframeAnim = getAnimationForProperty
(prop); | 120 RefPtr<KeyframeAnimation> keyframeAnim = getAnimationForProperty
(prop); |
| 121 RenderStyle* fromStyle = keyframeAnim ? keyframeAnim->unanimated
Style() : currentStyle; | 121 RenderStyle* fromStyle = keyframeAnim ? keyframeAnim->unanimated
Style() : currentStyle; |
| 122 | 122 |
| 123 // See if there is a current transition for this prop | 123 // See if there is a current transition for this prop |
| 124 ImplicitAnimation* implAnim = m_transitions.get(prop).get(); | 124 ImplicitAnimation* implAnim = m_transitions.get(prop); |
| 125 bool equal = true; | 125 bool equal = true; |
| 126 | 126 |
| 127 if (implAnim) { | 127 if (implAnim) { |
| 128 // If we are post active don't bother setting the active fla
g. This will cause | 128 // If we are post active don't bother setting the active fla
g. This will cause |
| 129 // this animation to get removed at the end of this function
. | 129 // this animation to get removed at the end of this function
. |
| 130 if (!implAnim->postActive()) | 130 if (!implAnim->postActive()) |
| 131 implAnim->setActive(true); | 131 implAnim->setActive(true); |
| 132 | 132 |
| 133 // This might be a transition that is just finishing. That w
ould be the case | 133 // This might be a transition that is just finishing. That w
ould be the case |
| 134 // if it were postActive. But we still need to check for equ
ality because | 134 // if it were postActive. But we still need to check for equ
ality because |
| (...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 489 } | 489 } |
| 490 | 490 |
| 491 return false; | 491 return false; |
| 492 } | 492 } |
| 493 | 493 |
| 494 bool CompositeAnimation::pauseTransitionAtTime(CSSPropertyID property, double t) | 494 bool CompositeAnimation::pauseTransitionAtTime(CSSPropertyID property, double t) |
| 495 { | 495 { |
| 496 if ((property < firstCSSProperty) || (property >= firstCSSProperty + numCSSP
roperties)) | 496 if ((property < firstCSSProperty) || (property >= firstCSSProperty + numCSSP
roperties)) |
| 497 return false; | 497 return false; |
| 498 | 498 |
| 499 ImplicitAnimation* implAnim = m_transitions.get(property).get(); | 499 ImplicitAnimation* implAnim = m_transitions.get(property); |
| 500 if (!implAnim) { | 500 if (!implAnim) { |
| 501 // Check to see if this property is being animated via a shorthand. | 501 // Check to see if this property is being animated via a shorthand. |
| 502 // This code is only used for testing, so performance is not critical he
re. | 502 // This code is only used for testing, so performance is not critical he
re. |
| 503 HashSet<CSSPropertyID> shorthandProperties = CSSPropertyAnimation::anima
tableShorthandsAffectingProperty(property); | 503 HashSet<CSSPropertyID> shorthandProperties = CSSPropertyAnimation::anima
tableShorthandsAffectingProperty(property); |
| 504 bool anyPaused = false; | 504 bool anyPaused = false; |
| 505 HashSet<CSSPropertyID>::const_iterator end = shorthandProperties.end(); | 505 HashSet<CSSPropertyID>::const_iterator end = shorthandProperties.end(); |
| 506 for (HashSet<CSSPropertyID>::const_iterator it = shorthandProperties.beg
in(); it != end; ++it) { | 506 for (HashSet<CSSPropertyID>::const_iterator it = shorthandProperties.beg
in(); it != end; ++it) { |
| 507 if (pauseTransitionAtTime(*it, t)) | 507 if (pauseTransitionAtTime(*it, t)) |
| 508 anyPaused = true; | 508 anyPaused = true; |
| 509 } | 509 } |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 541 ImplicitAnimation* anim = it->value.get(); | 541 ImplicitAnimation* anim = it->value.get(); |
| 542 if (anim->running()) | 542 if (anim->running()) |
| 543 ++count; | 543 ++count; |
| 544 } | 544 } |
| 545 } | 545 } |
| 546 | 546 |
| 547 return count; | 547 return count; |
| 548 } | 548 } |
| 549 | 549 |
| 550 } // namespace WebCore | 550 } // namespace WebCore |
| OLD | NEW |