Automatic update from web-platform-tests Properly clone and reattach @keyframes rules The rules not being properly deep-cloned as CSSOM wrappers reattached lead to modifications being applied to multiple stylesheets initially sharing a StyleSheetContents instance. Bug: 514449396 Change-Id: Ia78191430974e6263ad3afca19d9a0d2a39f170b Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7865248 Commit-Queue: Rune Lillesveen <futhark@chromium.org> Reviewed-by: Kevin Babbitt <kbabbitt@microsoft.com> Cr-Commit-Position: refs/heads/main@{#1634779} -- wpt-commits: b2be13960680942e71fbf2a4f16b0695885b3af1 wpt-pr: 60089
25 lines
938 B
HTML
25 lines
938 B
HTML
<!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>
|