<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>24687</bug_id>
          
          <creation_ts>2014-02-16 20:59:47 +0000</creation_ts>
          <short_desc>DataCue: clarify that .data should be a clone of data argument and not a pointer</short_desc>
          <delta_ts>2014-03-17 11:53:08 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>HTML WG</product>
          <component>HTML5 spec</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Silvia Pfeiffer">silviapfeiffer1</reporter>
          <assigned_to name="Silvia Pfeiffer">silviapfeiffer1</assigned_to>
          <cc>bzbarsky</cc>
    
    <cc>ddorwin</cc>
    
    <cc>mike</cc>
    
    <cc>public-html-admin</cc>
    
    <cc>public-html-wg-issue-tracking</cc>
    
    <cc>roc</cc>
          
          <qa_contact name="HTML WG Bugzilla archive list">public-html-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>100725</commentid>
    <comment_count>0</comment_count>
    <who name="Silvia Pfeiffer">silviapfeiffer1</who>
    <bug_when>2014-02-16 20:59:47 +0000</bug_when>
    <thetext>The spec for the DataCue constructor says &quot;The data argument sets the raw data of the text track cue.&quot; Brendan reads &quot;sets&quot; as &quot;=&quot; and &quot;someObject.data = someArrayBuffer&quot; won&apos;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 &quot;structured clone&quot; of the data parameter object (referring to &quot;2.7.6 Safe passing of structured data&quot;).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>101897</commentid>
    <comment_count>1</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2014-03-05 13:39:01 +0000</bug_when>
    <thetext>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&apos;re _trying_ to preserve the at-the-time-of-call expandos as well?  I would argue that&apos;s not worth it, and is in fact undesirable.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>101965</commentid>
    <comment_count>2</comment_count>
    <who name="Silvia Pfeiffer">silviapfeiffer1</who>
    <bug_when>2014-03-06 07:14:18 +0000</bug_when>
    <thetext>(In reply to Boris Zbarsky from comment #1)
&gt; Why do you need to structured clone?  If the argument is an arraybuffer, you
&gt; can just explicitly make a copy of its data (basically by calling the
&gt; canonical ArrayBuffer.prototype.slice on it, with 0 as argument).
&gt; 
&gt; Unless you&apos;re _trying_ to preserve the at-the-time-of-call expandos as well?
&gt; I would argue that&apos;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&apos;t do it.

Maybe making .data read-only would be a better approach.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>101973</commentid>
    <comment_count>3</comment_count>
    <who name="Robert O&apos;Callahan (Mozilla)">roc</who>
    <bug_when>2014-03-06 09:50:05 +0000</bug_when>
    <thetext>It&apos;s probably OK to just copy the data since we&apos;re not likely to be dealing with large volumes or high performance requirements.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>101981</commentid>
    <comment_count>4</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2014-03-06 15:37:24 +0000</bug_when>
    <thetext>Copying the data makes sense to me here.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>102444</commentid>
    <comment_count>5</comment_count>
    <who name="Silvia Pfeiffer">silviapfeiffer1</who>
    <bug_when>2014-03-17 11:53:08 +0000</bug_when>
    <thetext>EDITOR&apos;S RESPONSE: This is an Editor&apos;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.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>