[html5] r1506 - /

whatwg at whatwg.org whatwg at whatwg.org
Mon Apr 28 18:42:04 PDT 2008


Author: ianh
Date: 2008-04-28 18:42:04 -0700 (Mon, 28 Apr 2008)
New Revision: 1506

Modified:
   index
   source
Log:
[] (0) Support IDNA when setting document.domain.

Modified: index
===================================================================
--- index	2008-04-29 01:34:05 UTC (rev 1505)
+++ index	2008-04-29 01:42:04 UTC (rev 1506)
@@ -27243,23 +27243,51 @@
    attribute on <code>Document</code> objects must be initialised to <a
    href="#domain0">the document's domain</a>, if it has one, and the empty
    string otherwise. On getting, the attribute must return its current value.
-   On setting, if the new value is an allowed value (as defined below), the
-   attribute's value must be changed to the new value, and the <a
-   href="#effective3">effective script origin</a> of the
-   <code>Document</code> must be changed so that its host part is the new
-   value and the port part is "manual override". If the new value is not an
-   allowed value, then a <a href="#security9">security exception</a> must be
-   raised instead.
+   On setting, the user agent must run the following algorithm:
 
-  <p>A new value is an allowed value for the <code
-   title=dom-document-domain><a href="#domain">document.domain</a></code>
-   attribute if it is equal to the attribute's current value, or if the
-   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.
+  <ol>
+   <li>
+    <p>Apply the IDNA ToASCII algorithm to the new value, with both the
+     AllowUnassigned and UseSTD3ASCIIRules flags set. Let <var title="">new
+     value</var> be the result of the ToASCII algorithm.</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>If ToASCII fails to convert one of the components of the string, e.g.
+     because it is too long or because it contains invalid characters, then
+     throw a <a href="#security9">security exception</a> and abort these
+     steps. <a href="#refsRFC3490">[RFC3490]</a></p>
 
+   <li>
+    <p>If <var title="">new value</var> is not exactly equal to the current
+     value of the <code title=dom-document-domain><a
+     href="#domain">document.domain</a></code> attribute, then run these
+     substeps:</p>
+
+    <ol>
+     <li>
+      <p>If the current value is an IP address, throw a <a
+       href="#security9">security exception</a> and abort these steps.</p>
+
+     <li>
+      <p>If <var title="">new value</var>, prefixed by a U+002E FULL STOP
+       ("."), does not exactly match the end of the current value, throw a <a
+       href="#security9">security exception</a> and abort these steps.</p>
+    </ol>
+
+   <li>
+    <p>Set the attribute's value to <var title="">new value</var>.</p>
+
+   <li>
+    <p>Set the host part of the <a href="#effective3">effective script
+     origin</a> tuple of the <code>Document</code> to <var title="">new
+     value</var>.</p>
+
+   <li>
+    <p>Set the port part of the <a href="#effective3">effective script
+     origin</a> tuple of the <code>Document</code> to "manual override" (a
+     value that, for the purposes of comparing origins, is the same as
+     "manual override" but not the same as any other value).</p>
+  </ol>
+
   <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 scheme/host/port tuple. If it

Modified: source
===================================================================
--- source	2008-04-29 01:34:05 UTC (rev 1505)
+++ source	2008-04-29 01:42:04 UTC (rev 1506)
@@ -24964,23 +24964,79 @@
   attribute on <code>Document</code> objects must be initialised to
   <span>the document's domain</span>, if it has one, and the empty
   string otherwise. On getting, the attribute must return its current
-  value. On setting, if the new value is an allowed value (as defined
-  below), the attribute's value must be changed to the new value, and
-  the <span>effective script origin</span> of the
-  <code>Document</code> must be changed so that its host part is the
-  new value and the port part is "manual override". If the new value
-  is not an allowed value, then a <span>security exception</span> must
-  be raised instead.</p>
+  value. On setting, the user agent must run the following
+  algorithm:</p>
 
-  <p>A new value is an allowed value for the <code
-  title="dom-document-domain">document.domain</code> attribute if it
-  is equal to the attribute's current value, or if the 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>
+  <ol>
 
-  <p class="big-issue">Should change this to a step-by-step algorithm
-  so that we can support both IDNA and punycode input.</p>
+   <li>
 
+    <p>Apply the IDNA ToASCII algorithm to the new value, with both
+    the AllowUnassigned and UseSTD3ASCIIRules flags set. Let <var
+    title="">new value</var> be the result of the ToASCII
+    algorithm.</p>
+
+    <p>If ToASCII fails to convert one of the components of the
+    string, e.g. because it is too long or because it contains invalid
+    characters, then throw a <span>security exception</span> and abort
+    these steps. <a href="#refsRFC3490">[RFC3490]</a></p>
+
+   </li>
+
+   <li>
+
+    <p>If <var title="">new value</var> is not exactly equal to the
+    current value of the <code
+    title="dom-document-domain">document.domain</code> attribute, then
+    run these substeps:</p>
+
+    <ol>
+
+     <li>
+
+      <p>If the current value is an IP address, throw a <span>security
+      exception</span> and abort these steps.</p>
+
+     </li>
+
+     <li>
+
+      <p>If <var title="">new value</var>, prefixed by a U+002E FULL
+      STOP ("."), does not exactly match the end of the current value,
+      throw a <span>security exception</span> and abort these
+      steps.</p>
+
+     </li>
+
+    </ol>
+
+   </li>
+
+   <li>
+
+    <p>Set the attribute's value to <var title="">new value</var>.</p>
+
+   </li>
+
+   <li>
+
+    <p>Set the host part of the <span>effective script origin</span>
+    tuple of the <code>Document</code> to <var title="">new
+    value</var>.</p>
+
+   </li>
+
+   <li>
+
+    <p>Set the port part of the <span>effective script origin</span>
+    tuple of the <code>Document</code> to "manual override" (a value
+    that, for the purposes of comparing origins, is the same as
+    "manual override" but not the same as any other value).</p>
+
+   </li>
+
+  </ol>
+
   <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 scheme/host/port tuple. If it




More information about the Commit-Watchers mailing list