blob: b9429d65e70aeed14c10830bd8b2274b7e36987b [file] [log] [blame]
commit-queue@webkit.org762030d2012-01-04 00:53:45 +00001<!DOCTYPE html>
2<html>
3 <head>
4 <style>
5 canvas {
6 background-color: rgba(0, 0, 0, 1);
7 }
8
9 .hidden {
10 visibility: hidden;
11 }
12
13 .visible {
14 visibility: visible;
15 }
16 </style>
17
18 <script>
dino@apple.come1a4be62016-03-14 03:58:26 +000019 if (window.testRunner)
rniwa@webkit.org18904132012-06-11 18:29:22 +000020 testRunner.dumpAsText(true);
commit-queue@webkit.org762030d2012-01-04 00:53:45 +000021
22 function drawCanvas(canvasID, clearColor)
23 {
24 var theCanvas = document.getElementById(canvasID);
25 var glContext = theCanvas.getContext("experimental-webgl");
26 glContext.clearColor(clearColor[0], clearColor[1], clearColor[2], clearColor[3]);
27 glContext.clear(glContext.COLOR_BUFFER_BIT);
28 }
29
30 function init()
31 {
32 drawCanvas("topGL", [0, 0.5, 0, 1]);
33 drawCanvas("bottomGL", [1, 0, 0, 1]);
34 }
35 </script>
36 </head>
37
38 <body onload="init()">
39 <!-- Tests CSS visibility flag for WebGL layers. -->
40 <!-- Pixel test only. Only the green webGL canvas should be visible. The red one should be hidden. -->
41 <div><canvas id="topGL" class="visible" width="150" height="150"></canvas></div>
42 <div><canvas id="bottomGL" class="hidden" width="150" height="150"></canvas></div>
43 </body>
44</html>