OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <script src="../resources/testharness.js"></script> | 2 <script src="../resources/testharness.js"></script> |
3 <script src="../resources/testharnessreport.js"></script> | 3 <script src="../resources/testharnessreport.js"></script> |
4 | 4 |
5 <body> | 5 <body> |
6 <div id='e'></div> | 6 <div id='e'></div> |
7 </body> | 7 </body> |
8 | 8 |
9 <script> | 9 <script> |
10 var element = document.getElementById('e'); | 10 var element = document.getElementById('e'); |
11 var keyframes = [{opacity: '1', offset: 0}, {opacity: '0', offset: 1}]; | 11 var keyframes = [{opacity: '1', offset: 0}, {opacity: '0', offset: 1}]; |
12 | 12 |
13 var animationBasic = new Animation(element, keyframes); | 13 var keyframeEffectBasic = new KeyframeEffect(element, keyframes); |
14 var specifiedTimingBasic = animationBasic.timing; | 14 var specifiedTimingBasic = keyframeEffectBasic.timing; |
15 | 15 |
16 var timingNumberDuration = {duration: 2}; | 16 var timingNumberDuration = {duration: 2}; |
17 var animationNumberDuration = new Animation(element, keyframes, timingNumberDura
tion); | 17 var animationNumberDuration = new KeyframeEffect(element, keyframes, timingNumbe
rDuration); |
18 var specifiedTimingNumberDuration = animationNumberDuration.timing; | 18 var specifiedTimingNumberDuration = animationNumberDuration.timing; |
19 | 19 |
20 var timingNoDuration = {iterations: 3}; | 20 var timingNoDuration = {iterations: 3}; |
21 var animationNoDuration = new Animation(element, keyframes, timingNoDuration); | 21 var animationNoDuration = new KeyframeEffect(element, keyframes, timingNoDuratio
n); |
22 var specifiedTimingNoDuration = animationNoDuration.timing; | 22 var specifiedTimingNoDuration = animationNoDuration.timing; |
23 | 23 |
24 var timingAllFields = { | 24 var timingAllFields = { |
25 delay: 2, | 25 delay: 2, |
26 endDelay: 0.5, | 26 endDelay: 0.5, |
27 fill: 'backwards', | 27 fill: 'backwards', |
28 iterationStart: 2, | 28 iterationStart: 2, |
29 iterations: 10, | 29 iterations: 10, |
30 duration: 5, | 30 duration: 5, |
31 playbackRate: 2, | 31 playbackRate: 2, |
32 direction: 'reverse', | 32 direction: 'reverse', |
33 easing: 'step-start' | 33 easing: 'step-start' |
34 }; | 34 }; |
35 var animationAllFields = new Animation(element, keyframes, timingAllFields); | 35 var animationAllFields = new KeyframeEffect(element, keyframes, timingAllFields)
; |
36 var specifiedTimingAllFields = animationAllFields.timing; | 36 var specifiedTimingAllFields = animationAllFields.timing; |
37 | 37 |
38 test(function() { | 38 test(function() { |
39 assert_equals(specifiedTimingBasic.constructor, Timing); | 39 assert_equals(specifiedTimingBasic.constructor, AnimationEffectTiming); |
40 assert_equals(specifiedTimingBasic.delay, 0); | 40 assert_equals(specifiedTimingBasic.delay, 0); |
41 assert_equals(specifiedTimingBasic.endDelay, 0); | 41 assert_equals(specifiedTimingBasic.endDelay, 0); |
42 assert_equals(specifiedTimingBasic.fill, 'auto'); | 42 assert_equals(specifiedTimingBasic.fill, 'auto'); |
43 assert_equals(specifiedTimingBasic.iterationStart, 0); | 43 assert_equals(specifiedTimingBasic.iterationStart, 0); |
44 assert_equals(specifiedTimingBasic.iterations, 1); | 44 assert_equals(specifiedTimingBasic.iterations, 1); |
45 assert_equals(specifiedTimingBasic.duration, 'auto'); | 45 assert_equals(specifiedTimingBasic.duration, 'auto'); |
46 assert_equals(specifiedTimingBasic.playbackRate, 1); | 46 assert_equals(specifiedTimingBasic.playbackRate, 1); |
47 assert_equals(specifiedTimingBasic.direction, 'normal'); | 47 assert_equals(specifiedTimingBasic.direction, 'normal'); |
48 assert_equals(specifiedTimingBasic.easing, 'linear'); | 48 assert_equals(specifiedTimingBasic.easing, 'linear'); |
49 }, 'TimedItem.timing should return a TimedItemTiming, which should have a getter
for each member of the underlying Timing object.'); | 49 }, 'TimedItem.timing should return a TimedItemTiming, which should have a getter
for each member of the underlying Timing object.'); |
(...skipping 11 matching lines...) Expand all Loading... |
61 assert_equals(specifiedTimingAllFields.endDelay, 0.5); | 61 assert_equals(specifiedTimingAllFields.endDelay, 0.5); |
62 assert_equals(specifiedTimingAllFields.fill, 'backwards'); | 62 assert_equals(specifiedTimingAllFields.fill, 'backwards'); |
63 assert_equals(specifiedTimingAllFields.iterationStart, 2); | 63 assert_equals(specifiedTimingAllFields.iterationStart, 2); |
64 assert_equals(specifiedTimingAllFields.iterations, 10); | 64 assert_equals(specifiedTimingAllFields.iterations, 10); |
65 assert_equals(specifiedTimingAllFields.duration, 5); | 65 assert_equals(specifiedTimingAllFields.duration, 5); |
66 assert_equals(specifiedTimingAllFields.playbackRate, 2); | 66 assert_equals(specifiedTimingAllFields.playbackRate, 2); |
67 assert_equals(specifiedTimingAllFields.direction, 'reverse'); | 67 assert_equals(specifiedTimingAllFields.direction, 'reverse'); |
68 assert_equals(specifiedTimingAllFields.easing, 'step-start'); | 68 assert_equals(specifiedTimingAllFields.easing, 'step-start'); |
69 }, 'TimedItem.timing should have a getter for each member of the underlying Timi
ng object.'); | 69 }, 'TimedItem.timing should have a getter for each member of the underlying Timi
ng object.'); |
70 </script> | 70 </script> |
OLD | NEW |