OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007, 2012 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2012 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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 nextIndex = numKeyframes - 1; | 151 nextIndex = numKeyframes - 1; |
152 | 152 |
153 const KeyframeValue& prevKeyframe = m_keyframes[prevIndex]; | 153 const KeyframeValue& prevKeyframe = m_keyframes[prevIndex]; |
154 const KeyframeValue& nextKeyframe = m_keyframes[nextIndex]; | 154 const KeyframeValue& nextKeyframe = m_keyframes[nextIndex]; |
155 | 155 |
156 fromStyle = prevKeyframe.style(); | 156 fromStyle = prevKeyframe.style(); |
157 toStyle = nextKeyframe.style(); | 157 toStyle = nextKeyframe.style(); |
158 | 158 |
159 offset = prevKeyframe.key(); | 159 offset = prevKeyframe.key(); |
160 scale = 1.0 / (nextKeyframe.key() - prevKeyframe.key()); | 160 scale = 1.0 / (nextKeyframe.key() - prevKeyframe.key()); |
| 161 // A scale of infinity is handled in AnimationBase::fractionalTime(). |
| 162 ASSERT(scale >= 0 && (!std::isinf(scale) || prevIndex == nextIndex)); |
161 | 163 |
162 const TimingFunction* timingFunction = 0; | 164 const TimingFunction* timingFunction = 0; |
163 if (const CSSAnimationData* matchedAnimation = getAnimationFromStyleByName(f
romStyle, name())) | 165 if (const CSSAnimationData* matchedAnimation = getAnimationFromStyleByName(f
romStyle, name())) |
164 timingFunction = matchedAnimation->timingFunction().get(); | 166 timingFunction = matchedAnimation->timingFunction().get(); |
165 | 167 |
166 prog = progress(scale, offset, timingFunction); | 168 prog = progress(scale, offset, timingFunction); |
167 } | 169 } |
168 | 170 |
169 void KeyframeAnimation::animate(CompositeAnimation*, RenderObject*, const Render
Style*, RenderStyle* targetStyle, RefPtr<RenderStyle>& animatedStyle) | 171 void KeyframeAnimation::animate(CompositeAnimation*, RenderObject*, const Render
Style*, RenderStyle* targetStyle, RefPtr<RenderStyle>& animatedStyle) |
170 { | 172 { |
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
467 | 469 |
468 if (acceleratedPropertiesOnly) { | 470 if (acceleratedPropertiesOnly) { |
469 bool isLooping; | 471 bool isLooping; |
470 getTimeToNextEvent(t, isLooping); | 472 getTimeToNextEvent(t, isLooping); |
471 } | 473 } |
472 | 474 |
473 return t; | 475 return t; |
474 } | 476 } |
475 | 477 |
476 } // namespace WebCore | 478 } // namespace WebCore |
OLD | NEW |