| Index: Source/core/animation/Animation.cpp
|
| diff --git a/Source/core/animation/Animation.cpp b/Source/core/animation/Animation.cpp
|
| index d48b39a4f93c5485996b26583786688c2f833723..802c4543282e4aaadcc1de29331de78537e78546 100644
|
| --- a/Source/core/animation/Animation.cpp
|
| +++ b/Source/core/animation/Animation.cpp
|
| @@ -64,10 +64,14 @@ static AnimationStack* ensureAnimationStack(Element* element)
|
| void Animation::applyEffects(bool previouslyInEffect)
|
| {
|
| ASSERT(player());
|
| + if (!m_target || !m_effect)
|
| + return;
|
| +
|
| if (!previouslyInEffect) {
|
| ensureAnimationStack(m_target.get())->add(this);
|
| m_activeInAnimationStack = true;
|
| }
|
| +
|
| m_compositableValues = m_effect->sample(currentIteration(), timeFraction());
|
| m_target->setNeedsStyleRecalc(LocalStyleChange, StyleChangeFromRenderer);
|
| }
|
| @@ -84,6 +88,9 @@ void Animation::clearEffects()
|
|
|
| void Animation::updateChildrenAndEffects(bool wasInEffect) const
|
| {
|
| + if (!m_effect)
|
| + return;
|
| +
|
| ASSERT(m_activeInAnimationStack == wasInEffect);
|
| if (isInEffect())
|
| const_cast<Animation*>(this)->applyEffects(wasInEffect);
|
| @@ -91,4 +98,23 @@ void Animation::updateChildrenAndEffects(bool wasInEffect) const
|
| const_cast<Animation*>(this)->clearEffects();
|
| }
|
|
|
| +double Animation::calculateTimeToEffectChange(double inheritedTime, double activeTime, Phase phase) const
|
| +{
|
| + switch (phase) {
|
| + case PhaseBefore:
|
| + return activeTime - inheritedTime;
|
| + case PhaseActive:
|
| + return 0;
|
| + case PhaseAfter:
|
| + // If this Animation is still in effect then it will need to update
|
| + // when its parent goes out of effect. We have no way of knowing when
|
| + // that will be, however, so the parent will need to supply it.
|
| + return std::numeric_limits<double>::infinity();
|
| + case PhaseNone:
|
| + default:
|
| + ASSERT_NOT_REACHED();
|
| + return 0;
|
| + }
|
| +}
|
| +
|
| } // namespace WebCore
|
|
|