[whatwg] Canvas: dash list API

2012-12-22 Thread Anne van Kesteren
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

Re: [whatwg] Canvas: dash list API

2012-12-22 Thread Cameron McCormack
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

Re: [whatwg] Canvas: dash list API

2012-12-22 Thread Anne van Kesteren
On Sat, Dec 22, 2012 at 2:12 PM, Cameron McCormack c...@mcc.id.au wrote: 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,

Re: [whatwg] Canvas: dash list API

2012-12-22 Thread Cameron McCormack
On 23/12/12 12:40 AM, Anne van Kesteren wrote: I guess dashList is somewhat simpler, but I think it would be nice if it still did type coercion. In that case, I guess we are reliant on whatever ES-allowed Array extending is possible, and I haven't followed that for a bit. Is this actually

Re: [whatwg] Canvas: dash list API

2012-12-22 Thread Anne van Kesteren
On Sat, Dec 22, 2012 at 2:43 PM, Cameron McCormack c...@mcc.id.au wrote: On 23/12/12 12:40 AM, Anne van Kesteren wrote: I guess dashList is somewhat simpler, but I think it would be nice if it still did type coercion. In that case, I guess we are reliant on whatever ES-allowed Array extending

Re: [whatwg] Canvas: dash list API

2012-12-22 Thread Tobie Langel
On Sat, Dec 22, 2012 at 2:57 PM, Anne van Kesteren ann...@annevk.nl wrote: On Sat, Dec 22, 2012 at 2:43 PM, Cameron McCormack c...@mcc.id.au wrote: On 23/12/12 12:40 AM, Anne van Kesteren wrote: I guess dashList is somewhat simpler, but I think it would be nice if it still did type

Re: [whatwg] Canvas: dash list API

2012-12-22 Thread Cameron McCormack
On 23/12/12 1:01 AM, Tobie Langel wrote: Array-like objects which don't inherit from the Array object and are thus missing methods one would expect to find on them (forEach, join, etc.) is one of the biggest WTF of the Web platform. We should be doing whatever it takes to fix this. I agree

Re: [whatwg] Canvas: dash list API

2012-12-22 Thread Anne van Kesteren
On Sat, Dec 22, 2012 at 3:07 PM, Cameron McCormack c...@mcc.id.au wrote: If we don't have the type checking of array elements, and also don't need any noticing of individual element assignments, then we can just have a reference to a plain Array object and look at its elements at the time the

Re: [whatwg] Canvas: dash list API

2012-12-22 Thread Ian Hickson
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

Re: [whatwg] Canvas: dash list API

2012-12-22 Thread Jussi Kalliokoski
On Sat, Dec 22, 2012 at 8:04 PM, Ian Hickson i...@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

Re: [whatwg] Canvas: dash list API

2012-12-22 Thread Boris Zbarsky
On 12/22/12 6:07 AM, Cameron McCormack wrote: If we don't have the type checking of array elements, and also don't need any noticing of individual element assignments, then we can just have a reference to a plain Array object and look at its elements at the time the dash array is needed. Look