Bug 506096: In SVG Animation (SMIL), make sure to visit the underlying base value for first half of duration, in discrete-mode "to" animations. r+sr=roc

This commit is contained in:
Daniel Holbert 2009-07-27 13:52:19 -07:00
Родитель 21d55cdd1e
Коммит 6a27498683
2 изменённых файлов: 12 добавлений и 3 удалений

Просмотреть файл

@ -407,9 +407,13 @@ nsSMILAnimationFunction::InterpolateResult(const nsSMILValueArray& aValues,
// Handle CALC_DISCRETE separately, because it's simple.
if (GetCalcMode() == CALC_DISCRETE) {
PRUint32 index = IsToAnimation() ? 0 :
(PRUint32) floor(simpleProgress * (aValues.Length()));
aResult = aValues[index];
if (IsToAnimation()) {
// Two discrete values: our base value, and the val in our array
aResult = (simpleProgress < 0.5f) ? aBaseValue : aValues[0];
} else {
PRUint32 index = (PRUint32) floor(simpleProgress * (aValues.Length()));
aResult = aValues[index];
}
return NS_OK;
}

Просмотреть файл

@ -48,6 +48,11 @@ include pause/reftest.list
== anim-discrete-sum-none-1.svg anim-standard-ref.svg
== anim-discrete-sum-sum-1.svg anim-standard-ref.svg
== anim-discrete-to-1.svg anim-standard-ref.svg
== anim-discrete-to-2.svg anim-standard-ref.svg
== anim-discrete-to-3.svg anim-standard-ref.svg
== anim-discrete-to-4.svg anim-standard-ref.svg
fails == anim-fillcolor-1.svg anim-standard-ref.svg # color support
fails == anim-fillopacity-1.svg anim-standard-ref.svg # non-length-numeric values support