| 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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 void ImplicitAnimation::getAnimatedStyle(RefPtr<RenderStyle>& animatedStyle) | 97 void ImplicitAnimation::getAnimatedStyle(RefPtr<RenderStyle>& animatedStyle) |
| 98 { | 98 { |
| 99 if (!animatedStyle) | 99 if (!animatedStyle) |
| 100 animatedStyle = RenderStyle::clone(m_toStyle.get()); | 100 animatedStyle = RenderStyle::clone(m_toStyle.get()); |
| 101 | 101 |
| 102 CSSPropertyAnimation::blendProperties(this, m_animatingProperty, animatedSty
le.get(), m_fromStyle.get(), m_toStyle.get(), progress(1, 0, 0)); | 102 CSSPropertyAnimation::blendProperties(this, m_animatingProperty, animatedSty
le.get(), m_fromStyle.get(), m_toStyle.get(), progress(1, 0, 0)); |
| 103 } | 103 } |
| 104 | 104 |
| 105 bool ImplicitAnimation::startAnimation(double timeOffset) | 105 bool ImplicitAnimation::startAnimation(double timeOffset) |
| 106 { | 106 { |
| 107 if (m_object && m_object->isComposited()) | 107 if (m_object && m_object->compositingState() == PaintsIntoOwnBacking) |
| 108 return toRenderBoxModelObject(m_object)->startTransition(timeOffset, m_a
nimatingProperty, m_fromStyle.get(), m_toStyle.get()); | 108 return toRenderBoxModelObject(m_object)->startTransition(timeOffset, m_a
nimatingProperty, m_fromStyle.get(), m_toStyle.get()); |
| 109 | 109 |
| 110 return false; | 110 return false; |
| 111 } | 111 } |
| 112 | 112 |
| 113 void ImplicitAnimation::pauseAnimation(double timeOffset) | 113 void ImplicitAnimation::pauseAnimation(double timeOffset) |
| 114 { | 114 { |
| 115 if (!m_object) | 115 if (!m_object) |
| 116 return; | 116 return; |
| 117 | 117 |
| 118 if (m_object->isComposited()) | 118 if (m_object->compositingState() == PaintsIntoOwnBacking) |
| 119 toRenderBoxModelObject(m_object)->transitionPaused(timeOffset, m_animati
ngProperty); | 119 toRenderBoxModelObject(m_object)->transitionPaused(timeOffset, m_animati
ngProperty); |
| 120 | 120 |
| 121 // Restore the original (unanimated) style | 121 // Restore the original (unanimated) style |
| 122 if (!paused()) | 122 if (!paused()) |
| 123 setNeedsStyleRecalc(m_object->node()); | 123 setNeedsStyleRecalc(m_object->node()); |
| 124 } | 124 } |
| 125 | 125 |
| 126 void ImplicitAnimation::endAnimation() | 126 void ImplicitAnimation::endAnimation() |
| 127 { | 127 { |
| 128 if (m_object && m_object->isComposited()) | 128 if (m_object && m_object->compositingState() == PaintsIntoOwnBacking) |
| 129 toRenderBoxModelObject(m_object)->transitionFinished(m_animatingProperty
); | 129 toRenderBoxModelObject(m_object)->transitionFinished(m_animatingProperty
); |
| 130 } | 130 } |
| 131 | 131 |
| 132 void ImplicitAnimation::onAnimationEnd(double elapsedTime) | 132 void ImplicitAnimation::onAnimationEnd(double elapsedTime) |
| 133 { | 133 { |
| 134 // If we have a keyframe animation on this property, this transition is bein
g overridden. The keyframe | 134 // If we have a keyframe animation on this property, this transition is bein
g overridden. The keyframe |
| 135 // animation keeps an unanimated style in case a transition starts while the
keyframe animation is | 135 // animation keeps an unanimated style in case a transition starts while the
keyframe animation is |
| 136 // running. But now that the transition has completed, we need to update thi
s style with its new | 136 // running. But now that the transition has completed, we need to update thi
s style with its new |
| 137 // destination. If we didn't, the next time through we would think a transit
ion had started | 137 // destination. If we didn't, the next time through we would think a transit
ion had started |
| 138 // (comparing the old unanimated style with the new final style of the trans
ition). | 138 // (comparing the old unanimated style with the new final style of the trans
ition). |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 282 // only need service at the end of the transition. | 282 // only need service at the end of the transition. |
| 283 if (CSSPropertyAnimation::animationOfPropertyIsAccelerated(m_animatingProper
ty) && isAccelerated()) { | 283 if (CSSPropertyAnimation::animationOfPropertyIsAccelerated(m_animatingProper
ty) && isAccelerated()) { |
| 284 bool isLooping; | 284 bool isLooping; |
| 285 getTimeToNextEvent(t, isLooping); | 285 getTimeToNextEvent(t, isLooping); |
| 286 } | 286 } |
| 287 | 287 |
| 288 return t; | 288 return t; |
| 289 } | 289 } |
| 290 | 290 |
| 291 } // namespace WebCore | 291 } // namespace WebCore |
| OLD | NEW |