| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <meta charset=utf-8> | 2 <meta charset=utf-8> |
| 3 <title>Animating with KeyframeEffectReadOnly objects</title> | 3 <title>Animating with KeyframeEffectReadOnly objects</title> |
| 4 <script src="../../../resources/testharness.js"></script> | 4 <script src="../../../resources/testharness.js"></script> |
| 5 <script src="../../../resources/testharnessreport.js"></script> | 5 <script src="../../../resources/testharnessreport.js"></script> |
| 6 <body> | 6 <body> |
| 7 <div id="target"></div> | 7 <div id="target">x</div> |
| 8 <div id="targetRO"></div> | 8 <div id="targetRO">x</div> |
| 9 <script> | 9 <script> |
| 10 "use strict"; | 10 "use strict"; |
| 11 | 11 |
| 12 promise_test(function(t) { | 12 promise_test(function(t) { |
| 13 var effect = new KeyframeEffect(target, { opacity: [0, 0.9] }, 1000); | 13 var effect = new KeyframeEffect(target, { opacity: [0, 0.9] }, 1000); |
| 14 var anim = target.animate(null); | 14 var anim = target.animate(null); |
| 15 anim.effect = effect; | 15 anim.effect = effect; |
| 16 | 16 |
| 17 var effectRO = new KeyframeEffectReadOnly( | 17 var effectRO = new KeyframeEffectReadOnly( |
| 18 targetRO, { opacity: [0, 0.9] }, 1000); | 18 targetRO, { opacity: [0, 0.9] }, 1000); |
| 19 var animRO = targetRO.animate(null); | 19 var animRO = targetRO.animate(null); |
| 20 animRO.effect = effectRO; | 20 animRO.effect = effectRO; |
| 21 | 21 |
| 22 return Promise.all([anim.ready, animRO.ready]).then(function() { | 22 return Promise.all([anim.ready, animRO.ready]).then(function() { |
| 23 assert_true(internals.isCompositedAnimation(anim), | 23 assert_true(internals.isCompositedAnimation(anim), |
| 24 "Opacity animation with KeyframeEffect should be composited"); | 24 "Opacity animation with KeyframeEffect should be composited"); |
| 25 assert_true(internals.isCompositedAnimation(animRO), | 25 assert_true(internals.isCompositedAnimation(animRO), |
| 26 "Opacity animation with KeyframeEffectReadOnly should be" | 26 "Opacity animation with KeyframeEffectReadOnly should be" |
| 27 + " composited"); | 27 + " composited"); |
| 28 }); | 28 }); |
| 29 }, "Using KeyframeEffect or KeyframeEffectReadOnly should not change whether an" | 29 }, "Using KeyframeEffect or KeyframeEffectReadOnly should not change whether an" |
| 30 + " animation is composited"); | 30 + " animation is composited"); |
| 31 | 31 |
| 32 </script> | 32 </script> |
| 33 </body> | 33 </body> |
| OLD | NEW |