| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <style> | 2 <style> |
| 3 div { | 3 div { |
| 4 position: absolute; | 4 position: absolute; |
| 5 width: 100px; | 5 width: 100px; |
| 6 height: 100px; | 6 height: 100px; |
| 7 } | 7 } |
| 8 #target { | 8 #target { |
| 9 background: red; | 9 background: red; |
| 10 opacity: 1; | 10 opacity: 1; |
| 11 animation: test 1e8s; | 11 animation: test 1e8s; |
| 12 } | 12 } |
| 13 #green { | 13 #green { |
| 14 background: green; | 14 background: green; |
| 15 } | 15 } |
| 16 @keyframes test { | 16 @keyframes test { |
| 17 to { opacity: 0.5; } | 17 to { opacity: 0; } |
| 18 } | 18 } |
| 19 </style> | 19 </style> |
| 20 <div id="green"></div> | 20 <div id="green"></div> |
| 21 <div id="target"></div> | 21 <div id="target"></div> |
| 22 <script> | 22 <script> |
| 23 if (window.testRunner) | 23 if (window.testRunner) |
| 24 testRunner.waitUntilDone(); | 24 testRunner.waitUntilDone(); |
| 25 | 25 |
| 26 requestAnimationFrame(() => { | 26 function waitForCompositor() { |
| 27 requestAnimationFrame(() => { | 27 return target.animate({transform: ['none', 'none']}, 1).ready; |
| 28 target.style.opacity = 0; | 28 } |
| 29 requestAnimationFrame(() => { | 29 |
| 30 if (window.testRunner) | 30 waitForCompositor().then(() => { |
| 31 testRunner.notifyDone(); | 31 target.style.opacity = '0'; |
| 32 }); | 32 }).then(() => waitForCompositor()).then(() => { |
| 33 }); | 33 if (window.testRunner) |
| 34 testRunner.notifyDone(); |
| 34 }); | 35 }); |
| 35 </script> | 36 </script> |
| OLD | NEW |