OLD | NEW |
---|---|
(Empty) | |
1 <!DOCTYPE html> | |
2 <meta charset=utf-8> | |
3 <title>Animating with KeyframeEffectReadOnly objects</title> | |
4 <script src="../../../resources/testharness.js"></script> | |
5 <script src="../../../resources/testharnessreport.js"></script> | |
6 <script src="../../../imported/wpt/web-animations/testcommon.js"></script> | |
alancutter (OOO until 2018)
2016/10/28 03:38:32
Not sure we need to depend on this library for a s
| |
7 <body> | |
8 <script> | |
9 "use strict"; | |
10 | |
11 async_test(function(t) { | |
12 var target = createDiv(t); | |
13 var effect = new KeyframeEffect(target, { opacity: [0, 0.9] }, 1000); | |
14 var anim = target.animate(null); | |
15 anim.effect = effect; | |
16 | |
17 var targetRO = createDiv(t); | |
18 var effectRO = new KeyframeEffectReadOnly( | |
19 targetRO, { opacity: [0, 0.9] }, 1000); | |
20 var animRO = targetRO.animate(null); | |
21 animRO.effect = effectRO; | |
22 | |
23 Promise.all([anim.ready, animRO.ready]).then(function() { | |
24 t.step(function() { | |
25 assert_true(internals.isCompositedAnimation(anim), | |
26 "Opacity animation with KeyframeEffect should be composited"); | |
27 assert_true(internals.isCompositedAnimation(animRO), | |
28 "Opacity animation with KeyframeEffectReadOnly should be" | |
29 + " composited"); | |
30 }); | |
31 t.done(); | |
alancutter (OOO until 2018)
2016/10/28 03:38:32
Nit: If you use promise_test() you can avoid the t
| |
32 }); | |
33 }, "Using KeyframeEffect or KeyframeEffectReadOnly should not change whether an" | |
34 + " animation is composited"); | |
35 | |
36 </script> | |
37 </body> | |
OLD | NEW |