When canvas linewidth value is set to 0 and a path drawn, webkit draws a line when it should not (because linewidth=0 implies no line at all). Check the given URL for a clear example showing linewidth from 0 to 10.
This is caused by the early return in http://trac.webkit.org/browser/trunk/WebCore/html/canvas/CanvasRenderingContext2D.cpp#L218 Are there any reasons for this? We have checks in strokeRect and other methods that return on strokeWidth of 0. I think we can change if (!(isfinite(width) && width > 0)) to if (!isfinite(width) || width < 0)).
http://www.whatwg.org/specs/web-apps/current-work/#dom-context-2d-linewidth "The lineWidth attribute gives the width of lines, in coordinate space units. On getting, it must return the current value. On setting, zero, negative, infinite, and NaN values must be ignored, leaving the value unchanged; other values must change the current value to the new value." The initial value of lineWidth is 1.0, thus it can never be 0.
I get your point. I'm setting bug status to resolved->Invalid. (In reply to comment #2) > http://www.whatwg.org/specs/web-apps/current-work/#dom-context-2d-linewidth > > "The lineWidth attribute gives the width of lines, in coordinate space units. On getting, it must return the current value. On setting, zero, negative, infinite, and NaN values must be ignored, leaving the value unchanged; other values must change the current value to the new value." > > The initial value of lineWidth is 1.0, thus it can never be 0.