summaryrefslogtreecommitdiffstats
path: root/layout/reftests/bugs/1425243-1.html
blob: c1f99540a8bd449fa4e5b6ecb7655dc7447d2e08 (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
39
40
41
<html class="reftest-wait">
<style>
.logo {
    display: flex;
    align-items: center;
    background-color: #4a4a4a;
    mask: url(pinwheel_logo.svg) center center/contain no-repeat;
    width: 60px;
    height: 60px;
}
.logo .background {
    background-image: linear-gradient(red, green);
    width: 65px;
    height: 65px;
    background-size: cover;
    background-position: 50%;
    will-change: transform;
}
</style>
<a class="logo">
    <span class="background"></span>
</a>
<script>
function doTest() {
  var i = 0;
  var e = document.getElementsByClassName("background")[0];
  var rotator = function() {
    var rotation = i / 60;
    e.style.transform = "rotate(" + rotation + "turn)";
    if (i < 45) {
      i += 1;
      window.requestAnimationFrame(rotator);
    } else {
      document.documentElement.removeAttribute("class");
    }
  };
  window.requestAnimationFrame(rotator);
};
window.addEventListener("MozReftestInvalidate", doTest);
</script>
</html>