It would helpful to have something like lineStyle, that draws a path dotted, solid, dashed or not at all (last is maybe senceless).
Created attachment 31174 [details] canvas lineStyle lineStyle is not in the spec of HTML 5 atm. This patch adds a basic concept for lineStyle and supports dashed, dotted or solid strokes as well as none. You can make use of it with: context.webkitLineStyle = 'dashed|dotted|solid|none' the default is solid of course. There are no configurations possible at the moment (size of gaps between dashes and so on). And maybe it would make it to difficult. I hope to get some feedback or improvement.
Comment on attachment 31174 [details] canvas lineStyle I'm not sure what the correct approach to get webkitLineStyle vs. lineStyle -- i think sam would be the right person to ask. Otherwise this patch is fine -- i'm clearing the review flag so no one else reviews or tries to land.
I could just test it on gtk atm and I see a bad behavior of dotted paths. The length of a dot is not scaled to the thickness of the stroked path. That means that the distance between two dots is always the same, independently of the stroke width. I looked to the css implemenatation and the benefit on css is that it only needs to stroke lines and circles. All ports have a special implementation (all the same?) to solve the problem in GraphicsContext. I don't know if we can reuse the logic to calculate the size of the dot in a universal path. I'll take a look at this. The situation for solid and none is clear. And dashed lines look ok, but we may use the same logic as for dotted paths.
(In reply to comment #3) The problems with dotted lines dont affect on Qt. I'll test the patch on Cg soon but this might be a cairo bug.
*** This bug has been marked as a duplicate of bug 63933 ***