[html5] r1504 - /

whatwg at whatwg.org whatwg at whatwg.org
Mon Apr 28 18:22:40 PDT 2008


Author: ianh
Date: 2008-04-28 18:22:39 -0700 (Mon, 28 Apr 2008)
New Revision: 1504

Modified:
   index
   source
Log:
[giow] (2) Define MessageEvent.origin for postMessage() in the face of IDN.

Modified: index
===================================================================
--- index	2008-04-28 22:56:55 UTC (rev 1503)
+++ index	2008-04-29 01:22:39 UTC (rev 1504)
@@ -25,7 +25,7 @@
 
    <h1 id=html-5>HTML 5</h1>
 
-   <h2 class="no-num no-toc" id=working>Working Draft — 28 April 2008</h2>
+   <h2 class="no-num no-toc" id=working>Working Draft — 29 April 2008</h2>
 
    <p>You can take part in this work. <a
     href="http://www.whatwg.org/mailing-list">Join the working group's
@@ -27209,6 +27209,33 @@
      change it.</p>
   </dl>
 
+  <p>The <dfn id=serialisation0>serialisation of an origin</dfn> is the
+   string obtained by applying the following algorithm to the given <a
+   href="#origin0">origin</a>:
+
+  <ol>
+   <li>If the <a href="#origin0">origin</a> in question is not a
+    scheme/host/port tuple, then return the empty string.
+
+   <li>Otherwise, let <var title="">result</var> be the scheme part of the
+    origin tuple.
+
+   <li>Append the string "<code title="">://</code>" to <var
+    title="">result</var>.
+
+   <li>Apply the IDNA ToUnicode algorithm to each component of the host part
+    of the origin tuple, and append the results — each component, in
+    the same order, separated by U+002E FULL STOP characters (".") — to
+    <var title="">result</var>.
+
+   <li>If the port part of the origin tuple gives a port that is different
+    from the default port for the protocol given by the scheme part of the
+    origin tuple, then append a U+003A COLON character (":") and the given
+    port, in base ten, to <var title="">result</var>.
+
+   <li>Return <var title="">result</var>.
+  </ol>
+
   <h4 id=relaxing><span class=secno>4.3.1 </span>Relaxing the same-origin
    restriction</h4>
 
@@ -27230,6 +27257,9 @@
    current value is not an IP address and the new value, prefixed by a U+002E
    FULL STOP ("."), exactly matches the end of the current value.
 
+  <p class=big-issue>Should change this to a step-by-step algorithm so that
+   we can support both IDNA and punycode input.
+
   <p>The <dfn id=domain0 title="the document's domain">domain</dfn> of a
    <code>Document</code> is the host part of the document's <a
    href="#origin0">origin</a>, if that is a tuple. If it isn't, then the
@@ -38519,19 +38549,23 @@
      title=dom-window-postMessage><a
      href="#postmessage">postMessage()</a></code> method, the <code
      title=dom-MessageEvent-origin><a href="#origin1">origin</a></code>
-     attribute must be set to the <a href="#origin0">origin</a> of the
-     document that the script that invoked the methods is associated with,
-     the <code title=dom-MessageEvent-lastEventId><a
+     attribute must be set to the <a href="#serialisation0"
+     title="serialisation of an origin">serialisation</a> of the <a
+     href="#origin0">origin</a> of the script that invoked the method, the
+     <code title=dom-MessageEvent-lastEventId><a
      href="#lasteventid">lastEventId</a></code> attribute must be set to the
      empty string, and the <code title=dom-MessageEvent-source><a
      href="#source2">source</a></code> attribute must be set to the <code><a
-     href="#window">Window</a></code> object of the default view of the
-     browsing context with which that document is associated.</p>
+     href="#window">Window</a></code> object of the <a
+     href="#default3">default view</a> of the <a href="#browsing0">browsing
+     context</a> for which the <code>Document</code> object with which the
+     script is associated is the <a href="#active">active
+     document</a><!--, if there is one, or null
+    otherwise-->.</p>
+    <!-- I think there always is one, because scripts
+    can't run and see a Window without that being the case. -->
+    
 
