Single-valued keyTimes

Dear all,

I'd like to clarify whether the following fragment of SVG is correct:

    <animate attributeName="cx" values="150" keyTimes="0" dur="1s"/>

The reason I believe this clarification is needed is that we have the
following rules:
* values is a list of ONE or more values.[1]
* the number of keyTimes must match the number of values.[2]
* for linear and spline animation the first keyTime must be 0 and the last
keyTime must be 1.[2]
(Recall that for animate the default calcMode is linear)

So technically the above fragment is in error since the last keyTime is not
1.

Admittedly, it's a fairly obscure case since, (a) only having one value
means it's not really linear animation anyway, (b) setting keyTimes isn't
going to have any effect unless we have 3 or more values (except for
calcMode=discrete).

Nevertheless, SVG seems to be pretty strict about error-checking:

  If there are any errors in the ‘keyTimes’  specification (bad values, too
many or too few values), the document fragment is in error (see error
processing).[2]

My suggestion is that the above be considered valid largely for the sake of
making generating SVG from script simpler. For example, a script may
generate keyTimes regardless of whether they will have any effect and it's
often easier to get that script to just spit out '0' when there's only one
value than having to special-case it to not set the attribute.

So perhaps we could update the following statement to allow for the case of
only one keyTime:

    For linear and spline animation, the first time value in the list must
be 0, and the last time value in the list must be 1.[2]

Best regards,

Brian Birtles

[1]
http://dev.w3.org/SVG/profiles/1.1F2/publish/animate.html#ValuesAttribute
[2]
http://dev.w3.org/SVG/profiles/1.1F2/publish/animate.html#KeyTimesAttribute

Received on Friday, 17 September 2010 02:16:02 UTC