summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/compositing/geometry/limit-layer-bounds-opacity-transition.html
blob: 25bce5f933f459d624d2bfdd8162309f0b6e7149 (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
63
64
65
66
67
68
<!DOCTYPE html>

<html>
  <style type="text/css" media="screen">
    .test {
      position: relative;
      top: -10px; /* overlap composited layer */
      width: 100px;
      height: 100px;
      background-color: white;
      text-indent: -10000px;
    }

    .compositing {
      width: 1px;
      height: 1px;
      transform: translateZ(0);
    }

    #fading {
      opacity: 0;
      -webkit-transition: opacity 0.1s;
    }
  </style>
  <script type="text/javascript" charset="utf-8">
    if (window.testRunner) {
      testRunner.waitUntilDone();
      testRunner.dumpAsText();
    }

    function startFade()
    {
      // At the end of this fade we are interested in the size of .test in the layer dump.
      // It should be constrained to the size of the view, so not tiled.
      var fader = document.getElementById('fading');
      fader.addEventListener('webkitTransitionEnd', fadeDone, false);
      document.getElementById('fading').style.opacity = 1;
    }
    
    function fadeDone()
    {
      if (window.testRunner) {
        document.getElementById('layers').innerText = window.internals.layerTreeAsText(document);
        testRunner.notifyDone();
      }
    }
  </script>
<head>
</head>
<body>

  <!-- Go into compositing. -->
  <div class="compositing"></div>

  <div class="test">
    Test
  </div>
  
  <div id="fading">
    Fader
  </div>

  <pre id="layers">Layer tree goes here in DRT</pre>
  <script>
    window.onload = startFade;
  </script>
</body>
</html>