I am trying to implement the wating animation mentioned in this question , especially what looks like this:

But I do not want to use image files and try to implement it exclusively in html5 canvas and javascript. Also, I need a circular black background, not a square one. As a first step, I tried to draw a static frame (without movement / rotation) and did the following:
<html> <head><script> window.onload = function(){ var c=document.getElementById("waiting").getContext("2d"); c.lineCap="round"; c.fillStyle="#353535"; c.translate(100,100); function slit(p){ shade = 256*p; th = 2*Math.PI*p; cos = Math.cos(th); sin = Math.sin(th); c.strokeStyle = '#'+((shade<<16)+(shade<<8)+shade).toString(16); c.moveTo(55*cos, 55*sin); c.lineTo(84*cos, 84*sin); c.stroke(); c.closePath(); } c.lineWidth=0; c.arc(0,0,100,0,Math.PI*2); c.fill(); c.lineWidth=7; for(var i = 0;i<1;i+=0.05){slit(i);} } </script></head> <body><canvas id="waiting" width=200 height=200></canvas></body> </html>
The result is:

The problem is that lineCap="round" does not work correctly for all "cuts", and the lineWidth=0 attribute does not work for the edge of the circle. What am I doing wrong? I tested it with Chrome 16.0.912.63 and Firefox 10.0 and got similar results.
In the next step, I want the parts of the functions that I created above to interact with
window.animationFrames = (function(callback){ return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function(callback){window.setTimeout(callback, 1000 / 60);}; })();
but for now I need to solve this problem first.
source share