blob: 47d2dfc6b5ab4013d300543e9b5d50edc3e6a477 [file] [log] [blame]
<!doctype html>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<style>
@keyframes anim {
}
#target {
width: 100px;
height: 100px;
background-color: red;
}
</style>
<div id="target"></div>
<script>
test(function() {
var rules = document.styleSheets[0].rules;
for (var i = 0; i < rules.length; i++) {
if (rules[i].type == CSSRule.KEYFRAMES_RULE) {
rules[i].appendRule('100% { background-color: green; }');
}
}
target.style.animation = 'anim 0s forwards';
assert_equals(getComputedStyle(target).backgroundColor, 'rgb(0, 128, 0)', 'background color');
}, "Check that appendRule is working");
</script>