Full version, Basic version, Tiny version

Specification link: 19.2 Animation elements

animate-elem-66-t ← index → animate-elem-68-t

# animate-elem-67-t
SVG Image | PNG Image
$RCSfile: animate-elem-67-t.svg,v $ $Revision: 1.8 $ restart no restart (defaults to always) restart="always" restart="whenNotActive" restart="never" reference > 5s 0s-5s |

This tests performs basic tests on restart attribute

Each row in the test shows different rectangles subject to <set> animations with different configurations with regards to the restart attribute. For each row, the animation should be active during the first 5 seconds of the animations where the red rectangle should show in the right column. At five seconds into the animation, all the rectangles should move to their left position.

On the first row, the <set> animation has a begin attribute set to '0s;1s' and a dur attribute set to 4s. This should result in a first interval of (0s <= t < 4s) which should be superceeded, at 1s, by a new interval of (1s <= t < 5s) because the default restart behavior is 'always'. Consequently, the rectangle should be in the right position during the (0s <= t < 5s) interval and move to the left position at 5s.

On the second row, the <set> animation has a begin attribute set to '0s;1s', a dur attribute set to 4s and a restart attribute set to always. The behavior should be the same as for the first row.

On the third row, the first (left most) rectangle's <set> animation has a begin attribute set to '0s;1s', a dur set to 5s and a restart attribute set to whenNotActive. Because of the rules for computing intervals, the animation's interval is (0s <= t < 5s) and is not superseded by a (1s <= t < 6s) interval because of the restart value. The second (right most) red rectangle's <set> animation has a begin attribute set to '0s;2.5s' and a dur attribute set to 2.5s. This results in a first interval (0s <= t < 2.5s) which is followed by a (2.5s <= t < 5s) interval. Consequently, the rectangle stays on its right position for the first five seconds before it definitively moves to the left position.

On the fourth row, the <set> animation has a begin attribute set to '0s;5s' and a dur attribute set to 5s. This results in a first interval of (0s <= t < 5s). Because the restart attribute is set to 'never', the following possible interval, (5s <= t < 10s) does not apply and the animation is only active for the first 5 seconds.

The fifth row shows a simple animated red rectangle which lasts for 5 seconds. It shows a reference of how the other animations should behave visually: all red rectangles should have the same horizontal position as the one on the reference row, at any time during the animation.

animate-elem-66-t ← index → animate-elem-68-t