animation-valid.html (2337B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <meta charset="utf-8"> 5 <title>CSS Animations: parsing animation with valid values</title> 6 <link rel="help" href="https://drafts.csswg.org/css-animations/#propdef-animation"> 7 <meta name="assert" content="animation supports the full grammar '<single-animation> #'."> 8 <script src="/resources/testharness.js"></script> 9 <script src="/resources/testharnessreport.js"></script> 10 <script src="/css/support/parsing-testcommon.js"></script> 11 </head> 12 <body> 13 <script> 14 // <single-animation> = <time> || <easing-function> || <time> || 15 // <single-animation-iteration-count> || <single-animation-direction> || 16 // <single-animation-fill-mode> || <single-animation-play-state> || 17 // [ none | <keyframes-name> ] 18 test_valid_value("animation", "1s", ["1s", "1s ease 0s 1 normal none running none"]); 19 test_valid_value("animation", "cubic-bezier(0, -2, 1, 3)", ["cubic-bezier(0, -2, 1, 3)", "auto cubic-bezier(0, -2, 1, 3) 0s 1 normal none running none"]); 20 test_valid_value("animation", "cubic-bezier( 0, -2, 1, 3 )", ["cubic-bezier(0, -2, 1, 3)", "auto cubic-bezier(0, -2, 1, 3) 0s 1 normal none running none"]); 21 test_valid_value("animation", "1s -3s", ["1s -3s", "1s ease -3s 1 normal none running none"]); 22 test_valid_value("animation", "4", ["4", "auto ease 0s 4 normal none running none"]); 23 test_valid_value("animation", "reverse", ["reverse", "auto ease 0s 1 reverse none running none"]); 24 test_valid_value("animation", "both", ["both", "auto ease 0s 1 normal both running none"]); 25 test_valid_value("animation", "paused", ["paused", "auto ease 0s 1 normal none paused none"]); 26 test_valid_value("animation", "none", ["auto", "none", "auto ease 0s 1 normal none running none"]); 27 test_valid_value("animation", "anim", ["anim", "auto ease 0s 1 normal none running anim"]); 28 29 test_valid_value("animation", "anim paused both reverse 4 1s -3s cubic-bezier(0, -2, 1, 3)", 30 "1s cubic-bezier(0, -2, 1, 3) -3s 4 reverse both paused anim"); 31 32 test_valid_value("animation", "anim paused both reverse, 4 1s -3s cubic-bezier(0, -2, 1, 3)", 33 ["reverse both paused anim, 1s cubic-bezier(0, -2, 1, 3) -3s 4", "auto ease 0s 1 reverse both paused anim, 1s cubic-bezier(0, -2, 1, 3) -3s 4 normal none running none"]); 34 35 // TODO: Add test with a single negative time. 36 // TODO: Add test with a single timing-function keyword. 37 </script> 38 </body> 39 </html>