Bug 974698 - Check that keyPoints and keyTimes numbers match for animateMotion. r=dholbert

This commit is contained in:
Robert Longson 2014-04-18 10:47:28 +01:00
parent 4f111efc9a
commit e5eaf64ca5
2 changed files with 5 additions and 6 deletions

View File

@ -377,8 +377,8 @@ SVGMotionSMILAnimationFunction::CheckKeyPoints()
SetKeyPointsErrorFlag(false);
}
if (mKeyPoints.IsEmpty()) {
// keyPoints attr is set, but array is empty => it failed preliminary checks
if (mKeyPoints.Length() != mKeyTimes.Length()) {
// there must be exactly as many keyPoints as keyTimes
SetKeyPointsErrorFlag(true);
return;
}
@ -387,10 +387,6 @@ SVGMotionSMILAnimationFunction::CheckKeyPoints()
// - Formatting & range issues will be caught in SetKeyPoints, and will
// result in an empty mKeyPoints array, which will drop us into the error
// case above.
// - Number-of-entries issues will be caught in CheckKeyTimes (and flagged
// as a problem with |keyTimes|), since we use our keyPoints entries to
// populate the "values" list, and that list's count gets passed to
// CheckKeyTimes.
}
nsresult

View File

@ -108,8 +108,11 @@ const gValidKeyPoints = [
"0; 0.000001; 1",
];
// Should have 3 values to be valid.
// Same as number of keyTimes values
const gInvalidKeyPoints = [
"0; 1",
"0; 0.5; 0.75; 1",
"0; 1;",
"0",
"1",