animation-play-state-001-manual.html (1755B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>CSS Animations Test: animation-play-state - paused</title> 4 <link rel="author" title="Nokia Inc." href="http://www.nokia.com"> 5 <link rel="author" title="Intel" href="http://www.intel.com"> 6 <link rel="reviewer" title="Zhiqiang Zhang" href="mailto:zhiqiang.zhang@intel.com"> <!-- 2015-05-07 --> 7 <link rel="help" href="https://drafts.csswg.org/css-animations-1/#animation-name"> 8 <link rel="help" href="https://drafts.csswg.org/css-animations-1/#animation-duration"> 9 <link rel="help" href="https://drafts.csswg.org/css-animations-1/#animation-play-state"> 10 <meta name="flags" content="animated"> 11 <meta name="assert" content="When animation-play-state is set to paused, 12 animation is paused where the progress it had made 13 before being paused."> 14 <style> 15 #test-animation-paused { 16 animation-name: sample; 17 animation-duration: 10s; 18 19 background-color: blue; 20 height: 100px; 21 width: 100px; 22 position: relative; 23 } 24 25 #ref-path { 26 background-color: yellow; 27 height: 10px; 28 width: 250px; 29 position: relative; 30 } 31 32 @keyframes sample { 33 from { 34 left: 150px; 35 } 36 to { 37 left: 0px; 38 } 39 } 40 </style> 41 <body> 42 <p> 43 Test passes if there is a filled blue square with 'Filler Text', 44 which starts moving right to left along the yellow bar, 45 and pauses in the middle after about 2 seconds' animation. 46 </p> 47 <div id="test-animation-paused">Filler Text</div> 48 <div id="ref-path"></div> 49 <script> 50 setTimeout(setAnimationRunning, 2000); 51 52 function setAnimationRunning() { 53 var div = document.getElementsByTagName("div"); 54 div[0].style.animationPlayState = "paused"; 55 } 56 </script> 57 </body>