This tests validates multiple begin conditions in the begin attribute, assuming support for the <set> element and setting the fill attribute on a <rect> element.
The test validates the various possibilities for the begin 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 begin 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 begin condition is event based and requires a user click. After the user clicks on the rectangle, the rectangle should move to the right position for 1s, then move back to the left position for 3 seconds, move again to the right position for 1 second before going back to the left position.
On the fifth row, the rectangle's begin condition is accessKey based and requires a user to press the 'a' key. After the user presses that key the rectangle should move to the right position for 1s, then move back to the left position for 3 seconds, move again to the right position for 1 second before going back to the left position.
The last row's rectangle has a begin 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 begin condition has a click event base and thus, the rectangle should move to the right position for one second every time the user clicks on it. Finally, the begin condition also has an accessKey condition for the 'b' character. Thus, the rectangle should move to the right position every time the user presses the 'b' key.
Run the test. Observe the document for a least six seconds. Then, click on the left square in the "2 event base" row and wait for another six seconds while observing. Then, press "a" on the keyboard and wait for another six seconds while observing.
The test passes if all of the following conditions are met: