Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /css/css-animations/keyframes-rule-caching.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<title>Tests that given two identical sheets containing the same @keyframes rule, modifying one sheet doesn't affect the other sheet</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<style id="style1">
@keyframes --anim {
from { color: red; }
to { color: black; }
}
</style>
<style id="style2">
@keyframes --anim {
from { color: red; }
to { color: black; }
}
</style>
<script>
test(() => {
style1.sheet.cssRules[0].cssRules[1].style.color = "green";
assert_equals(style1.sheet.cssRules[0].cssRules[1].style.color, "green", "sheet1 keyframe changed");
assert_equals(style2.sheet.cssRules[0].cssRules[1].style.color, "black", "sheet2 keyframe did not change");
}, "Modifying one sheet should not affect the other");
</script>