Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <body> | 2 <meta charset=utf-8> |
| 3 <title>Canceling an animation: finish event</title> | |
| 4 <link rel="help" href="https://w3c.github.io/web-animations/#canceling-an-animat ion-section"> | |
| 3 <script src="../resources/testharness.js"></script> | 5 <script src="../resources/testharness.js"></script> |
| 4 <script src="../resources/testharnessreport.js"></script> | 6 <script src="../resources/testharnessreport.js"></script> |
| 7 <body> | |
| 5 <script> | 8 <script> |
| 6 var anim1 = document.body.animate([], 100000); | 9 var anim1 = document.body.animate([], 100000); |
| 7 var anim2 = document.body.animate([], 100000); | 10 var anim2 = document.body.animate([], 100000); |
| 8 var anim3 = document.body.animate([], 100000); | 11 var anim3 = document.body.animate([], 100000); |
|
alancutter (OOO until 2018)
2016/07/12 03:54:00
Use Infinity for duration.
| |
| 9 | 12 |
| 10 var noFinish = async_test('Animation finish event should not fire when cancelled '); | 13 var noFinish = async_test('Animation finish event should not fire when cancelled '); |
| 11 | 14 |
| 12 anim1.onfinish = function() { | 15 anim1.onfinish = function() { |
|
alancutter (OOO until 2018)
2016/07/12 03:54:00
We should use the finished promise as that is pref
| |
| 13 noFinish.step(function() { | 16 noFinish.step(function() { |
| 14 anim3.finish(); | 17 anim3.finish(); |
| 15 }); | 18 }); |
| 16 }; | 19 }; |
| 17 | 20 |
| 18 anim2.onfinish = function() { | 21 anim2.onfinish = function() { |
| 19 noFinish.step(function() { | 22 noFinish.step(function() { |
| 20 assert_true(false); | 23 assert_true(false); |
|
alancutter (OOO until 2018)
2016/07/12 04:38:25
Use t.unreached_func('message').
Wrap this entire
| |
| 21 }); | 24 }); |
| 22 }; | 25 }; |
| 23 | 26 |
| 24 anim3.onfinish = function() { | 27 anim3.onfinish = function() { |
| 25 noFinish.done(); | 28 noFinish.done(); |
| 26 }; | 29 }; |
| 27 | 30 |
| 28 anim1.finish(); | 31 anim1.finish(); |
| 29 anim2.cancel(); | 32 anim2.cancel(); |
| 30 </script> | 33 </script> |
| OLD | NEW |