[whatwg] Canvas: dash list API

Jussi Kalliokoski jussi.kalliokoski at gmail.com
Sat Dec 22 14:18:54 PST 2012


On Sat, Dec 22, 2012 at 8:04 PM, Ian Hickson <ian at hixie.ch> wrote:

> On Sat, 22 Dec 2012, Anne van Kesteren wrote:
> >
> > Is there not some way we can have a lineDash attribute that returns a
> > manipulatable object that inherits from Array rather than the current
> > Java-like API? I remember this was discussed when getLineDash() and
> > setLineDash() were added, but I think it's worth taking another look at
> > this.
> >
> > (For URLs I want something similar for path segments and I'd rather not
> > introduce get/set methods.)
>
> What would you want to have happen in the case of a library method that
> saves the context, sets the dash to an internal value, draws a line, saves
> the dash state to an internal value, restores the context, then returns?
> Should the caller, if they then grab the dashed line object from the
> context, get the internal value of the library? Should the restore() call
> mutate the saved dash object?
>

Also, is there a reason not to use a Typed Array, such as Float64Array?
Then we wouldn't have to extend Web IDL. For future, though, it might be
worth adding to Web IDL an easy way to specify something that has a custom
index operator (including what happens when you push or unshift) but
inherits from Array.prototype.

Cheers,
Jussi

--
> Ian Hickson               U+1047E                )\._.,--....,'``.    fL
> http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
> Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
>



More information about the whatwg mailing list