summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/compositing/layout-width-change.html
blob: eb7b465dfb28b651dc50c4004558740961294bea (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
<!DOCTYPE>
<html>
<head>
  <title>Layout width change</title>

  <style type="text/css" media="screen">
  .container {
    position: absolute;
    width: 400px;
    height: 1500px;
  }

  .panel {
    position: absolute;
    top: 0px;
    left: 0px;
    width: 1000px;
    height: 200px;
    background-color: #bbb;
  }

  .composited {
    transform: translateZ(0);
  }
  </style>
  <script type="text/javascript" charset="utf-8">
    if (window.testRunner) {
        testRunner.waitUntilDone();
        testRunner.dumpAsTextWithPixelResults();
    }
    function doTest()
    {
      var container = document.getElementById("container");
      var panel = document.getElementById("panel");

      // Delay is needed after switching between compositing and non-compositing
      // mode to allow for another render to happen.
      window.setTimeout(function() {
         panel.className += " composited"
         container.style.height = "300";
         if (window.testRunner) {
            window.setTimeout(function() {
                testRunner.notifyDone();
            }, 20);
         }
      }, 20);
    }

    window.addEventListener('load', doTest, false);
    </script>
</head>
<body>

  <p>There should be no white gap at the right hand side of the box.</p>
  <div id="container" class="container">
    <div id="panel" class="panel">
    </div>
  </div>

</body>
</html>