OLD | NEW |
(Empty) | |
| 1 <html> |
| 2 <style> |
| 3 div { |
| 4 position: relative; |
| 5 height: 100px; |
| 6 width: 100px; |
| 7 background: blue; |
| 8 } |
| 9 </style> |
| 10 <body> |
| 11 <p> |
| 12 Each section below has two boxes, the top runs on the main thread, the bottom |
| 13 on the compositor. |
| 14 </p><p> |
| 15 This test is successful if the boxes are mostly in sync and all finish at the |
| 16 same time. |
| 17 </p> |
| 18 <hr> |
| 19 |
| 20 Steps for easing timing function is set to 9 |
| 21 <br> |
| 22 <div id="test1a">MT</div> |
| 23 <div id="test1b">CT</div> |
| 24 <hr> |
| 25 |
| 26 Per-keyframe steps easing function |
| 27 <br> |
| 28 <div id="test2a">MT</div> |
| 29 <div id="test2b">CT</div> |
| 30 |
| 31 Steps easing function combined with a cubic-bezier keyframe |
| 32 (FIXME: the combining of timing functions is not fully supported in CT) |
| 33 <br> |
| 34 <div id="test3a">MT</div> |
| 35 <div id="test3b">CT</div> |
| 36 |
| 37 <script> |
| 38 var transformKeyframes = [ |
| 39 {transform: 'translateX(0px)'}, |
| 40 {transform: 'translateX(500px)'} |
| 41 ]; |
| 42 var leftKeyframes = [ |
| 43 {left: '0'}, |
| 44 {left: '500px'} |
| 45 ]; |
| 46 var player1a = test1a.animate(leftKeyframes, { |
| 47 duration: 6000, |
| 48 iterations: Infinity, |
| 49 easing: 'steps(9)' |
| 50 }); |
| 51 var player1b = test1b.animate(transformKeyframes, { |
| 52 duration: 6000, |
| 53 iterations: Infinity, |
| 54 easing: 'steps(9)' |
| 55 }); |
| 56 |
| 57 var transformKeyframesEasing = [ |
| 58 {transform: 'translateX(0px)', easing: 'steps(18)'}, |
| 59 {transform: 'translateX(250px)', easing: 'steps(9)'}, |
| 60 {transform: 'translateX(500px)'} |
| 61 ]; |
| 62 var leftKeyframesEasing = [ |
| 63 {left: '0', easing: 'steps(18)'}, |
| 64 {left: '250px', easing: 'steps(9)'}, |
| 65 {left: '500px'} |
| 66 ]; |
| 67 var player2a = test2a.animate(leftKeyframesEasing, { |
| 68 duration: 6000, |
| 69 iterations: Infinity |
| 70 }); |
| 71 var player2b = test2b.animate(transformKeyframesEasing, { |
| 72 duration: 6000, |
| 73 iterations: Infinity |
| 74 }); |
| 75 |
| 76 var transformKeyframesCombinedEasing = [ |
| 77 {transform: 'translateX(0px)', easing: 'cubic-bezier(.5, -1, .5, 2)'}, |
| 78 {transform: 'translateX(500px)'} |
| 79 ]; |
| 80 var leftKeyframesCombinedEasing = [ |
| 81 {left: '0', easing: 'cubic-bezier(.5, -1, .5, 2)'}, |
| 82 {left: '500px'} |
| 83 ]; |
| 84 var player3a = test3a.animate(leftKeyframesCombinedEasing, { |
| 85 duration: 6000, |
| 86 iterations: Infinity, |
| 87 easing: 'steps(9)' |
| 88 }); |
| 89 var player3b = test3b.animate(transformKeyframesCombinedEasing, { |
| 90 duration: 6000, |
| 91 iterations: Infinity, |
| 92 easing: 'steps(9)' |
| 93 }); |
| 94 </script> |
| 95 </body> |
| 96 </html> |
OLD | NEW |