8 background-image: -webkit-canvas(sourceCanvas);
10 display: inline-block;
15 <p>This test passes if two green squares are displayed below.
</p>
17 <div style=
"display: inline-block">
18 <div id=
"container"></div>
20 <div id=
"canvas-container" style=
"display: inline-block"></div>
23 var ctx
= document
.getCSSCanvasContext('2d', 'sourceCanvas', 300, 300);
24 var canvas
= ctx
.canvas
;
26 function asyncDraw2() {
27 ctx
.fillStyle
= "green";
28 ctx
.fillRect(0, 0, 300, 300);
31 function asyncDraw1() {
32 ctx
.fillStyle
= "red";
33 ctx
.fillRect(0, 0, 300, 300);
34 window
.webkitRequestAnimationFrame(asyncDraw2
);
37 window
.webkitRequestAnimationFrame(asyncDraw1
);
39 document
.querySelector('#canvas-container').appendChild(canvas
);