| Index: Source/core/animation/css/CSSAnimations.cpp
|
| diff --git a/Source/core/animation/css/CSSAnimations.cpp b/Source/core/animation/css/CSSAnimations.cpp
|
| index 568c917cb695a38bda29678a9626d2d1e1c2ec40..1b944d3321fb3292843191c81c8bf9f9071e3fcd 100644
|
| --- a/Source/core/animation/css/CSSAnimations.cpp
|
| +++ b/Source/core/animation/css/CSSAnimations.cpp
|
| @@ -97,7 +97,7 @@ CSSPropertyID propertyForAnimation(CSSPropertyID property)
|
| }
|
|
|
| static void resolveKeyframes(StyleResolver* resolver, Element* element, const Element& parentElement, const RenderStyle& style, RenderStyle* parentStyle, const AtomicString& name, TimingFunction* defaultTimingFunction,
|
| - KeyframeEffectModel::KeyframeVector& keyframes)
|
| + AnimatableValueKeyframeVector& keyframes)
|
| {
|
| // When the element is null, use its parent for scoping purposes.
|
| const Element* elementForScoping = element ? element : &parentElement;
|
| @@ -115,7 +115,7 @@ static void resolveKeyframes(StyleResolver* resolver, Element* element, const El
|
| const StyleKeyframe* styleKeyframe = styleKeyframes[i].get();
|
| // It's OK to pass a null element here.
|
| RefPtr<RenderStyle> keyframeStyle = resolver->styleForKeyframe(element, style, parentStyle, styleKeyframe, name);
|
| - RefPtrWillBeRawPtr<Keyframe> keyframe = Keyframe::create();
|
| + RefPtrWillBeRawPtr<AnimatableValueKeyframe> keyframe = AnimatableValueKeyframe::create();
|
| const Vector<double>& offsets = styleKeyframe->keys();
|
| ASSERT(!offsets.isEmpty());
|
| keyframe->setOffset(offsets[0]);
|
| @@ -133,7 +133,7 @@ static void resolveKeyframes(StyleResolver* resolver, Element* element, const El
|
| keyframes.append(keyframe);
|
| // The last keyframe specified at a given offset is used.
|
| for (size_t j = 1; j < offsets.size(); ++j) {
|
| - keyframes.append(keyframe->cloneWithOffset(offsets[j]));
|
| + keyframes.append(toAnimatableValueKeyframe(keyframe->cloneWithOffset(offsets[j]).get()));
|
| }
|
| }
|
| ASSERT(!keyframes.isEmpty());
|
| @@ -156,15 +156,15 @@ static void resolveKeyframes(StyleResolver* resolver, Element* element, const El
|
| keyframes.shrink(targetIndex + 1);
|
|
|
| // Add 0% and 100% keyframes if absent.
|
| - RefPtrWillBeRawPtr<Keyframe> startKeyframe = keyframes[0];
|
| + RefPtrWillBeRawPtr<AnimatableValueKeyframe> startKeyframe = keyframes[0];
|
| if (startKeyframe->offset()) {
|
| - startKeyframe = Keyframe::create();
|
| + startKeyframe = AnimatableValueKeyframe::create();
|
| startKeyframe->setOffset(0);
|
| keyframes.prepend(startKeyframe);
|
| }
|
| - RefPtrWillBeRawPtr<Keyframe> endKeyframe = keyframes[keyframes.size() - 1];
|
| + RefPtrWillBeRawPtr<AnimatableValueKeyframe> endKeyframe = keyframes[keyframes.size() - 1];
|
| if (endKeyframe->offset() != 1) {
|
| - endKeyframe = Keyframe::create();
|
| + endKeyframe = AnimatableValueKeyframe::create();
|
| endKeyframe->setOffset(1);
|
| keyframes.append(endKeyframe);
|
| }
|
| @@ -341,11 +341,11 @@ void CSSAnimations::calculateAnimationUpdate(CSSAnimationUpdate* update, Element
|
| Timing timing;
|
| bool isPaused;
|
| RefPtr<TimingFunction> keyframeTimingFunction = timingFromAnimationData(animationData, timing, isPaused);
|
| - KeyframeEffectModel::KeyframeVector resolvedKeyframes;
|
| + AnimatableValueKeyframeVector resolvedKeyframes;
|
| resolveKeyframes(resolver, element, parentElement, style, parentStyle, animationName, keyframeTimingFunction.get(), resolvedKeyframes);
|
| if (!resolvedKeyframes.isEmpty()) {
|
| ASSERT(!activeAnimations || !activeAnimations->isAnimationStyleChange());
|
| - update->startAnimation(animationName, InertAnimation::create(KeyframeEffectModel::create(resolvedKeyframes), timing, isPaused));
|
| + update->startAnimation(animationName, InertAnimation::create(AnimatableValueKeyframeEffectModel::create(resolvedKeyframes), timing, isPaused));
|
| }
|
| }
|
| }
|
| @@ -432,16 +432,16 @@ void CSSAnimations::maybeApplyPendingUpdate(Element* element)
|
| double oldStartTime = oldTransition.second;
|
| double inheritedTime = isNull(oldStartTime) ? 0 : element->document().transitionTimeline().currentTime() - oldStartTime;
|
| oldAnimation->updateInheritedTime(inheritedTime);
|
| - KeyframeEffectModel* oldEffect = toKeyframeEffectModel(inertAnimation->effect());
|
| - const KeyframeEffectModel::KeyframeVector& frames = oldEffect->getFrames();
|
| - KeyframeEffectModel::KeyframeVector newFrames;
|
| - newFrames.append(frames[0]->clone());
|
| + AnimatableValueKeyframeEffectModel* oldEffect = toAnimatableValueKeyframeEffectModel(inertAnimation->effect());
|
| + const KeyframeVector& frames = oldEffect->getFrames();
|
| + AnimatableValueKeyframeVector newFrames;
|
| + newFrames.append(toAnimatableValueKeyframe(frames[0]->clone().get()));
|
| newFrames[0]->clearPropertyValue(id);
|
| ASSERT(oldAnimation->activeInterpolations().size() == 1);
|
| - const AnimatableValue* value = toLegacyStyleInterpolation(oldAnimation->activeInterpolations()[0].get())->currentValue();
|
| - newFrames[0]->setPropertyValue(id, value);
|
| - newFrames.append(frames[1]->clone());
|
| - effect = KeyframeEffectModel::create(newFrames);
|
| + RefPtrWillBeRawPtr<AnimatableValue> value = toLegacyStyleInterpolation(oldAnimation->activeInterpolations()[0].get())->currentValue();
|
| + newFrames[0]->setPropertyValue(id, value.release());
|
| + newFrames.append(toAnimatableValueKeyframe(frames[1]->clone().get()));
|
| + effect = AnimatableValueKeyframeEffectModel::create(newFrames);
|
| }
|
| RefPtr<Animation> transition = Animation::create(element, effect, inertAnimation->specifiedTiming(), Animation::TransitionPriority, eventDelegate.release());
|
| RefPtr<AnimationPlayer> player = element->document().transitionTimeline().createAnimationPlayer(transition.get());
|
| @@ -490,20 +490,20 @@ void CSSAnimations::calculateTransitionUpdateForProperty(CSSPropertyID id, const
|
| // Note that the backwards part is required for delay to work.
|
| timing.fillMode = Timing::FillModeBoth;
|
|
|
| - KeyframeEffectModel::KeyframeVector keyframes;
|
| + AnimatableValueKeyframeVector keyframes;
|
|
|
| - RefPtrWillBeRawPtr<Keyframe> startKeyframe = Keyframe::create();
|
| + RefPtrWillBeRawPtr<AnimatableValueKeyframe> startKeyframe = AnimatableValueKeyframe::create();
|
| startKeyframe->setPropertyValue(id, from.get());
|
| startKeyframe->setOffset(0);
|
| startKeyframe->setEasing(timingFunction);
|
| keyframes.append(startKeyframe);
|
|
|
| - RefPtrWillBeRawPtr<Keyframe> endKeyframe = Keyframe::create();
|
| + RefPtrWillBeRawPtr<AnimatableValueKeyframe> endKeyframe = AnimatableValueKeyframe::create();
|
| endKeyframe->setPropertyValue(id, to.get());
|
| endKeyframe->setOffset(1);
|
| keyframes.append(endKeyframe);
|
|
|
| - RefPtrWillBeRawPtr<KeyframeEffectModel> effect = KeyframeEffectModel::create(keyframes);
|
| + RefPtrWillBeRawPtr<AnimatableValueKeyframeEffectModel> effect = AnimatableValueKeyframeEffectModel::create(keyframes);
|
|
|
| CSSPropertyID eventId = anim->animationMode() == CSSAnimationData::AnimateAll ? id : anim->property();
|
| update->startTransition(id, eventId, from.get(), to.get(), InertAnimation::create(effect, timing, isPaused));
|
|
|