random-in-keyframe.html (643B)
1 <!DOCTYPE html> 2 <title>CSS Values and Units Test: random() in @keyframes</title> 3 <link rel="help" href="https://drafts.csswg.org/css-values-5/#random"> 4 <script src="/resources/testharness.js"></script> 5 <script src="/resources/testharnessreport.js"></script> 6 <style> 7 @keyframes --anim { 8 from { 9 translate: 0px; 10 translate: random(2px, 200px); 11 } 12 to { 13 translate: 0px; 14 } 15 } 16 #target { 17 animation: --anim 1000s step-end; 18 } 19 </style> 20 <div id="target"></div> 21 <script> 22 test(() => { 23 assert_not_equals(getComputedStyle(target).translate, "0px"); 24 }, "random() is not ignored in keyframe"); 25 </script>