[webkit-dev] new APIs for strokes with dash in Canvas

James Robinson jamesr at google.com
Thu Sep 22 19:36:47 PDT 2011


On Thu, Sep 22, 2011 at 7:31 PM, Young Han Lee <joybro201 at gmail.com> wrote:

> Hi all,
>
> I have a patch to add webkitLineDash and webkitLineDashOffset APIs on
> CanvasRenderingContext2D on https://bugs.webkit.org/show_bug.cgi?id=63933
>
> The purpose of these APIs is to support for strokes with dash in Canvas.
>
> Although the API is not specified in the HTML Canvas specification yet, I
> believe it would be great to support the API. As Dirk said in the above bug,
> Mozilla already implemented the APIs named mozDash and mozDashOffset[1], and
> there seems to be many needs for the API. Some people even implemented their
> own javascript functions to draw strokes with dash in Canvas[2,3].
>
> As GraphicsContext already have an interface for strokes with dash,
> setLineDash, all we have to do is exposing it to the JS level. So the syntax
> and meaning of the new APIs is the same with the arguments of the
> setLineDash. webkitLineDash is an array of float, and webkitLineDashOffset
> is a float.
>
> I uploaded a patch for JSC first. After the patch is landed, I will make a
> follow-up patch for V8.
>
> Any thought?
>

Has this proposal been raised in the WHATWG, which specifies the canvas 2d
interface?  It sounds like in this email you have done most of the work
necessary for a good spec proposal (see
http://wiki.whatwg.org/wiki/FAQ#Is_there_a_process_for_adding_new_features_to_a_specification.3F
).

- James


>
>
> [1] https://bugzilla.mozilla.org/show_bug.cgi?id=662038
> [2]
> http://davidowens.wordpress.com/2010/09/07/html-5-canvas-and-dashed-lines/
> [3]
> http://stackoverflow.com/questions/7352769/dashed-curves-on-html5-canvas-bezier
>
> _______________________________________________
> webkit-dev mailing list
> webkit-dev at lists.webkit.org
> http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20110922/b46f01d3/attachment.html>


More information about the webkit-dev mailing list