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 See https://bugs.webkit.org/show_bug.cgi?id=64321.
5 <canvas id="c" width="40" height="40"></canvas>
6 <script type="text/javascript">
8 icon.src = 'resources/drag-image.png'
10 function drawArrow(angle) {
11 var canvas = document.getElementById('c');
12 canvas.width = canvas.width // reset canvas
13 var ctx = canvas.getContext('2d');
15 ctx.translate(ctx.canvas.width / 2, ctx.canvas.height / 2);
17 ctx.drawImage(icon, -icon.width / 2, -icon.height / 2);
19 var x = 20;//Math.floor(Math.cos(angle) * icon.width / 2) + icon.width / 2;
20 var y = 20;//Math.floor(Math.sin(angle) * icon.width / 2) + icon.width / 2;
22 var data = canvas.toDataURL();
24 document.body.style.cursor = 'url('+data+') ' + x + ' ' + y + ', pointer';
26 console.log('failure');
31 var run = function() {
32 angle += Math.PI / 16;