<?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>7375</bug_id>
          
          <creation_ts>2009-08-19 22:13:31 +0000</creation_ts>
          <short_desc>Incorrect specification for window.postMessage()&apos;s handling of unentangled ports</short_desc>
          <delta_ts>2010-10-04 13:56:17 +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>pre-LC1 HTML5 spec (editor: Ian Hickson)</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>VERIFIED</bug_status>
          <resolution>WORKSFORME</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>NE, NoReply</keywords>
          <priority>P3</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>LC</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Drew Wilson">atwilson</reporter>
          <assigned_to name="Ian &apos;Hixie&apos; Hickson">ian</assigned_to>
          <cc>mike</cc>
    
    <cc>public-html-admin</cc>
    
    <cc>public-html-wg-issue-tracking</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>26543</commentid>
    <comment_count>0</comment_count>
    <who name="Drew Wilson">atwilson</who>
    <bug_when>2009-08-19 22:13:31 +0000</bug_when>
    <thetext>Currently, the checks specified for MessagePort.postMessage() are different from the checks done in window.postMessage() (as described in section 7.2.4 &quot;Posting messages with message ports&quot;).

In particular, step 4 of section 7.2.4 says:

If any of the entries in ports are null, if any of the entries in ports are not entangled MessagePort objects, or if any MessagePort object is listed in ports more than once, then throw an INVALID_STATE_ERR exception.

The spec for MessagePort.postMessage() does not throw an exception if any of the entries in ports are not entangled (per this thread). We should probably update the spec for window.postMessage() to define the same behavior there as well.

Also, as written, the spec now incorrectly lets us send a cloned port multiple times. So code like this would not generate an error:

var channel = new MessageChannel();
otherWindow.postMessage(&quot;message1&quot;, channel.port1);
otherWindow.postMessage(&quot;message2&quot;, channel.port1);   // Sent the same port again

The current WebKit behavior is to throw an INVALID_STATE_ERR in this case, while still allowing closed ports to be sent, which I believe is the intended behavior based on previous discussions. If this is correct, we should update the spec to prohibit resending cloned ports.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>27339</commentid>
    <comment_count>1</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2009-09-19 22:08:13 +0000</bug_when>
    <thetext>I believe this was fixed a while back in response to an e-mail to this effect.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>33293</commentid>
    <comment_count>2</comment_count>
    <who name="Maciej Stachowiak">mjs</who>
    <bug_when>2010-03-14 14:49:47 +0000</bug_when>
    <thetext>This bug predates the HTML Working Group Decision Policy.

If you are satisfied with the resolution of this bug, 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

This bug is now being moved to VERIFIED. Please respond within two weeks. If this bug is not closed, reopened or escalated within two weeks, it may be marked as NoReply and will no longer be considered a pending comment.
</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>