<?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>23477</bug_id>
          
          <creation_ts>2013-10-10 01:42:28 +0000</creation_ts>
          <short_desc>Since ArrayBuffer is now part of ES directly, you can&apos;t do ArrayBuffer implements Transferable</short_desc>
          <delta_ts>2014-02-06 20:19:00 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WHATWG</product>
          <component>HTML</component>
          <version>unspecified</version>
          <rep_platform>Other</rep_platform>
          <op_sys>other</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WONTFIX</resolution>
          
          
          <bug_file_loc>http://www.whatwg.org/specs/web-apps/current-work/#transferable-objects</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P3</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>Unsorted</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>contributor</reporter>
          <assigned_to name="Ian &apos;Hixie&apos; Hickson">ian</assigned_to>
          <cc>annevk</cc>
    
    <cc>bzbarsky</cc>
    
    <cc>cam</cc>
    
    <cc>ian</cc>
    
    <cc>mike</cc>
          
          <qa_contact>contributor</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>94532</commentid>
    <comment_count>0</comment_count>
    <who name="">contributor</who>
    <bug_when>2013-10-10 01:42:28 +0000</bug_when>
    <thetext>Specification: http://www.whatwg.org/specs/web-apps/current-work/multipage/common-dom-interfaces.html
Multipage: http://www.whatwg.org/C#transferable-objects
Complete: http://www.whatwg.org/c#transferable-objects
Referrer: http://www.whatwg.org/specs/web-apps/current-work/multipage/browsers.html

Comment:
Since ArrayBuffer is now part of ES directly, you can&apos;t do ArrayBuffer
implements Transferable

Posted from: 98.110.194.76 by bzbarsky@mit.edu
User agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:27.0) Gecko/20100101 Firefox/27.0</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94533</commentid>
    <comment_count>1</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2013-10-10 01:43:07 +0000</bug_when>
    <thetext>In fact, it may be better to just define Transferable to be a union or something...  The problem is if other specs want to add new transferables.  :(</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94534</commentid>
    <comment_count>2</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2013-10-10 02:06:09 +0000</bug_when>
    <thetext>Uh, wait, what? Why is ES not compatible with the way the Web platform works...?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94537</commentid>
    <comment_count>3</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2013-10-10 02:30:21 +0000</bug_when>
    <thetext>Well, more precisely ES doesn&apos;t know anything about WebIDL interfaces and WebIDL doesn&apos;t know anything about using ES built-in types as interface types.  Saying &quot;ArrayBuffer implements Transferable&quot; means about the same as &quot;Array implements Transferable&quot; in spec terms: since the LHS is not a WebIDL interface in either case, WebIDL doesn&apos;t allow you to say that....

We should probably fix that; it&apos;s not quite clear how.  Both in specs and in implementations.

In practice, for now Gecko will be typedeffing Transferable to a union type or something.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94609</commentid>
    <comment_count>4</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2013-10-11 23:21:21 +0000</bug_when>
    <thetext>I guess we can just have a union and require that if a new type is added, HTML gets updated. :-(

heycam: unless you have a way to fix this on the IDL side (note in particular that the right hand side of &apos;implements&apos; here is an empty interface).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94630</commentid>
    <comment_count>5</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2013-10-13 09:36:13 +0000</bug_when>
    <thetext>Well, strictly speaking IDL does not know about ES types at all (e.g. you cannot say something accepts an ArrayBuffer). That seems like what should be fixed here.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94640</commentid>
    <comment_count>6</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2013-10-13 20:58:19 +0000</bug_when>
    <thetext>That needs to be fixed too, but I was using Transferable as a way to annotate interfaces, that also broke.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94643</commentid>
    <comment_count>7</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2013-10-13 21:09:56 +0000</bug_when>
    <thetext>The long term solution to this is https://github.com/dslomov-chromium/ecmascript-structured-clone integrated into ES by the way. Making ES aware of structured cloning and multiple globals, and then retrofit the platform language in terms of that.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94646</commentid>
    <comment_count>8</comment_count>
    <who name="Cameron McCormack">cam</who>
    <bug_when>2013-10-13 22:49:06 +0000</bug_when>
    <thetext>Aside from needing to move the typed array intefaces types into built-in type names in Web IDL, perhaps we should have a way of tagging types as being transferable that does not use &quot;implements&quot; (and therefore does not require them to be interfaces).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94651</commentid>
    <comment_count>9</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2013-10-14 09:26:55 +0000</bug_when>
    <thetext>Yeah, the long term solution would basically demand an IDL annotation for an object being transferable. It would then have an ES [[Transfer]] and such operator defined.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94673</commentid>
    <comment_count>10</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2013-10-14 18:44:47 +0000</bug_when>
    <thetext>That would work too, but it would be less pretty since then I&apos;d need both a union and a way to annotate types.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94790</commentid>
    <comment_count>11</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2013-10-15 17:16:55 +0000</bug_when>
    <thetext>I think IDL could also offer a type that represents objects that have [[Transfer]] to take care of that. But yes, that would also be needed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96463</commentid>
    <comment_count>12</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2013-11-18 22:33:25 +0000</bug_when>
    <thetext>heycam, I think Anne&apos;s suggestion is the best so far: a way to annotate types, and then a type that means &quot;all the types that were so annotated&quot;. Kind of like an automatic union.

This would presumably look like this on the annotaton side:

   [PleaseAlsoConsiderThisTypeToBeA=Transferable] interface Foo { ... }

...and like this on the use side:

   void myMethod(Transferable quux);

Is that feasible?

(Presumably we&apos;d then say that ArrayBuffer was one of these on the prose side, since ES doesn&apos;t use IDL?)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>99944</commentid>
    <comment_count>13</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2014-02-06 20:19:00 +0000</bug_when>
    <thetext>I ended up just hard-coding it all in HTML. If new specs want to add new Transferables, they can just ask and I&apos;ll add it.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>