blob: dc89b91d5931ffa5b88c5a7530b92bd3c6b55a2c (
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
|
<!DOCTYPE html>
<html>
<head>
<style>
canvas {
background-color: rgba(0, 0, 0, 1);
}
.hidden {
visibility: hidden;
}
.visible {
visibility: visible;
}
.composited {
transform: translatez(0);
}
</style>
<script>
if (window.testRunner)
testRunner.dumpAsTextWithPixelResults();
function drawCanvas(canvasID, color)
{
var theCanvas = document.getElementById(canvasID);
var canvasContext = theCanvas.getContext("2d");
canvasContext.fillStyle = color;
canvasContext.fillRect(0, 0, 150, 150);
}
function init()
{
drawCanvas("one", "green");
drawCanvas("two", "red");
drawCanvas("three", "red");
}
</script>
</head>
<body onload="init()">
<!-- Tests CSS visibility flag for a composited canvas2D layer. -->
<!-- Pixel test only. Only the green canvas2d should be visible. The other two should be hidden. -->
<div><canvas id="one" class="composited visible" width="150" height="150"></canvas></div>
<div><canvas id="two" class="hidden" width="150" height="150"></canvas></div>
<div><canvas id="three" class="composited hidden" width="150" height="150"></canvas></div>
</body>
</html>
|