summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/compositing/visibility/visibility-simple-video-layer.html
blob: 42d13f113c3a668c47e3cbc29c0f3190f8cac01b (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
<!DOCTYPE html>
<html>
  <head>
    <style>
      .box {
          height: 150px;
          width: 150px;
      }

      div {
          width: 150px;
          margin: 5px;
          padding: 5px;
          border: 1px solid black;
      }

      .hidden {
          visibility: hidden;
      }

      .visible {
          visibility: visible;
          background-color: green;
      }

      .composited {
          transform: translateZ(1px);
      }
    </style>

    <script src="../resources/media-testing.js"></script>
    <script src="../../media/media-file.js"></script>
    <script type="text/javascript" charset="utf-8">
      if (window.testRunner)
          testRunner.dumpAsTextWithPixelResults();

      var counter = 0;
      function notifyVideoDone() {
          counter = counter + 1;
          if ((counter === 3) && (window.testRunner))
              testRunner.notifyDone();
      }

      function doTest()
      {
          setupVideo(document.getElementsByTagName('video')[0], '../resources/video', notifyVideoDone);
          setupVideo(document.getElementsByTagName('video')[1], '../resources/video', notifyVideoDone);
          setupVideo(document.getElementsByTagName('video')[2], '../resources/video', notifyVideoDone);
      }
    </script>
  </head>

  <body onload="doTest()">
    <!-- Tests CSS visibility flag for composited video layers. -->
    <!-- Pixel test only. Only the top video should be visible, the other two should be hidden (borders should remain visible) -->
    <div><video class="visible composited box"></video></div>
    <div><video class="hidden box"></video></div>
    <div><video class="hidden composited box"></video></div>
  </body>
</html>