This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
The spec for the DataCue constructor says "The data argument sets the raw data of the text track cue." Brendan reads "sets" as "=" and "someObject.data = someArrayBuffer" won't create a copy. See thread at: http://lists.w3.org/Archives/Public/public-html/2014Feb/0032.html We probably need to say that .data is a "structured clone" of the data parameter object (referring to "2.7.6 Safe passing of structured data").
Why do you need to structured clone? If the argument is an arraybuffer, you can just explicitly make a copy of its data (basically by calling the canonical ArrayBuffer.prototype.slice on it, with 0 as argument). Unless you're _trying_ to preserve the at-the-time-of-call expandos as well? I would argue that's not worth it, and is in fact undesirable.
(In reply to Boris Zbarsky from comment #1) > Why do you need to structured clone? If the argument is an arraybuffer, you > can just explicitly make a copy of its data (basically by calling the > canonical ArrayBuffer.prototype.slice on it, with 0 as argument). > > Unless you're _trying_ to preserve the at-the-time-of-call expandos as well? > I would argue that's not worth it, and is in fact undesirable. Do you think, though, that copying the data is the right approach? See the example in the thread of strange side effects if we don't do it. Maybe making .data read-only would be a better approach.
It's probably OK to just copy the data since we're not likely to be dealing with large volumes or high performance requirements.
Copying the data makes sense to me here.
EDITOR'S RESPONSE: This is an Editor's Response to your comment. If you are satisfied with this response, please change the state of this bug to CLOSED. If you have additional information and would like the Editor to reconsider, please reopen this bug. If you would like to escalate the issue to the full HTML Working Group, please add the TrackerRequest keyword to this bug, and suggest title and text for the Tracker Issue; or you may create a Tracker Issue yourself, if you are able to do so. For more details, see this document: http://dev.w3.org/html5/decision-policy/decision-policy.html Status: Accepted Change Description: https://github.com/w3c/html/commit/d2c026552f2b13a23053aa86a460423cd7628f38 Rationale: Added a clarification to make a copy of the data in the constructor.