| 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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 const KeyframeValue& nextKeyframe = m_keyframes[nextIndex]; | 140 const KeyframeValue& nextKeyframe = m_keyframes[nextIndex]; |
| 141 | 141 |
| 142 fromStyle = prevKeyframe.style(); | 142 fromStyle = prevKeyframe.style(); |
| 143 toStyle = nextKeyframe.style(); | 143 toStyle = nextKeyframe.style(); |
| 144 | 144 |
| 145 offset = prevKeyframe.key(); | 145 offset = prevKeyframe.key(); |
| 146 scale = 1.0 / (nextKeyframe.key() - prevKeyframe.key()); | 146 scale = 1.0 / (nextKeyframe.key() - prevKeyframe.key()); |
| 147 // A scale of infinity is handled in AnimationBase::fractionalTime(). | 147 // A scale of infinity is handled in AnimationBase::fractionalTime(). |
| 148 ASSERT(scale >= 0 && (!std::isinf(scale) || prevIndex == nextIndex)); | 148 ASSERT(scale >= 0 && (!std::isinf(scale) || prevIndex == nextIndex)); |
| 149 | 149 |
| 150 // FIXME: This sometimes gets the wrong timing function. See crbug.com/28854
0. | 150 prog = progress(scale, offset, KeyframeValue::timingFunction(*prevKeyframe.s
tyle())); |
| 151 const TimingFunction* timingFunction = KeyframeValue::timingFunction(prevKey
frame.style(), name()); | |
| 152 prog = progress(scale, offset, timingFunction); | |
| 153 } | 151 } |
| 154 | 152 |
| 155 void KeyframeAnimation::animate(CompositeAnimation*, RenderObject*, const Render
Style*, RenderStyle* targetStyle, RefPtr<RenderStyle>& animatedStyle) | 153 void KeyframeAnimation::animate(CompositeAnimation*, RenderObject*, const Render
Style*, RenderStyle* targetStyle, RefPtr<RenderStyle>& animatedStyle) |
| 156 { | 154 { |
| 157 // Fire the start timeout if needed | 155 // Fire the start timeout if needed |
| 158 fireAnimationEventsIfNeeded(); | 156 fireAnimationEventsIfNeeded(); |
| 159 | 157 |
| 160 // If we have not yet started, we will not have a valid start time, so just
start the animation if needed. | 158 // If we have not yet started, we will not have a valid start time, so just
start the animation if needed. |
| 161 if (isNew() && m_animation->playState() == AnimPlayStatePlaying) | 159 if (isNew() && m_animation->playState() == AnimPlayStatePlaying) |
| 162 updateStateMachine(AnimationStateInputStartAnimation, -1); | 160 updateStateMachine(AnimationStateInputStartAnimation, -1); |
| (...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 448 | 446 |
| 449 if (acceleratedPropertiesOnly) { | 447 if (acceleratedPropertiesOnly) { |
| 450 bool isLooping; | 448 bool isLooping; |
| 451 getTimeToNextEvent(t, isLooping); | 449 getTimeToNextEvent(t, isLooping); |
| 452 } | 450 } |
| 453 | 451 |
| 454 return t; | 452 return t; |
| 455 } | 453 } |
| 456 | 454 |
| 457 } // namespace WebCore | 455 } // namespace WebCore |
| OLD | NEW |