local-time.html (929B)
1 <!DOCTYPE html> 2 <meta charset=utf-8> 3 <title>Local time</title> 4 <link rel="help" href="https://drafts.csswg.org/web-animations/#local-time"> 5 <script src="/resources/testharness.js"></script> 6 <script src="/resources/testharnessreport.js"></script> 7 <script src="../../testcommon.js"></script> 8 <body> 9 <script> 10 'use strict'; 11 12 test(t => { 13 const anim = createDiv(t).animate(null, 10 * MS_PER_SEC); 14 for (const seconds of [-1, 0, 5, 10, 20]) { 15 anim.currentTime = seconds * MS_PER_SEC; 16 assert_equals( 17 anim.effect.getComputedTiming().localTime, 18 seconds * MS_PER_SEC 19 ); 20 } 21 }, 'Local time is current time for animation effects associated with an animation'); 22 23 test(t => { 24 const effect = new KeyframeEffect(createDiv(t), null, 10 * MS_PER_SEC); 25 assert_equals(effect.getComputedTiming().localTime, null); 26 }, 'Local time is unresolved for animation effects not associated with an animation'); 27 28 </script> 29 </body>