Revision control

1
<!DOCTYPE html>
2
<meta charset=utf-8>
3
<title>Crash accessing a CSSAnimation's current time after setting its effect to null</title>
4
<style>
5
@keyframes animation {
6
from {
7
margin-left: 0px;
8
}
9
to {
10
margin-left: 100px;
11
}
12
}
13
</style>
14
<body>
15
<script src="../resources/testharness.js"></script>
16
<script src="../resources/testharnessreport.js"></script>
17
<script>
18
19
'use strict';
20
21
test(t => {
22
const target = document.body.appendChild(document.createElement("div"));
23
target.style.animation = "animation 1s";
24
25
const animations = target.getAnimations();
26
assert_equals(animations.length, 1, "The target element has one animation.");
27
28
const animation = animations[0];
29
animation.effect = null;
30
31
assert_equals(animation.currentTime, 0, "The animation's current time is 0 after removing its effect.");
32
}, "Current time is 0 after removing its effect.");
33
34
</script>
35
</body>