[Public WebGL] Typed Array spec updates: strawman proposals

Kenneth Russell [email protected]
Wed May 25 17:50:10 PDT 2011

On Sat, Apr 23, 2011 at 10:19 AM, Glenn Maynard <[email protected]> wrote:
> On Fri, Apr 22, 2011 at 9:20 PM, Kenneth Russell <[email protected]> wrote:
>> The Typed Array editors' draft has been updated:
>> http://www.khronos.org/registry/typedarray/specs/latest/
>> with changes supporting the following functionality:
>>  - Ability to copy sections of an ArrayBuffer
>>  - Read-only ArrayBuffers
>>  - Support for zero-copy data transfer via postMessage by defining the
>> behavior of ArrayBuffers and ArrayBufferViews under structured clone
> This breaks specs that use structured clone within getter operations:
> http://www.whatwg.org/specs/web-apps/current-work/multipage/history.html#history-traversal
> http://dvcs.w3.org/hg/IndexedDB/raw-file/tip/Overview.html#object-store-retrieval-operation
>   http://dev.w3.org/html5/webstorage/#dom-storage-getitem
> For example, it causes "x = localStorage.arrayBuffer" to clear the
> arrayBuffer within localStorage as a side-effect of retrieving it, which is
> clearly unintended.
> Structured clone is a const operation; making a structured clone of
> something doesn't modify it.  You're changing a fundamental property of
> structured clone, which isn't a change one spec should be making to another
> spec.  (Has Ian Hickson been involved in this discussion?)
> It also effectively changes every setter API that uses structured clone,
> changing them into functions that modify their arguments as well.
> It's also generally inconvenient.  For example, if I have an object
> describing the current state and I want to stash it in History, I now have
> to be very careful to copy off any ArrayBuffers within it before doing so,
> and to update any references to those buffers.  I can currently say
> "history.pushState(anything, title, url)" without having to care about what
> "anything" is and whether it might be modified; please don't break that.

Apologies for the delay in replying.

I've spoken with Ian and he suggested that a good direction would be
to conditionalize whether the structured cloning algorithm auto-closes
ArrayBuffers, and to make the Web Messaging spec auto-close them,
leaving the other uses of structured cloning unchanged.

These changes have been checked in to the typed array spec. Please
review and comment. I'll also post a notice to whatwg asking for


You are currently subscribed to [email protected]
To unsubscribe, send an email to [email protected] with
the following command in the body of your email:
unsubscribe public_webgl

More information about the public_webgl mailing list