summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/animations/restart-not-visible.html
blob: f8c094b7f80d1bc2a18698eb3e2fd7394575be62 (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
<!DOCTYPE html>
<style>
.run {
  animation: foo 1s infinite alternate;
}

@keyframes foo {
  100% {
    transform: translateX(100px)
  }
}
</style>
<div id="target"></div>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<script>
var test = async_test('Race between visibility and set compositor pending should not crash');
requestAnimationFrame(t => {
  requestAnimationFrame(t => {
    target.classList.add('run');
    setTimeout(() => {
      testRunner.setPageVisibility("hidden");
      target.style.transform = 'translateX(50px)';
      target.offsetTop;
      setTimeout(() => {
        test.done();
      }, 0);
    }, 0);
  });
});
</script>