commit-queue@webkit.org | 762030d | 2012-01-04 00:53:45 +0000 | [diff] [blame] | 1 | <!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.com | e1a4be6 | 2016-03-14 03:58:26 +0000 | [diff] [blame] | 19 | if (window.testRunner) |
rniwa@webkit.org | 1890413 | 2012-06-11 18:29:22 +0000 | [diff] [blame] | 20 | testRunner.dumpAsText(true); |
commit-queue@webkit.org | 762030d | 2012-01-04 00:53:45 +0000 | [diff] [blame] | 21 | |
| 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> |