summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/animations/zoom-responsive-transform-animation.html
blob: 88527dbb9538f1d9cf0333d7089ff9ad4e430839 (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
42
43
44
45
46
47
48
49
50
51
52
53
54
<!DOCTYPE html>
<style>
#container {
  position: absolute;
  top: 0;
  font-size: 10px;
}
.target {
  width: 40px;
  height: 40px;
  border-top: solid;
  border-left: solid;
  margin-bottom: 20px;
}
</style>
<div id="container"></div>
<script>
[
  'perspective(200px) translate3D(10px, 10px, 10px)',
  'matrix(0, 1, 1, 0, 10, 10)',
  'matrix3d(' +
    '0, 1, 0, 0, ' +
    '1, 0, 0, 0, ' +
    '0, 0, 1, 0, ' +
    '10, 10, 10, 1)',
  'perspective(200px) rotateY(45deg)',
  'none',
].forEach(transform => {
  var text = document.createElement('div');
  text.textContent = transform;
  container.appendChild(text);

  var target = document.createElement('div');
  target.classList.add('target');
  container.appendChild(target);
  target.animate([
    {transform: transform},
    {transform: transform},
  ], 1e8);
});

if (window.testRunner)
  testRunner.waitUntilDone();

requestAnimationFrame(() => {
  requestAnimationFrame(() => {
    internals.setZoomFactor(2);
    requestAnimationFrame(() => {
      if (window.testRunner)
        testRunner.notifyDone();
    });
  });
});
</script>