3 This is a test of our ability to convert a canvas to a data url and use it as a cursor. We pass if the cursor animates smoothly and without flickering.
<br>
4 <canvas id=
"c" width=
"40" height=
"40"></canvas>
5 <script type=
"text/javascript">
7 var canvas
= document
.getElementById('c');
8 var ctx
= canvas
.getContext('2d');
10 function drawArrow() {
12 canvas
.width
= canvas
.width
; // reset canvas
14 ctx
.translate(ctx
.canvas
.width
/ 2, ctx
.canvas
.height
/ 2);
17 ctx
.rect(-10,-10, 20, 20);
20 document
.body
.style
.cursor
= 'url('+canvas
.toDataURL()+'), pointer';
21 requestAnimationFrame(drawArrow
);
24 requestAnimationFrame(drawArrow
);