<?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>23685</bug_id>
          
          <creation_ts>2013-10-30 19:23:45 +0000</creation_ts>
          <short_desc>postMessage should not be required to throw when attempting to transfer the &quot;target&quot; port</short_desc>
          <delta_ts>2013-11-21 23:49:07 +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>FIXED</resolution>
          
          
          <bug_file_loc></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 name="Adam Klein">adamk</reporter>
          <assigned_to name="Ian &apos;Hixie&apos; Hickson">ian</assigned_to>
          <cc>ian</cc>
    
    <cc>jonas</cc>
    
    <cc>mike</cc>
          
          <qa_contact>contributor</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>95572</commentid>
    <comment_count>0</comment_count>
    <who name="Adam Klein">adamk</who>
    <bug_when>2013-10-30 19:23:45 +0000</bug_when>
    <thetext>In Step 4.2 of http://www.whatwg.org/specs/web-apps/current-work/multipage/web-messaging.html#dom-messageport-postmessage, user agents are required to throw a DataCloneError if the &quot;target&quot; port (that which will receive this message) is passed in the transfer argument. This is a well-meaning requirement, since there&apos;s no way to make sense of such a postMessage call, but in multi-process, multi-threaded user agents it can be difficult-to-impossible to determine what is at the remote end of a MessagePort. See https://code.google.com/p/chromium/issues/detail?id=312962, which includes a test case that fails to throw on both Chrome and Safari.

An alternative would be to remove the throwing requirement and replace it with an async requirement to abort the process and optionally log a console message.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95619</commentid>
    <comment_count>1</comment_count>
    <who name="Adam Klein">adamk</who>
    <bug_when>2013-10-31 17:40:23 +0000</bug_when>
    <thetext>A halfway proposal would also allow user agents than can synchronously detect this error condition to throw.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95621</commentid>
    <comment_count>2</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2013-10-31 19:15:10 +0000</bug_when>
    <thetext>I think we want it to be consistent for all cases. So, no throwing, but throw a console message once you realise it&apos;s a lost cause.

Maybe once we add a way to detect that the other side has died unexpectedly, we can make this be one of those cases, too.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96342</commentid>
    <comment_count>3</comment_count>
    <who name="Adam Klein">adamk</who>
    <bug_when>2013-11-14 19:27:30 +0000</bug_when>
    <thetext>Blink has stopped throwing in this case as of http://src.chromium.org/viewvc/blink?view=revision&amp;revision=161083

(cc Jonas so he can route appropriately at Mozilla, I believe they&apos;re currently working on implementing MessagePort transferring)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96677</commentid>
    <comment_count>4</comment_count>
    <who name="">contributor</who>
    <bug_when>2013-11-21 23:49:07 +0000</bug_when>
    <thetext>Checked in as WHATWG revision r8306.
Check-in comment: People apparently don&apos;t like it when the spec requires things that are impossible to implement, go figure. (In this case, synchronously detecting that one of the MessagePorts being Transferred in the MessagePort message is actually the target of the message. You can&apos;t necessarily know this synchronously, since if the port has been shunted around between workers, you might only discover who the final target actually is after the message has itself bounced between threads for a while.)
http://html5.org/tools/web-apps-tracker?from=8305&amp;to=8306</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>