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'); |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 assert_equals(animation.computedTiming.endTime, 17); | 56 assert_equals(animation.computedTiming.endTime, 17); |
57 assert_equals(animation.computedTiming.duration, 3); | 57 assert_equals(animation.computedTiming.duration, 3); |
58 assert_equals(animation.computedTiming.activeDuration, 12); | 58 assert_equals(animation.computedTiming.activeDuration, 12); |
59 }, 'TimedItem startTime, endTime, duration, activeDuration are sensible for anim
ations with delays and iterations'); | 59 }, 'TimedItem startTime, endTime, duration, activeDuration are sensible for anim
ations with delays and iterations'); |
60 | 60 |
61 test(function() { | 61 test(function() { |
62 var animation = new Animation(element, keyframes, {delay: 1}); | 62 var animation = new Animation(element, keyframes, {delay: 1}); |
63 assert_equals(animation.computedTiming.duration, 0); | 63 assert_equals(animation.computedTiming.duration, 0); |
64 }, 'TimedItem duration is calculated when no duration is specified'); | 64 }, 'TimedItem duration is calculated when no duration is specified'); |
65 | 65 |
| 66 test(function() { |
| 67 var timing = new Animation(element, keyframes).timing; |
| 68 for (var attr of ['delay', 'endDelay', 'iterationStart', 'playbackRate']) { |
| 69 assert_throws(new TypeError, function() { timing[attr] = NaN; }, attr); |
| 70 assert_throws(new TypeError, function() { timing[attr] = Infinity; }, attr); |
| 71 } |
| 72 }, 'Restricted double attributes on the Timing interface throws for non-finite v
alues.'); |
| 73 |
66 </script> | 74 </script> |
OLD | NEW |