<?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>13967</bug_id>
          
          <creation_ts>2011-08-30 04:28:14 +0000</creation_ts>
          <short_desc>Webkit implementation swaps second argument &apos;targetOrigin&apos; with third argument &apos;ports&apos;</short_desc>
          <delta_ts>2011-10-17 22:21:19 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebAppsWG</product>
          <component>Web Messaging (editor: Ian Hickson)</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/#introduction-15</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P3</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>contributor</reporter>
          <assigned_to name="Ian &apos;Hixie&apos; Hickson">ian</assigned_to>
          <cc>bugs</cc>
    
    <cc>ian</cc>
    
    <cc>johnjbarton</cc>
    
    <cc>mike</cc>
    
    <cc>public-webapps</cc>
          
          <qa_contact>public-webapps-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>56023</commentid>
    <comment_count>0</comment_count>
    <who name="">contributor</who>
    <bug_when>2011-08-30 04:28:14 +0000</bug_when>
    <thetext>Specification: http://www.whatwg.org/specs/web-apps/current-work/complete/web-messaging.html
Multipage: http://www.whatwg.org/C#introduction-15
Complete: http://www.whatwg.org/c#introduction-15

Comment:
Webkit implementation does not use the second argument &apos;targetOrigin&apos;,

Posted from: 24.6.123.36
User agent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/535.2 (KHTML, like Gecko) Chrome/15.0.862.0 Safari/535.2</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>56024</commentid>
    <comment_count>1</comment_count>
    <who name="johnjbarton">johnjbarton</who>
    <bug_when>2011-08-30 04:38:41 +0000</bug_when>
    <thetext>Bug 63141 - Wrong argument order in window.postMessage
https://bugs.webkit.org/show_bug.cgi?id=63141</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>56043</commentid>
    <comment_count>2</comment_count>
    <who name="johnjbarton">johnjbarton</who>
    <bug_when>2011-08-30 15:53:49 +0000</bug_when>
    <thetext>Corrected the title and offering an opinion:

I think the spec should prefer the arguments for MessageChannel postMessage and window postMessage to be the same:
  otherWindow.postMessage(message, targetOrigin, ports);
Spec can allow implementations to allow type detection on the arguments such that
  otherWindow.postMessage(message, ports, targetOrigin);
is allowed.  The argument |port| must be typeof object and |targetOrigin| must be typeof string.

Unfortunately this issue is important for MessageChannel primarily because the spec seems to be the only documentation currently available.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>58300</commentid>
    <comment_count>3</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-10-17 21:50:08 +0000</bug_when>
    <thetext>Looks like only WebKit implements MessagePort through postMessage() correctly enough for this to matter, and WebKit allows the second and third arguments in either order. So I&apos;ve changed the spec to match that.

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: see diff given below
Rationale: Concurred with reporter&apos;s comments.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>58301</commentid>
    <comment_count>4</comment_count>
    <who name="">contributor</who>
    <bug_when>2011-10-17 21:51:04 +0000</bug_when>
    <thetext>Checked in as WHATWG revision r6690.
Check-in comment: Make postMessage() accept the second and third arguments in either order. Compat with WebKit and hopefully solves the difficulty people have about remembering which goes first.
http://html5.org/tools/web-apps-tracker?from=6689&amp;to=6690</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>58302</commentid>
    <comment_count>5</comment_count>
    <who name="Olli Pettay">bugs</who>
    <bug_when>2011-10-17 22:02:40 +0000</bug_when>
    <thetext>Webkit&apos;s behavior makes no sense. We shouldn&apos;t define implementation bugs in the
specs if just possible.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>58303</commentid>
    <comment_count>6</comment_count>
    <who name="">contributor</who>
    <bug_when>2011-10-17 22:13:38 +0000</bug_when>
    <thetext>Checked in as WHATWG revision r6691.
Check-in comment: Revert last checkin. My testing was bogus.
http://html5.org/tools/web-apps-tracker?from=6690&amp;to=6691</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>58304</commentid>
    <comment_count>7</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-10-17 22:15:14 +0000</bug_when>
    <thetext>Yeah my testing was bogus, WebKit doesn&apos;t do that. (Though I kinda wish it did. I don&apos;t think it&apos;s as bad as you and zcorpan seem to think.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>58306</commentid>
    <comment_count>8</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-10-17 22:21:19 +0000</bug_when>
    <thetext>Ok so the situation here is that Opera does what the spec says today and WebKit does what the spec used to say. The proposal in comment 2, to support either order, got a pretty negative reaction as soon as I put it in, from both Olli and Simon. So...

Unless there&apos;s a compat need due to WebKit having long shipped with the arguments the other way around, we should stick to the order we have now.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>