summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/compositing/iframes/composited-iframe-scroll.html
blob: 78df5e82a28ab347815ef1b9454a97f9fa638d03 (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
55
56
57
58
59
60
61
62
<!DOCTYPE html>

<html>
<head>
  <style type="text/css" media="screen">
    body {
      margin: 0;
    }
    
    iframe {
      height: 200px;
      width: 200px;
      margin: 10px;
      padding: 10px;
      border: none;
      transform: translateX(100px);
    }
    
    .container {
      position: absolute;
      top: 100px;
      transform: translateZ(0);
    }
    
    #indicator {
      position: absolute;
      top: 120px;
      left: 120px;
      height: 200px;
      width: 200px;
      background-color: red;
    }
  </style>
  <script type="text/javascript" charset="utf-8">
    
    if (window.testRunner)
      testRunner.waitUntilDone();

    function doTest()
    {
      window.setTimeout(function() {
        var iframe = document.getElementsByTagName('iframe')[0];
        iframe.contentWindow.scrollTo(0, 200);

        if (window.testRunner)
          testRunner.notifyDone();
      }, 0)
    }
    
    window.addEventListener('load', doTest, false);
  </script>
</head>
<body>
  <!-- You should see a green box below. -->
  <div id="indicator"></div>

  <div class="container">
    <iframe src="resources/green-red-subframe.html" scrolling="no"></iframe>
  </div>

</body>
</html>