Skip to content

Commit

Permalink
[e] (0) Make this a bit clearer.
Browse files Browse the repository at this point in the history
Fixing https://www.w3.org/Bugs/Public/show_bug.cgi?id=20922
Affected topics: Security

git-svn-id: http://svn.whatwg.org/webapps@7842 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Apr 15, 2013
1 parent af1b8e2 commit ddb4cbe
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 15 deletions.
17 changes: 12 additions & 5 deletions complete.html
Original file line number Diff line number Diff line change
Expand Up @@ -65586,12 +65586,13 @@ <h4 id=relaxing-the-same-origin-restriction><span class=secno>6.3.1 </span>Relax
</dd>

</dl><div class=impl>
<!--CLEANUP-->

<p>The <dfn id=dom-document-domain title=dom-document-domain><code>domain</code></dfn> attribute on
<code><a href=#document>Document</a></code> objects must be initialized to <a href="#the-document's-domain">the document's domain</a>, if it has
one, and the empty string otherwise. If the value is an IPv6 address, then the square brackets
from the <a href=#concept-url-host title=concept-url-host>host</a> component must be omitted from the attribute's
value.</p>
one, and the empty string otherwise. If the value starts with a U+005B LEFT SQUARE BRACKET
character ([) and ends with a U+005D RIGHT SQUARE BRACKET character (]), it is an IPv6 address;
these square brackets must be omitted when initializing the attribute's value.</p>

<p>On getting, the attribute must return its current value, unless the <code><a href=#document>Document</a></code> has
no <a href=#browsing-context>browsing context</a>, in which case it must return the empty string.</p>
Expand All @@ -65606,8 +65607,9 @@ <h4 id=relaxing-the-same-origin-restriction><span class=secno>6.3.1 </span>Relax
</li>

<li>
<!--CLEANUP-->

<p>If the new value is an IP address, let <var title="">new value</var> be the new value.
<p>If the new value is an IPv4 or IPv6 address, let <var title="">new value</var> be the new value.
Otherwise, apply the IDNA ToASCII algorithm to the new value, with both the AllowUnassigned and
UseSTD3ASCIIRules flags set, and let <var title="">new value</var> be the result of the ToASCII
algorithm.</p>
Expand All @@ -65623,8 +65625,9 @@ <h4 id=relaxing-the-same-origin-restriction><span class=secno>6.3.1 </span>Relax
<p>If <var title="">new value</var> is not exactly equal to the current value of the <code title=dom-document-domain><a href=#dom-document-domain>document.domain</a></code> attribute, then run these substeps:</p>

<ol><li>
<!--CLEANUP-->

<p>If the current value is an IP address, throw a <code><a href=#securityerror>SecurityError</a></code> exception and
<p>If the current value is an IPv4 or IPv6 address, throw a <code><a href=#securityerror>SecurityError</a></code> exception and
abort these steps.</p>

</li>
Expand All @@ -65635,6 +65638,10 @@ <h4 id=relaxing-the-same-origin-restriction><span class=secno>6.3.1 </span>Relax
match the end of the current value, throw a <code><a href=#securityerror>SecurityError</a></code> exception and abort
these steps.</p>

<p class=note>If the <var title="">new value</var> is an IPv4 or IPv6 address, it cannot
match the <var title="">new value</var> in this way and thus an exception will be thrown
here.</p>

<!-- this is the step that prevents us from ever setting document.domain if the >effective
script origin< isn't a scheme/host/port tuple -->

Expand Down
17 changes: 12 additions & 5 deletions index
Original file line number Diff line number Diff line change
Expand Up @@ -65586,12 +65586,13 @@ x === this; // true</pre>
</dd>

</dl><div class=impl>
<!--CLEANUP-->

<p>The <dfn id=dom-document-domain title=dom-document-domain><code>domain</code></dfn> attribute on
<code><a href=#document>Document</a></code> objects must be initialized to <a href="#the-document's-domain">the document's domain</a>, if it has
one, and the empty string otherwise. If the value is an IPv6 address, then the square brackets
from the <a href=#concept-url-host title=concept-url-host>host</a> component must be omitted from the attribute's
value.</p>
one, and the empty string otherwise. If the value starts with a U+005B LEFT SQUARE BRACKET
character ([) and ends with a U+005D RIGHT SQUARE BRACKET character (]), it is an IPv6 address;
these square brackets must be omitted when initializing the attribute's value.</p>

