| OLD | NEW |
| (Empty) |
| 1 <!DOCTYPE html> | |
| 2 <meta charset=utf-8> | |
| 3 <title>Model liveness: currentTime will not change in a task (frames)</title> | |
| 4 <link rel="help" href="https://w3c.github.io/web-animations/#model-liveness"> | |
| 5 <script src="../resources/testharness.js"></script> | |
| 6 <script src="../resources/testharnessreport.js"></script> | |
| 7 <script src="../external/wpt/web-animations/testcommon.js"></script> | |
| 8 | |
| 9 <iframe id=frame></iframe> | |
| 10 | |
| 11 <script> | |
| 12 var handle = async_test('Document timeline should tick consistently across frame
s'); | |
| 13 var baseTime = document.timeline.currentTime; | |
| 14 var frameBaseTime = frame.contentDocument.timeline.currentTime; | |
| 15 setTimeout(() => { | |
| 16 // Ensure that time in this task has advanced sufficiently for implementations | |
| 17 // that might bind the currentTime lazily. | |
| 18 var start = performance.now(); | |
| 19 while (performance.now() - start < 30); | |
| 20 var delta = document.timeline.currentTime - baseTime; | |
| 21 | |
| 22 // Advance time further before querying the frame's time. | |
| 23 var start = performance.now(); | |
| 24 while (performance.now() - start < 30); | |
| 25 var frameDelta = frame.contentDocument.timeline.currentTime - frameBaseTime; | |
| 26 | |
| 27 handle.step(() => assert_times_equal(delta, frameDelta)); | |
| 28 handle.done(); | |
| 29 }); | |
| 30 </script> | |
| OLD | NEW |