summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-backgrounds/animations/two-background-color-animation-diff-length1.html
blob: d49ac0828c089f6e561767466b4f9cc1973c345f (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
38
<!DOCTYPE html>
<html class="reftest-wait">
<link rel="help" href="https://drafts.csswg.org/css-backgrounds-3/#background-color">
<link rel="match" href="two-background-color-animation-diff-length1-ref.html">
<style>
.container {
  width: 100px;
  height: 100px;
  background-color: green;
  animation: bgcolor2 10s steps(2, end), bgcolor1 0.001s steps(2, end);
}
@keyframes bgcolor1 {
  0% { background-color: rgb(0, 200, 0); }
  100% { background-color: rgb(200, 0, 0); }
}
@keyframes bgcolor2 {
  0% { background-color: rgb(0, 0, 199); }
  100% { background-color: rgb(0, 0, 200); }
}
</style>
<script src="/common/reftest-wait.js"></script>
<script src="../../../web-animations/testcommon.js"></script>
<body>
<div class="container"></div>

<script>
// This test ensures that if we have two different-length animation, when the
// one with higher compositing order finishes, the other one would still run
// normally.
const animations = document.getAnimations();
Promise.all([animations[0].ready, animations[1].ready]).then(() => {
  waitForAnimationFrames(3).then(() => {
    takeScreenshot();
  });
});
</script>
</body>
</html>