This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 13800 - Add ArrayBuffer to Transferable types list (2.8.4); update Structured clone algorithm
Summary: Add ArrayBuffer to Transferable types list (2.8.4); update Structured clone a...
Status: RESOLVED FIXED
Alias: None
Product: WHATWG
Classification: Unclassified
Component: HTML (show other bugs)
Version: unspecified
Hardware: PC Windows NT
: P2 normal
Target Milestone: Unsorted
Assignee: Ian 'Hixie' Hickson
QA Contact: HTML WG Bugzilla archive list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 12586
  Show dependency treegraph
 
Reported: 2011-08-17 00:12 UTC by Travis Leithead [MSFT]
Modified: 2013-06-12 23:47 UTC (History)
6 users (show)

See Also:


Attachments

Description Travis Leithead [MSFT] 2011-08-17 00:12:02 UTC
In order to support suggested changes in CanvasPixelArray -> Uint8ClampedArray (per bug 12586), ArrayBuffer should be specified as a Transferable type in section 2.8.4.

Furthermore, in the structured clone algorithm, the cloning of ImageData should be updated to allow the ImageData's Uint8ClampedArray to be transferred:

Current text:
↪If input is a ImageData object
Let output be a newly constructed ImageData object with the same width and height as input, and with a newly constructed CanvasPixelArray for its data attribute, with the same length and pixel values as the input's.

Proposed change:
↪If input is a ImageData object
Let output be a newly constructed ImageData object with the same width and height as input, and with a newly constructed Uint8ClampedArray view of the ArrayBuffer in the destination object of memory for its data attribute, with the same length and pixel values as the input's.

...or similar text to indicate that if the ImageData's Uint8ClampedArray's ArrayBuffer is transfered, then the new Uint8ClampedArray instance will be created over the transferred ArrayBuffer.
Comment 1 Ian 'Hixie' Hickson 2011-09-21 22:55:52 UTC
This is being specced in the TypedArray spec for the moment, but it'll come over once it's solid. (kbr: Correct me if I'm wrong here.)
Comment 2 Ian 'Hixie' Hickson 2011-10-19 23:58:35 UTC
Marking this REMIND for now. I will be doing this but we're waiting for the ArrayBuffer part of this to be stable before moving it from ArrayBuffer to HTML.

Please don't hesitate to reopen this if you notice that ArrayBuffer is ready for this before I do.
Comment 3 Kenneth Russell 2011-10-20 01:45:49 UTC
I'd like to request review of the changes that were made to the typed array spec today in response to http://www.w3.org/Bugs/Public/show_bug.cgi?id=13799 . Please see https://www.khronos.org/registry/typedarray/specs/latest/ . If they look okay, that's a good indication that they're solidifying.
Comment 4 Ian 'Hixie' Hickson 2011-10-20 05:53:43 UTC
Roger, will do.
Comment 5 Ian 'Hixie' Hickson 2011-10-20 06:19:34 UTC
kbr: The new text looks good.
Comment 6 Ian 'Hixie' Hickson 2011-10-25 04:17:52 UTC
kbr: Do you want me to move this to the HTML spec? Or should I wait? (Either is fine by me.)
Comment 7 Kenneth Russell 2011-10-25 04:59:37 UTC
Thanks for your review above.

(In reply to comment #6)
> kbr: Do you want me to move this to the HTML spec? Or should I wait? (Either is
> fine by me.)

Could we hold off a little longer? Ideally I'd like to snapshot the typed array spec again, so that the new functionality isn't highlighted as strawman proposals.

If this means closing this bug as REMIND again, no problem; I can take responsibility for reopening it when the next snapshot is taken.
Comment 8 Ian 'Hixie' Hickson 2011-10-25 05:12:12 UTC
Cool, thanks. Will mark it REMIND, just reopen it when you're ready!
Comment 9 Michael[tm] Smith 2013-01-30 07:53:10 UTC
This bug was cloned to create HTML WG bug 19071.
Comment 10 Ian 'Hixie' Hickson 2013-03-22 17:52:16 UTC
kbr: Do you have an update here?
Comment 11 Kenneth Russell 2013-04-11 01:09:15 UTC
The editors' draft of the typed array spec http://www.khronos.org/registry/typedarray/specs/latest/ has been updated to remove the "strawman" designation from the structured cloning and transfer operations, since there are now multiple implementations of this functionality and it has been non-controversial. Please feel free to incorporate this text into the HTML5 spec. Thanks.
Comment 12 Ian 'Hixie' Hickson 2013-06-06 19:04:44 UTC
So I was looking at this, and I wonder... should we really move this from the ArrayBuffer spec to the HTML spec? It seems like it works pretty well to have it in the ArrayBuffer spec, and it's unambiguously defined. Having it in ArrayBuffer means that everything you need to know about implementing ArrayBuffer is in one place, which seems like the right choice.
Comment 13 Kenneth Russell 2013-06-06 20:22:52 UTC
Fine with me. One thing to keep in mind is the typed array types are being subsumed into the ECMAScript 6 spec, and the typed array spec will probably become obsolete. It isn't clear to me where the Transferable functionality, which is specified at the HTML5 level rather than at the ES6 level, should go after this.
Comment 14 Ian 'Hixie' Hickson 2013-06-12 23:46:57 UTC
Ah, ok. In that case I'll just spec it in HTML, save us some trouble.
Comment 15 Ian 'Hixie' Hickson 2013-06-12 23:47:18 UTC
https://www.w3.org/Bugs/Public/show_bug.cgi?id=13800