| OLD | NEW |
| (Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <head> |
| 4 <style> |
| 5 |
| 6 div { |
| 7 position: absolute; |
| 8 height: 100px; |
| 9 width: 100px; |
| 10 } |
| 11 |
| 12 #div1 { |
| 13 z-index: 4; |
| 14 left: 100px; |
| 15 top: 200px; |
| 16 background-color: blue; |
| 17 } |
| 18 |
| 19 #div2 { |
| 20 z-index: 3; |
| 21 left: 200px; |
| 22 top: 200px; |
| 23 background-color: red; |
| 24 } |
| 25 |
| 26 #div3 { |
| 27 z-index: 2; |
| 28 left: 300px; |
| 29 top: 200px; |
| 30 background-color: purple; |
| 31 } |
| 32 |
| 33 </style> |
| 34 </head> |
| 35 <body> |
| 36 <p> |
| 37 Tests that composited animation happens when only transform or only translate is
present. |
| 38 <p> |
| 39 The 3 squares should equivalently move from top left to bot right. They need not
be perfectly in time. |
| 40 <p> |
| 41 Blue - Only Transform, Red = Only Translate, Purple - Transform + Translate |
| 42 |
| 43 <div id="div1"></div> |
| 44 <div id="div2"></div> |
| 45 <div id="div3"></div> |
| 46 |
| 47 <script> |
| 48 function startAnimations() { |
| 49 div1.animate([ |
| 50 {transform: 'translate(0px, 0px)'}, |
| 51 {transform: 'translate(400px, 400px)'} |
| 52 ], { |
| 53 duration: 1000, |
| 54 delay: 1000, |
| 55 fill: 'forwards' |
| 56 }); |
| 57 |
| 58 div2.animate([ |
| 59 {translate: '0px 0px'}, |
| 60 {translate: '400px 400px'} |
| 61 ], { |
| 62 duration: 1000, |
| 63 delay: 1000, |
| 64 fill: 'forwards' |
| 65 }); |
| 66 |
| 67 div3.animate([ |
| 68 {transform: 'translate(0px)', |
| 69 translate: '0px 0px'}, |
| 70 {transform: 'translate(400px)', |
| 71 translate: '0px 400px'} |
| 72 ], { |
| 73 duration: 1000, |
| 74 delay: 1000, |
| 75 fill: 'forwards' |
| 76 }); |
| 77 } |
| 78 |
| 79 requestAnimationFrame(startAnimations); |
| 80 |
| 81 </script> |
| 82 |
| 83 </body> |
| 84 </html> |
| OLD | NEW |