diff --git a/content/smil/nsSMILAnimationFunction.cpp b/content/smil/nsSMILAnimationFunction.cpp index d72f9e43cf51..f618296b1b86 100644 --- a/content/smil/nsSMILAnimationFunction.cpp +++ b/content/smil/nsSMILAnimationFunction.cpp @@ -215,7 +215,6 @@ nsSMILAnimationFunction::Activate(nsSMILTime aBeginTime) mBeginTime = aBeginTime; mIsActive = true; mIsFrozen = false; - mFrozenValue = nsSMILValue(); mHasChanged = true; } @@ -224,7 +223,6 @@ nsSMILAnimationFunction::Inactivate(bool aIsFrozen) { mIsActive = false; mIsFrozen = aIsFrozen; - mFrozenValue = nsSMILValue(); mHasChanged = true; } @@ -286,11 +284,6 @@ nsSMILAnimationFunction::ComposeResult(const nsISMILAttr& aSMILAttr, result.Add(last, mRepeatIteration); } - } else if (!mFrozenValue.IsNull() && !mHasChanged) { - - // Frozen to animation - result = mFrozenValue; - } else { // Interpolation @@ -299,10 +292,6 @@ nsSMILAnimationFunction::ComposeResult(const nsISMILAttr& aSMILAttr, if (NS_FAILED(AccumulateResult(values, result))) return; - - if (IsToAnimation() && mIsFrozen) { - mFrozenValue = result; - } } // If additive animation isn't required or isn't supported, set the value. @@ -359,12 +348,11 @@ nsSMILAnimationFunction::WillReplace() const { /* * In IsAdditive() we don't consider to-animation to be additive as it is - * a special case that is dealt with differently in the compositing method but - * here we return false for to animation as it builds on the underlying value - * unless its a frozen to animation. + * a special case that is dealt with differently in the compositing method. + * Here, however, we return FALSE for to-animation (i.e. it will NOT replace + * the underlying value) as it builds on the underlying value. */ - return !mErrorFlags && (!(IsAdditive() || IsToAnimation()) || - (IsToAnimation() && mIsFrozen && !mHasChanged)); + return !mErrorFlags && !(IsAdditive() || IsToAnimation()); } bool @@ -374,7 +362,8 @@ nsSMILAnimationFunction::HasChanged() const } bool -nsSMILAnimationFunction::UpdateCachedTarget(const nsSMILTargetIdentifier& aNewTarget) +nsSMILAnimationFunction::UpdateCachedTarget( + const nsSMILTargetIdentifier& aNewTarget) { if (!mLastTarget.Equals(aNewTarget)) { mLastTarget = aNewTarget; @@ -514,8 +503,7 @@ nsresult nsSMILAnimationFunction::AccumulateResult(const nsSMILValueArray& aValues, nsSMILValue& aResult) { - if (!IsToAnimation() && GetAccumulate() && mRepeatIteration) - { + if (!IsToAnimation() && GetAccumulate() && mRepeatIteration) { const nsSMILValue& lastValue = aValues[aValues.Length() - 1]; // If the target attribute type doesn't support addition, Add will @@ -819,7 +807,7 @@ nsSMILAnimationFunction::GetValues(const nsISMILAttr& aSMILAttr, preventCachingOfSandwich); parseOk &= ParseAttr(nsGkAtoms::by, aSMILAttr, by, preventCachingOfSandwich); - + if (preventCachingOfSandwich) { mValueNeedsReparsingEverySample = true; } diff --git a/content/smil/nsSMILAnimationFunction.h b/content/smil/nsSMILAnimationFunction.h index 3d16128e753c..c9c51b8a94ce 100644 --- a/content/smil/nsSMILAnimationFunction.h +++ b/content/smil/nsSMILAnimationFunction.h @@ -453,31 +453,6 @@ protected: // associated with them. PRUint16 mErrorFlags; - // This is for the very specific case where we have a 'to' animation that is - // frozen part way through the simple duration and there are other active - // lower-priority animations targetting the same attribute. In this case - // SMILANIM 3.3.6 says: - // - // The value for F(t) when a to-animation is frozen (at the end of the - // simple duration) is just the to value. If a to-animation is frozen - // anywhere within the simple duration (e.g., using a repeatCount of "2.5"), - // the value for F(t) when the animation is frozen is the value computed for - // the end of the active duration. Even if other, lower priority animations - // are active while a to-animation is frozen, the value for F(t) does not - // change. - // - // To implement this properly we'd need to force a resample of all the lower - // priority animations at the active end of this animation--something which - // would introduce unwanted coupling between the timing and animation model. - // Instead we just save the value calculated when this animation is frozen (in - // which case this animation will be sampled at the active end and the lower - // priority animations should be sampled at a time pretty close to this, - // provided we have a reasonable frame rate and we aren't seeking). - // - // @see - // http://www.w3.org/TR/2001/REC-smil-animation-20010904/#FromToByAndAdditive - nsSMILValue mFrozenValue; - // Allows us to check whether an animation function has changed target from // sample to sample (because if neither target nor animated value have // changed, we don't have to do anything). diff --git a/layout/reftests/svg/smil/frozen-to-anim-1.svg b/layout/reftests/svg/smil/frozen-to-anim-1.svg new file mode 100644 index 000000000000..a934d4534251 --- /dev/null +++ b/layout/reftests/svg/smil/frozen-to-anim-1.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + diff --git a/layout/reftests/svg/smil/reftest.list b/layout/reftests/svg/smil/reftest.list index 0b060107da57..b2534e907c99 100644 --- a/layout/reftests/svg/smil/reftest.list +++ b/layout/reftests/svg/smil/reftest.list @@ -234,6 +234,7 @@ fails == anim-pattern-attr-presence-02.svg anim-pattern-attr-presence-02-ref.svg == freeze-applied-late-2.svg anim-standard-ref.svg == freeze-applied-late-3.svg anim-standard-ref.svg == freeze-applied-late-4.svg anim-standard-ref.svg +== frozen-to-anim-1.svg lime.svg == inactivate-with-active-unchanged-1.svg anim-standard-ref.svg == inactivate-with-active-unchanged-2.svg anim-standard-ref.svg