blob: b6d7fcfd751a1306a3b288a3dc6d85edbc8d3f5d [file] [edit]
<!DOCTYPE html>
<title>Tests that given two identical sheets containing the same @keyframes rule, modifying one sheet doesn't affect the other sheet</title>
<link rel="help" href="https://drafts.csswg.org/css-animations/#interface-csskeyframesrule">
<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>