-    <p class=big-issue>Define 'origin' more exactly -- IDN vs no IDN (should
-     probably be exposing unicode), effect of window.document.domain on its
-     value, etc</p>
-
    <li>
     <p>Dispatch the event created in the previous step at the <code><a
      href="#window">Window</a></code> object on which the method was invoked.</p>

Modified: source
===================================================================
--- source	2008-04-28 22:56:55 UTC (rev 1503)
+++ source	2008-04-29 01:22:39 UTC (rev 1504)
@@ -24926,8 +24926,38 @@
 
   </dl>
 
+  <p>The <dfn>serialisation of an origin</dfn> is the string obtained
+  by applying the following algorithm to the given
+  <span>origin</span>:</p>
 
+  <ol>
 
+   <li>If the <span>origin</span> in question is not a
+   scheme/host/port tuple, then return the empty string.</li>
+
+   <li>Otherwise, let <var title="">result</var> be the scheme part of
+   the origin tuple.</li>
+
+   <li>Append the string "<code title="">://</code>" to <var
+   title="">result</var>.</li>
+
+   <li>Apply the IDNA ToUnicode algorithm to each component of the
+   host part of the origin tuple, and append the results — each
+   component, in the same order, separated by U+002E FULL STOP
+   characters (".") — to <var title="">result</var>.</li>
+
+   <li>If the port part of the origin tuple gives a port that is
+   different from the default port for the protocol given by the
+   scheme part of the origin tuple, then append a U+003A COLON
+   character (":") and the given port, in base ten, to <var
+   title="">result</var>.</li>
+
+   <li>Return <var title="">result</var>.</li>
+
+  </ol>
+
+
+
   <h4>Relaxing the same-origin restriction</h4>
 
   <p>The <dfn title="dom-document-domain"><code>domain</code></dfn>
@@ -24948,6 +24978,9 @@
   is not an IP address and the new value, prefixed by a U+002E FULL
   STOP ("."), exactly matches the end of the current value.</p>
 
+  <p class="big-issue">Should change this to a step-by-step algorithm
+  so that we can support both IDNA and punycode input.</p>
+
   <p>The <dfn title="the document's domain">domain</dfn> of a
   <code>Document</code> is the host part of the document's
   <span>origin</span>, if that is a tuple. If it isn't, then the
@@ -36048,18 +36081,19 @@
     the value passed as the <var title="">message</var> argument to
     the <code title="dom-window-postMessage">postMessage()</code>
     method, the <code title="dom-MessageEvent-origin">origin</code>
-    attribute must be set to the <span>origin</span> of the document
-    that the script that invoked the methods is associated with, the
-    <code title="dom-MessageEvent-lastEventId">lastEventId</code>
-    attribute must be set to the empty string, and the <code
+    attribute must be set to the <span title="serialisation of an
+    origin">serialisation</span> of the <span>origin</span> of the
+    script that invoked the method, the <code
+    title="dom-MessageEvent-lastEventId">lastEventId</code> attribute
+    must be set to the empty string, and the <code
     title="dom-MessageEvent-source">source</code> attribute must be
-    set to the <code>Window</code> object of the default view of the
-    browsing context with which that document is associated.</p>
+    set to the <code>Window</code> object of the <span>default
+    view</span> of the <span>browsing context</span> for which the
+    <code>Document</code> object with which the script is associated
+    is the <span>active document</span><!--, if there is one, or null
+    otherwise-->.</p><!-- I think there always is one, because scripts
+    can't run and see a Window without that being the case. -->
 
-    <p class="big-issue">Define 'origin' more exactly -- IDN vs no IDN
-    (should probably be exposing unicode), effect of
-    window.document.domain on its value, etc</p>
-
    </li>
 
    <li>




More information about the Commit-Watchers mailing list