Specification link: 19.2 Animation elements

animate-elem-62-t ← index → animate-elem-64-t

Tests that contain the draft-watermark are under development and may be incorrectly testing a feature.

# animate-elem-63-t.svg
SVG Image | PNG Image

## Operator Script

Run the test. Observe the document for six seconds. Then, click the red square in the "2 event base" row and then press "a" on the keyboard.

Next, reload the test. Before five seconds have elapsed, click the red square in the "2 event base" row and then press "a" on the keyboard. Observe the document for another six seconds.

## Pass Criteria

The test passes if the following conditions are met:

- In the first load of the document, the red squares in the top three rows and the bottom row are in the relevant column according to the times written above the columns: in left column for the first second of the document, in the right column between 1s and 2s, in the left column again between 2s and 4s, in the right column again between 4s and 5s, and finally revert to the left column at 5s. During this whole time, the red squares on the "2 event base" and "2 accessKeys" rows must be in the right column.
- In the first load of the document, immediately once the red square is clicked, it must move to the left column.
- In the first load of the document, immediately once "a" is pressed on the keyboard, the red square in the "2 accessKeys" row must move to the left column.
- In the second load of the document, five seconds after the red square is clicked, it must move to the left column.
- In the second load of the document, five seconds after "a" is pressed on the keyboard, the red square in the "2 accessKeys" row must move to the left column.

## Test Description

This tests validates multiple end conditions in the end attribute, assuming support for the <set> element and setting the dur attribute to 'indefinite'.

The test validates the various possibilities for the end attribute value: multiple offset values, multiple event base values, multiple sync base values, multiple repeat values, and multiple accessKey values. Finally, the test validates that end values of different kinds can be mixed.

The test shows 6 rows where a red rectangle's x attribute is animated with <set> elements.

On the first three rows, the red rectangles should show on the left from 0 to 1s. From 1 to 2s, the rectangles should show on the right. Then the rectangles should show on the left from 2 to 4s, then on the right again from 4 to 5s and come back to the left position and stay there after 5s.

On the fourth row, the rectangle's end condition is event based and requires a user click. One of the end condition is defined to be 5 seconds prior to the click and one is defined to be 5 seconds after the click. If the user clicks on the rectangle before 5 seconds (in document time), the red rectangle we move to the left position 5 seconds after the click (because the 'click - 5s' end time resolves to a time prior to the begin time). If the user clicks after 5 seconds (in document time), then the red rectangle moves to the left position immediately because the 'click - 5s' time resolves to a time after the begin time.

On the fifth row, the rectangle's end condition is accessKey based and requires a user to press the 'a' key. The behavior is exactly the same as for the previous row, except that the triggering event is the 'a' key press.

The last row's rectangle has a end condition with two offset values (1s;4s) and should behave like the rectangles of the first three rows for the first 5 seconds of the document's timeline. In addition, the end condition has a click event base and thus, the rectangle should immediately move to the left position if the user everytime the user clicks clicks on the rectangle when it is on the right position. Finally, the end condition also has an accessKey condition for the 'b' character. Thus, the rectangle should move to the left position every time the user presses the 'b' key and the rectangle is on the right position.

animate-elem-62-t ← index → animate-elem-64-t