summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/compositing/geometry/clip-inside.html
blob: 98873830237dd3e582c768f5a5447270842895fa (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
<html>
<head>
  <style type="text/css" media="screen">
    .box {
      position: absolute;
      width: 100px;
      height: 100px;
      top: 20px;
      left: 20px;
      background-color: gray;
      clip: rect(15px, 95px, 95px, 5px);
    }

    .inner {
      position: relative;
      width: 120px;
      height: 120px;
      top: -10px;
      left: -10px;
      background-color: rgba(0, 0, 0, 0.2);
    }

    .composited {
      transform: translateZ(1px);
    }

    p {
      margin-top: 140px;
    }
  </style>
  <script type="text/javascript" charset="utf-8">
    if (window.testRunner) {
      testRunner.dumpAsText();
      testRunner.waitUntilDone();
    }

    function doTest() {
      if (window.testRunner) {
        document.getElementById('layers').innerText = window.internals.layerTreeAsText(document);
        testRunner.notifyDone();
      }
    }
    window.addEventListener('load', doTest, false);
  </script>
</head>
<body>
  <div class="composited box">
    <div class="inner">
    </div>
  </div>

  <div class="box" style="left: 220px;">
    <div class="composited inner">
    </div>
  </div>

  <p>Test CSS clip with composited layers. Left and right sides should look the same.</p>
  <pre id="layers">In DRT, layer tree goes here.</pre>
</body>
</html>