12 Each section below has two boxes, the top runs on the main thread, the bottom
15 This test is successful if the boxes are mostly in sync and all finish at the
20 Add second translate animation on timeout (with fill=forwards)
22 <div id=
"test1_blink">BLINK THREAD
</div>
23 <div id=
"test1_impl">IMPL THREAD
</div>
26 Add second translate animation on timeout if first one was paused earlier
28 <div id=
"test2_blink">BLINK THREAD
</div>
29 <div id=
"test2_impl">IMPL THREAD
</div>
32 Add second translate animation on timeout if first one was finished earlier
34 <div id=
"test3_blink">BLINK THREAD
</div>
35 <div id=
"test3_impl">IMPL THREAD
</div>
38 Add second translate animation on timeout if first higher-priority one was paused earlier
40 <div id=
"test4_blink">BLINK THREAD
</div>
41 <div id=
"test4_impl">IMPL THREAD
</div>
49 var translateKeyframes
= [
50 {transform
: 'translateX(100px)'},
51 {transform
: 'translateX(600px)'}
54 var leftKeyframes2
= [
58 var translateKeyframes2
= [
59 {transform
: 'translateX(600px)'},
60 {transform
: 'translateX(700px)'}
63 var player1_blink
= test1_blink
.animate(leftKeyframes
, {
68 var player1_impl
= test1_impl
.animate(translateKeyframes
, {
74 var player2_blink
= test2_blink
.animate(leftKeyframes
, {
78 var player2_impl
= test2_impl
.animate(translateKeyframes
, {
83 var player3_blink
= test3_blink
.animate(leftKeyframes
, {
87 var player3_impl
= test3_impl
.animate(translateKeyframes
, {
92 // Create detached lower-priority second player with short animation
93 var player4_blink2
= test4_blink
.animate(leftKeyframes2
, {
97 player4_blink2
.cancel();
98 var player4_impl2
= test4_impl
.animate(translateKeyframes2
, {
102 player4_impl2
.cancel();
104 var player4_blink
= test4_blink
.animate(leftKeyframes
, {
108 var player4_impl
= test4_impl
.animate(translateKeyframes
, {
113 setTimeout(function() {
114 player2_blink
.pause();
115 player2_impl
.pause();
117 player3_blink
.finish();
118 player3_impl
.finish();
120 player4_blink
.pause();
121 player4_impl
.pause();
124 setTimeout(function() {
125 var player1_blink2
= test1_blink
.animate(leftKeyframes2
, {
130 var player1_impl2
= test1_impl
.animate(translateKeyframes2
, {
136 var player2_blink2
= test2_blink
.animate(leftKeyframes2
, {
140 var player2_impl2
= test2_impl
.animate(translateKeyframes2
, {
145 var player3_blink2
= test3_blink
.animate(leftKeyframes2
, {
149 var player3_impl2
= test3_impl
.animate(translateKeyframes2
, {
154 player4_blink2
.play();
155 player4_impl2
.play();