4 <title>Canvas
2D Test: Red Box over Black Background
</title>
5 <style type=
"text/css">
11 var g_swapsBeforeAck
= 15;
21 var canvas
= document
.getElementById("c");
22 var c2d
= canvas
.getContext("2d");
23 c2d
.clearRect(0, 0, canvas
.width
, canvas
.height
);
24 c2d
.fillStyle
= "rgba(255, 0, 0, 0.5)";
25 c2d
.fillRect(50, 50, 100, 100);
28 function waitForFinish()
30 if (g_swapsBeforeAck
== 0) {
31 domAutomationController
.setAutomationId(1);
32 domAutomationController
.send("SUCCESS");
35 document
.getElementById('container').style
.zIndex
= g_swapsBeforeAck
+ 1;
36 window
.webkitRequestAnimationFrame(waitForFinish
);
41 <body onload=
"main()">
42 <div style=
"position:relative; width:200px; height:200px; background-color:black">
44 <div id=
"container" style=
"position:absolute; top:0px; left:0px">
45 <canvas id=
"c" width=
"200" height=
"200" class=
"nomargin"></canvas>