[whatwg] ArrayBuffer and the structured clone algorithm

Boris Zbarsky bzbarsky at MIT.EDU
Mon May 9 18:56:22 PDT 2011


On 5/9/11 6:44 PM, Ian Hickson wrote:
>> For this reason I think we need to keep CanvasPixelArray distinct. I
>> certainly hope that Web IDL does not change its conversion rules to
>> mimic the clamping behavior in CanvasPixelArray. Right now Web IDL
>> delegates to the ECMA-262 specification for primitive conversions, which
>> have the wrapping behavior of C-style casts rather than clamping
>> behavior. Forcing clamping for out-of-range integer values would impose
>> a significant negative performance constraint on typed arrays.
>
> I haven't changed CanvasPixelArray.

Note that Gecko implements CanvasPixelArray as a kind of typed array 
that has the right kind of behavior on assignment.

This means that you can extract the array buffer as usual create other 
typed views of it, etc.

We feel that there are significant benefits to doing this and would be 
interested in trying to get something like that standardized if others 
are interested as well.  If not, of course, then we just keep our 
current behavior, but that does mean that CanvasPixelArray in Gecko has 
properties/methods not present in some other UAs....

-Boris



More information about the whatwg mailing list