Skip to content
Permalink
Browse files

[e] (0) Defer to the origin spec for URL origin.

Fixing http://www.w3.org/Bugs/Public/show_bug.cgi?id=14392

git-svn-id: http://svn.whatwg.org/webapps@6728 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information...
Hixie committed Oct 21, 2011
1 parent 6a68524 commit 84696c765517e366f1eb6c38ac26bdcf234f6ee5
Showing with 7 additions and 198 deletions.
  1. +2 −61 complete.html
  2. +2 −61 index
  3. +3 −76 source
<dd>

<p>The <a href=#origin>origin</a> and <a href=#effective-script-origin>effective script
origin</a> of the <a href=#url>URL</a> is whatever is returned by
the following algorithm:</p>

<ol><li><p>Let <var title="">url</var> be the <a href=#url>URL</a> for
which the <a href=#origin>origin</a> is being determined.</li>

<li><p><a href=#parse-a-url title="parse a url">Parse</a> <var title="">url</var>.</li>

<li><p>If <var title="">url</var> identifies a resource that is
its own trust domain (e.g. it identifies an e-mail on an IMAP
server or a post on an NNTP server) then return a globally unique
identifier specific to the resource identified by <var title="">url</var>, so that if this algorithm is invoked again
for <a href=#url title=URL>URLs</a> that identify the same resource,
the same identifier will be returned.</li>

<li><p>If <var title="">url</var> does not use a server-based
naming authority, or if parsing <var title="">url</var> failed,
or if <var title="">url</var> is not an <a href=#absolute-url>absolute
URL</a>, then return a new globally unique
identifier.</li>

<li><p>Let <var title="">scheme</var> be the <a href=#url-scheme title=url-scheme>&lt;scheme&gt;</a> component of <var title="">url</var>, <a href=#converted-to-ascii-lowercase>converted to ASCII lowercase</a>.</li>

<li><p>If the UA doesn't support the protocol given by <var title="">scheme</var>, then return a new globally unique
identifier.</li>

<li><p>If <var title="">scheme</var> is "<code title="">file</code>", then the user agent may return a
UA-specific value.</li>

<li><p>Let <var title="">host</var> be the <a href=#url-host title=url-host>&lt;host&gt;</a> component of <var title="">url</var>.</li>

<li>

<p>Apply the IDNA ToASCII algorithm to <var title="">host</var>,
with both the AllowUnassigned and UseSTD3ASCIIRules flags
set. Let <var title="">host</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 return a new globally unique
identifier. <a href=#refsRFC3490>[RFC3490]</a></p>

</li>

<li><p>Let <var title="">host</var> be the result of converting
<var title="">host</var> <a href=#converted-to-ascii-lowercase title="converted to ASCII lowercase">to
ASCII lowercase</a>.</li>

<li><p>If there is no <a href=#url-port title=url-port>&lt;port&gt;</a>
component, then let <var title="">port</var> be the default port
for the protocol given by <var title="">scheme</var>. Otherwise,
let <var title="">port</var> be the <a href=#url-port title=url-port>&lt;port&gt;</a> component of <var title="">url</var>.</li>

<li><p>Return the tuple (<var title="">scheme</var>, <var title="">host</var>, <var title="">port</var>).</li>

</ol><p>In addition, if the <a href=#url>URL</a> is in fact associated with
a <code><a href=#document>Document</a></code> object that was created by parsing the
resource obtained from fetching <a href=#url>URL</a>, and this was
done over a secure connection, then the server's secure
certificate may be added to the origin as additional data.</p>
origin</a> of the <a href=#url>URL</a> are the origin defined in
<cite>The Web Origin Concept</cite>. <a href=#refsORIGIN>[ORIGIN]</a></p>

</dd>

63 index
<dd>

<p>The <a href=#origin>origin</a> and <a href=#effective-script-origin>effective script
origin</a> of the <a href=#url>URL</a> is whatever is returned by
the following algorithm:</p>

<ol><li><p>Let <var title="">url</var> be the <a href=#url>URL</a> for
which the <a href=#origin>origin</a> is being determined.</li>

<li><p><a href=#parse-a-url title="parse a url">Parse</a> <var title="">url</var>.</li>

<li><p>If <var title="">url</var> identifies a resource that is
its own trust domain (e.g. it identifies an e-mail on an IMAP
server or a post on an NNTP server) then return a globally unique
identifier specific to the resource identified by <var title="">url</var>, so that if this algorithm is invoked again
for <a href=#url title=URL>URLs</a> that identify the same resource,
the same identifier will be returned.</li>

<li><p>If <var title="">url</var> does not use a server-based
naming authority, or if parsing <var title="">url</var> failed,
or if <var title="">url</var> is not an <a href=#absolute-url>absolute
URL</a>, then return a new globally unique
identifier.</li>

<li><p>Let <var title="">scheme</var> be the <a href=#url-scheme title=url-scheme>&lt;scheme&gt;</a> component of <var title="">url</var>, <a href=#converted-to-ascii-lowercase>converted to ASCII lowercase</a>.</li>

