summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/animations/animation-offscreen-to-onscreen.html
blob: a5d14f0cdc58e30c675cedaa76997dd9c8ae0a57 (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
<html>
<head>
  <style type="text/css" media="screen">
    body {
      margin: 0;
    }

    #box {
      position: absolute;
      left: 0px;
      top: 100px;
      height: 100px;
      width: 100px;
      margin: 0;
      background-color: green;
      transform: translate(-2000px, 0px);
      -webkit-animation-duration: 1s;
      -webkit-animation-direction: normal;
      -webkit-animation-timing-function: linear;
      -webkit-animation-name: anim;
    }
    @-webkit-keyframes anim {
        0% { transform: translate(100px, 0px); }
      100% { transform: translate(100px, 0px); }
    }
  </style>
  <script src="resources/animation-test-helpers.js" type="text/javascript"></script>
  <script type="text/javascript" charset="utf-8">
    if (window.testRunner) {
        window.testRunner.dumpAsTextWithPixelResults();
    }

    const expectedValues = [
      // [time, element-id, property, expected-value, tolerance]
      [0.5, "box", "webkitTransform", [1, 0, 0, 1, 100, 0], 0.002],
    ];

    const doPixelTest = true;
    const disablePauseAnimationAPI = false;
    runAnimationTest(expectedValues, null, null, disablePauseAnimationAPI, doPixelTest);
  </script>
</head>
<body>
<div id="box"></div>
<div id="result"></div>
</body>
</html>