Range for keyTimes

Following are a couple of issues I’ve come across with regards to keyTimes.

  1. In section 3.2.3 of the SMIL Animation specification the keyTimes attribute is described and the following constraint is given:

    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.

    Later in that section, the following example is given:

    <animate attributeName="foo" from="10" to="20"
      dur="10s" keyTimes="0.0; 0.7"
      calcMode="spline" keySplines=".5 0 .5 1" />
    

    The behaviour of the example is given as “The keyTimes values cause the value of 20 to be reached at 7 seconds, and to hold there for the remainder of the 10 second simple duration.”

    This seems to contradict the constraint provided earlier. Perhaps this is a special case for from-to animation but I can’t find a reference to such an exception elsewhere.

    In the patch I’ve prepared I have a #define (ALLOW_BAD_KEYTIMES). If this is defined then no constraint checking is performed and specs such as keyTimes="0.0; 0.7" or even keyTimes="0.3; 0.9" are allowed and provide the behaviour described above.

    I think it is reasonable to allow this behaviour because:

    • There is an example using this notation in the spec and many authors will just copy the code examples rather than reading the spec.
    • The behaviour in this case is quite obvious. From memory Opera and ASV allow it but I’ll have another look soon.
  2. In the same section (3.2.3) the following example is given of the keyTimes attribute:

    <animateColor attributeName="color" dur="10s" calcMode="discrete"
         values="green; yellow; red" keyTimes="0.0; 0.5;" />
    

    Firstly, the trailing semi-colon in the keyTimes value seems out of place but perhaps it is my understanding of the following explanation that is at fault:

    This example also shows how keyTimes values can interact with an indefinite duration. The value of the “color” attribute will be set to green for 5 seconds, and then to yellow for 5 seconds, and then will remain red for the remainder of the document, since the (unspecified) duration defaults to“indefinite”.

    I first thought that perhaps the “unspecified duration” referred to the missing keyTime but nowhere else is it mentioned that keyTimes can be indefinite. Furthermore I would not expect that such a keyTime specification can extend the duration of the element beyond its specified duration of 10s but the description says it “will remain red for the remainder of the document.”

I’ve posted these questions to www-smil@w3.org but so far haven’t received any response.

Your help is greatly appreciated! Please leave a comment if you have any suggestions.

Comments

Olaf

Note, that this is fixed now in SMIL3 and such surprising examples do not appear anymore. Therefore one can simply assume, that keyTimes=”0.0; 0.5;” is nonsense and keyTimes=”0.0; 0.7″only ok for discrete animations.

By the way, there happen funny things for keyTimes=”0.0; 0.7; 1″with discrete animations, especially if additive or cumulative. For fill=“freeze” there is still an inconsistent formula in SMIL3, therefore SVGT1.2 has already a specific rule to align the behaviour to the definition of fill more than to the formula of SMIL2/3 ;o)

Leave a reply

Most markdown like **bold** and _italic_ is supported.

Never shown. Only used for looking up your gravatar.

Optional
https://