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-item-in-keyframe.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<title>CSS Values and Units Test: random-item() in @keyframes</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<style>
@keyframes --anim {
from {
color: rgb(0, 0, 0);
color: random-item(fixed 0, rgb(1, 0, 0), rgb(0, 1, 0));
}
to {
color: rgb(0, 0, 0);
}
}
#target {
animation: --anim 1000s step-end;
}
</style>
<div id="target"></div>
<script>
test(() => {
assert_equals(getComputedStyle(target).color, "rgb(1, 0, 0)");
}, "random-item() is not ignored in a keyframe");
</script>