<li><p>If the UA doesn't support the protocol given by <var title="">scheme</var>, then return a new globally unique
identifier.</li>

<li><p>If <var title="">scheme</var> is "<code title="">file</code>", then the user agent may return a
UA-specific value.</li>

<li><p>Let <var title="">host</var> be the <a href=#url-host title=url-host>&lt;host&gt;</a> component of <var title="">url</var>.</li>

<li>

<p>Apply the IDNA ToASCII algorithm to <var title="">host</var>,
with both the AllowUnassigned and UseSTD3ASCIIRules flags
set. Let <var title="">host</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 return a new globally unique
identifier. <a href=#refsRFC3490>[RFC3490]</a></p>

</li>

<li><p>Let <var title="">host</var> be the result of converting
<var title="">host</var> <a href=#converted-to-ascii-lowercase title="converted to ASCII lowercase">to
ASCII lowercase</a>.</li>

<li><p>If there is no <a href=#url-port title=url-port>&lt;port&gt;</a>
component, then let <var title="">port</var> be the default port
for the protocol given by <var title="">scheme</var>. Otherwise,
let <var title="">port</var> be the <a href=#url-port title=url-port>&lt;port&gt;</a> component of <var title="">url</var>.</li>

<li><p>Return the tuple (<var title="">scheme</var>, <var title="">host</var>, <var title="">port</var>).</li>

</ol><p>In addition, if the <a href=#url>URL</a> is in fact associated with
a <code><a href=#document>Document</a></code> object that was created by parsing the
resource obtained from fetching <a href=#url>URL</a>, and this was
done over a secure connection, then the server's secure
certificate may be added to the origin as additional data.</p>
origin</a> of the <a href=#url>URL</a> are the origin defined in
<cite>The Web Origin Concept</cite>. <a href=#refsORIGIN>[ORIGIN]</a></p>

</dd>

79 source
<dd>

<p>The <span>origin</span> and <span>effective script
origin</span> of the <span>URL</span> is whatever is returned by
the following algorithm:</p>

<ol>

<li><p>Let <var title="">url</var> be the <span>URL</span> for
which the <span>origin</span> is being determined.</p></li>

<li><p><span title="parse a url">Parse</span> <var
title="">url</var>.</p></li>

<li><p>If <var title="">url</var> identifies a resource that is
its own trust domain (e.g. it identifies an e-mail on an IMAP
server or a post on an NNTP server) then return a globally unique
identifier specific to the resource identified by <var
title="">url</var>, so that if this algorithm is invoked again
for <span title="URL">URLs</span> that identify the same resource,
the same identifier will be returned.</p></li>

<li><p>If <var title="">url</var> does not use a server-based
naming authority, or if parsing <var title="">url</var> failed,
or if <var title="">url</var> is not an <span>absolute
URL</span>, then return a new globally unique
identifier.</p></li>

<li><p>Let <var title="">scheme</var> be the <span
title="url-scheme">&lt;scheme&gt;</span> component of <var
title="">url</var>, <span>converted to ASCII lowercase</span>.</p></li>

<li><p>If the UA doesn't support the protocol given by <var
title="">scheme</var>, then return a new globally unique
identifier.</p></li>

<li><p>If <var title="">scheme</var> is "<code
title="">file</code>", then the user agent may return a
UA-specific value.</p></li>

<li><p>Let <var title="">host</var> be the <span
title="url-host">&lt;host&gt;</span> component of <var
title="">url</var>.</p></li>

<li>

<p>Apply the IDNA ToASCII algorithm to <var title="">host</var>,
with both the AllowUnassigned and UseSTD3ASCIIRules flags
set. Let <var title="">host</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 return a new globally unique
identifier. <a href="#refsRFC3490">[RFC3490]</a></p>

</li>

<li><p>Let <var title="">host</var> be the result of converting
<var title="">host</var> <span title="converted to ASCII lowercase">to
ASCII lowercase</span>.</p></li>

<li><p>If there is no <span title="url-port">&lt;port&gt;</span>
component, then let <var title="">port</var> be the default port
for the protocol given by <var title="">scheme</var>. Otherwise,
let <var title="">port</var> be the <span
title="url-port">&lt;port&gt;</span> component of <var
title="">url</var>.</p></li>

<li><p>Return the tuple (<var title="">scheme</var>, <var
title="">host</var>, <var title="">port</var>).</p></li>

</ol>

<p>In addition, if the <span>URL</span> is in fact associated with
a <code>Document</code> object that was created by parsing the
resource obtained from fetching <span>URL</span>, and this was
done over a secure connection, then the server's secure
certificate may be added to the origin as additional data.</p>
origin</span> of the <span>URL</span> are the origin defined in
<cite>The Web Origin Concept</cite>. <a
href="#refsORIGIN">[ORIGIN]</a></p>

</dd>

0 comments on commit 84696c7

Please sign in to comment.
You can’t perform that action at this time.