Re: animateMotion keyTimes question

On 08/12/2014 10:26 AM, Renata Hodovan wrote:
> The standard says that "For animations specified with a ‘values’ list,
> the ‘keyTimes’ attribute if specified must have exactly as many values
> as there are in the ‘values’ attribute. For from/to/by animations, the
> ‘keyTimes’ attribute if specified must have two values."
> (http://www.w3.org/TR/SVG11/animate.html#KeyTimesAttribute).
> In this test case we have a from-to animation with a keyTimes list of 4
> elements (instead of being 2 element long) but the animation still runs
> and is affected by the keyTimes and keyPoints values (all with Chrome,
> Firefox and Opera). In my understanding animation should have been
> ignored if the length of the list were incorrect. Am I wrong?
> So the question is whether this is the correct behavior?

Good question!

There is actually some spec text later on that clarifies this and
indicates that the behavior you're seeing in browsers is correct, though
it's a bit buried and not entirely clear about how it interacts with
your original spec quote.

In particular, consider this spec-text from the end of Section 19.2.14
(about animateMotion):
  # Regarding determining the points which correspond
  # to the ‘keyTimes’ attributes, the ‘keyPoints’ attribute
  # overrides ‘path’, which overrides ‘values’, which overrides
  # ‘from’, ‘by’ and ‘to’.
http://www.w3.org/TR/SVG11/animate.html#AnimateMotionElement


*Your* spec-quote implicitly assumes that the times in the "keyTimes"
attribute are supposed to be matched up with the values in "from" & "to"
(in which case, it makes sense that there must be exactly 2 entries).
But as my spec-quote indicates, if you specify keyPoints, then the
keyTimes entries instead correspond to the positions-along-the-path
represented by those points.

I think the spec text you quoted (which seems to prohibit this behavior)
is a bit heavy-handed, and could perhaps be softened to make this clearer.

~Daniel

Received on Tuesday, 12 August 2014 18:20:37 UTC