<p>On getting, the attribute must return its current value, unless the <code><a href=#document>Document</a></code> has
no <a href=#browsing-context>browsing context</a>, in which case it must return the empty string.</p>
Expand All @@ -65606,8 +65607,9 @@ x === this; // true</pre>
</li>

<li>
<!--CLEANUP-->

<p>If the new value is an IP address, let <var title="">new value</var> be the new value.
<p>If the new value is an IPv4 or IPv6 address, let <var title="">new value</var> be the new value.
Otherwise, apply the IDNA ToASCII algorithm to the new value, with both the AllowUnassigned and
UseSTD3ASCIIRules flags set, and let <var title="">new value</var> be the result of the ToASCII
algorithm.</p>
Expand All @@ -65623,8 +65625,9 @@ x === this; // true</pre>
<p>If <var title="">new value</var> is not exactly equal to the current value of the <code title=dom-document-domain><a href=#dom-document-domain>document.domain</a></code> attribute, then run these substeps:</p>

<ol><li>
<!--CLEANUP-->

<p>If the current value is an IP address, throw a <code><a href=#securityerror>SecurityError</a></code> exception and
<p>If the current value is an IPv4 or IPv6 address, throw a <code><a href=#securityerror>SecurityError</a></code> exception and
abort these steps.</p>

</li>
Expand All @@ -65635,6 +65638,10 @@ x === this; // true</pre>
match the end of the current value, throw a <code><a href=#securityerror>SecurityError</a></code> exception and abort
these steps.</p>

<p class=note>If the <var title="">new value</var> is an IPv4 or IPv6 address, it cannot
match the <var title="">new value</var> in this way and thus an exception will be thrown
here.</p>

<!-- this is the step that prevents us from ever setting document.domain if the >effective
script origin< isn't a scheme/host/port tuple -->

Expand Down
17 changes: 12 additions & 5 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -73355,12 +73355,13 @@ x === this; // true</pre>
</dl>

<div class="impl">
<!--CLEANUP-->

<p>The <dfn title="dom-document-domain"><code>domain</code></dfn> attribute on
<code>Document</code> objects must be initialized to <span>the document's domain</span>, if it has
one, and the empty string otherwise. If the value is an IPv6 address, then the square brackets
from the <span title="concept-url-host">host</span> component must be omitted from the attribute's
value.</p>
one, and the empty string otherwise. If the value starts with a U+005B LEFT SQUARE BRACKET
character ([) and ends with a U+005D RIGHT SQUARE BRACKET character (]), it is an IPv6 address;
these square brackets must be omitted when initializing the attribute's value.</p>

<p>On getting, the attribute must return its current value, unless the <code>Document</code> has
no <span>browsing context</span>, in which case it must return the empty string.</p>
Expand All @@ -73377,8 +73378,9 @@ x === this; // true</pre>
</li>

<li>
<!--CLEANUP-->

<p>If the new value is an IP address, let <var title="">new value</var> be the new value.
<p>If the new value is an IPv4 or IPv6 address, let <var title="">new value</var> be the new value.
Otherwise, apply the IDNA ToASCII algorithm to the new value, with both the AllowUnassigned and
UseSTD3ASCIIRules flags set, and let <var title="">new value</var> be the result of the ToASCII
algorithm.</p>
Expand All @@ -73397,8 +73399,9 @@ x === this; // true</pre>
<ol>

<li>
<!--CLEANUP-->

<p>If the current value is an IP address, throw a <code>SecurityError</code> exception and
<p>If the current value is an IPv4 or IPv6 address, throw a <code>SecurityError</code> exception and
abort these steps.</p>

</li>
Expand All @@ -73409,6 +73412,10 @@ x === this; // true</pre>
match the end of the current value, throw a <code>SecurityError</code> exception and abort
these steps.</p>

<p class="note">If the <var title="">new value</var> is an IPv4 or IPv6 address, it cannot
match the <var title="">new value</var> in this way and thus an exception will be thrown
here.</p>

<!-- this is the step that prevents us from ever setting document.domain if the >effective
script origin< isn't a scheme/host/port tuple -->

Expand Down

0 comments on commit ddb4cbe

Please sign in to comment.