Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test has a WPT meta file that expects 1 subtest issues.
- This WPT test may be referenced by the following Test IDs:
- /css/css-values/random-in-keyframe.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<title>CSS Values and Units Test: random() in @keyframes</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<style>
@keyframes --anim {
from {
translate: 0px;
translate: random(2px, 200px);
}
to {
translate: 0px;
}
}
#target {
animation: --anim 1000s step-end;
}
</style>
<div id="target"></div>
<script>
test(() => {
assert_not_equals(getComputedStyle(target).translate, "0px");
}, "random() is not ignored in keyframe");
</script>