[whatwg] Canvas: dash list API

Cameron McCormack cam at mcc.id.au
Sat Dec 22 05:12:38 PST 2012

On 22/12/12 10:06 PM, 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.)

Does it need to inherit from Array?  I think we can do this as long as 
the canvas context object does not need to "watch" the Array object for 
changes.  (This is technically already possible by just using "object" 
as the type, and handling assignments of non-Array objects in the 
attribute definition.)

We could have an Array type in Web IDL, which just means "a reference to 
an Array object" and which also doesn't do any type coercion when 
assigning to array elements or anything.

More information about the whatwg mailing list