summaryrefslogtreecommitdiffstats
path: root/dom/animation/test/crashtests/1524480-1.html
blob: 89e5a412d9b0f8c741a0a490e6afb98217379a73 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<!doctype html>
<html class="reftest-wait">
<meta charset=utf-8>
<style>
div {
  display: none;
  width: 100px;
  height: 100px;
  background: blue;
}
</style>
<div id=div></div>
<script>
async function test() {
  const animation = div.animate({ transform: ['none', 'none'] }, 1000);
  animation.cancel();

  await waitForFrame();

  div.style.display = 'block';

  await waitForFrame();
  await waitForFrame();

  animation.play();
  await animation.finished;

  document.documentElement.className = "";
}

function waitForFrame() {
  return new Promise(resolve => requestAnimationFrame(resolve));
}

test();
</script>
</html>