Skip to content
Permalink
Browse files

Remove the origin aliasing concept

Turns out effective script origins are shared, not aliased.

Fixes #794.
  • Loading branch information...
annevk authored and domenic committed Mar 14, 2016
1 parent fafd2e1 commit 438155d2a2255aa5ea84ae390744d8a8662ebec2
Showing with 50 additions and 81 deletions.
  1. +50 −81 source
131 source
origin</span> of <var>document</var>:</p>

<ul>
<li><p>If the new <span>browsing context</span> has a <span>creator browsing context</span>,
then the <span>origin</span> of <var>document</var> is an <span
data-x="concept-origin-alias">alias</span> to the <span>origin</span> of the <span>creator
<code>Document</code></span> and the <span>effective script origin</span> of
<var>document</var> is initially an <span data-x="concept-origin-alias">alias</span> to the
<span>effective script origin</span> of the <span>creator
<code>Document</code></span>.</p></li>
<li>
<p>If the new <span>browsing context</span> has a <span>creator browsing context</span>,
then the <span>origin</span> of <var>document</var> is a copy of the <span>origin</span> of
the <span>creator <code>Document</code></span> and the <span>effective script origin</span> of
<var>document</var> is the <span>effective script origin</span> of the <span>creator
<code>Document</code></span>.</p>

<p class="note">The <span>effective script origin</span> is shared and not copied
purposefully.</p>
</li>

<li><p>Otherwise, the <span>origin</span> of <var>document</var> is a globally unique
identifier assigned when the new <span>browsing context</span> is created and the
<span>effective script origin</span> of <var>document</var> is initially an <span
data-x="concept-origin-alias">alias</span> to its <span>origin</span>.</p></li>
<span>effective script origin</span> of <var>document</var> is a copy of its
<span>origin</span>.</p></li>
</ul>
</li>

connections, to ensure that if the site's secure certificate changes, the origin is considered to
change as well.</p>


<dt><dfn data-x="concept-origin-aliases">Aliases</dfn></dt>

<dd>

<p>A reference to another <span>origin</span> or <span>effective script origin</span>.</p>


</dl>

<div w-nodev>
<p class="note">An <span>effective script origin</span> can be shared, e.g., among multiple
<code>Document</code> objects, and can be changed through the <code
data-x="dom-document-domain">document.domain</code> API.</p>

<p>An <span>origin</span> or <span>effective script origin</span> can be defined as an <dfn
data-x="concept-origin-alias">alias</dfn> to another <span>origin</span> or <span>effective script
origin</span>. The value of the <span>origin</span> or <span>effective script origin</span> is
then the value of the <span>origin</span> or <span>effective script origin</span> to which it is
an alias.</p>
<div w-nodev>

<p>These characteristics are defined as follows:</p>

<p>The <span>origin</span> is a globally unique identifier assigned when the
<code>Document</code> is created.</p>

<p>The <span>effective script origin</span> is initially an <span
data-x="concept-origin-alias">alias</span> to the <span>origin</span> of the
<code>Document</code>.</p>
<p>The <span>effective script origin</span> is initially a copy of the <span>origin</span> of
the <code>Document</code>.</p>

</dd>


<dd>

<p>The <span>origin</span> is an <span data-x="concept-origin-alias">alias</span> to the
<span>origin</span> of <span>the <code>Document</code>'s address</span>.</p>
<p>The <span>origin</span> is a copy of the <span title="concept-url-origin">origin</span> of
<span>the <code>Document</code>'s address</span>.</p>

<p>The <span>effective script origin</span> is initially an <span
data-x="concept-origin-alias">alias</span> to the <span>origin</span> of the
<code>Document</code>.</p>
<p>The <span>effective script origin</span> is initially a copy of the <span>origin</span> of
the <code>Document</code>.</p>

</dd>


<dd>

<p>The <span>origin</span> is an <span data-x="concept-origin-alias">alias</span> to the
<span>origin</span> specified by the <span>incumbent settings object</span> when the <span>navigate</span>
algorithm was invoked, or, if no <span data-x="concept-script">script</span> was involved, of
the <span>node document</span> of the element that initiated the <span
data-x="navigate">navigation</span> to that <span>URL</span>.</p>
<p>The <span>origin</span> is a copy of the <span>origin</span> specified by the
<span>incumbent settings object</span> when the <span>navigate</span> algorithm was invoked,
or, if no <span data-x="concept-script">script</span> was involved, of the <span>node
document</span> of the element that initiated the <span data-x="navigate">navigation</span> to
that <span>URL</span>.</p>

<p>The <span>effective script origin</span> is initially an <span
data-x="concept-origin-alias">alias</span> to the <span>effective script origin</span> of that
same <span>environment settings object</span> or <code>Document</code>.</p>
<p>The <span>effective script origin</span> is the <span>effective script origin</span> of
that same <span>environment settings object</span> or <code>Document</code>.</p>

</dd>


<dd>

<p>The <span>origin</span> is an <span data-x="concept-origin-alias">alias</span> to the
<span>origin</span> of the <span>active document</span> of the <span>browsing context</span>
being navigated when the <span>navigate</span> algorithm was invoked.</p>
<p>The <span>origin</span> is a copy of the <span>origin</span> of the <span>active
document</span> of the <span>browsing context</span> being navigated when the
<span>navigate</span> algorithm was invoked.</p>

<p>The <span>effective script origin</span> is initially an <span
data-x="concept-origin-alias">alias</span> to the <span>effective script origin</span> of that
same <code>Document</code>.</p>
<p>The <span>effective script origin</span> is the <span>effective script origin</span> of
that same <code>Document</code>.</p>

</dd>


<dd>

<p>The <span>origin</span> of the <code>Document</code> is an <span
data-x="concept-origin-alias">alias</span> to the <span>origin</span> of the
<code>Document</code>'s <span data-x="concept-document-bc">browsing context</span>'s
<p>The <span>origin</span> of the <code>Document</code> is a copy of the <span>origin</span>
of the <code>Document</code>'s <span data-x="concept-document-bc">browsing context</span>'s
<span>browsing context container</span>'s <span>node document</span>.</p>

<p>The <span>effective script origin</span> is initially an <span
data-x="concept-origin-alias">alias</span> to the <span>effective script origin</span> of the
<p>The <span>effective script origin</span> is the <span>effective script origin</span> of the
<code>Document</code>'s <span data-x="concept-document-bc">browsing context</span>'s
<span>browsing context container</span>'s <span>node document</span>.</p>

<p>The default behaviour as defined in the WHATWG DOM standard applies. <ref spec=DOM>.</p>

<p class="note">The <span>origin</span> is a globally unique identifier assigned when the
<code>Document</code> is created, and the <span>effective script origin</span> is initially an
<span data-x="concept-origin-alias">alias</span> to the <span>origin</span> of the
<code>Document</code>.</p>
<code>Document</code> is created, and the <span>effective script origin</span> is a copy of
the <span>origin</span> of the <code>Document</code>.</p>

</dd>


<dt>If the image data is <span>CORS-same-origin</span></dt>

<dd>The <span>origin</span> is an <span data-x="concept-origin-alias">alias</span> to the
<span>origin</span> of the <code>img</code> element's <span>node document</span>.</dd>

<!-- all image loads go through the "potentially CORS-enabled fetch" algorithm so they're all
either CORS-cross-origin or CORS-same-origin if they succeed at all -->
<dd>The <span>origin</span> is a copy of the <span>origin</span> of the <code>img</code>
element's <span>node document</span>.</dd>

</dl>


<dt>If the <span>media data</span> is <span>CORS-same-origin</span></dt>

<dd>The <span>origin</span> is an <span data-x="concept-origin-alias">alias</span> to the
<span>origin</span> of the <span>media element</span>'s <span>node document</span>.</dd>
<dd>The <span>origin</span> is a copy of the <span>origin</span> of the <span>media
element</span>'s <span>node document</span>.</dd>

</dl>


<dd>

<p>The <span>origin</span> of a downloadable Web font is an <span
data-x="concept-origin-alias">alias</span> to the <span>origin</span> of the <span>absolute
URL</span> used to obtain the font (after any redirects). <ref spec=CSSFONTS>
<ref spec=CSSFONTLOAD></p> <!-- this means you can get data from a remote
site if you can make it redirect to your own site in some fashion controlled by the data you
want to read -->
<p>The <span>origin</span> of a downloadable Web font is a copy of the <span
title="concept-url-origin">origin</span> of the <span>absolute URL</span> used to obtain the
font (after any redirects). <ref spec=CSSFONTS> <ref spec=CSSFONTLOAD></p> <!-- this means you
can get data from a remote site if you can make it redirect to your own site in some fashion
controlled by the data you want to read -->

<p>The <span>origin</span> of a locally installed system font is an <span
data-x="concept-origin-alias">alias</span> to the <span>origin</span> of the
<code>Document</code> in which that font is being used.</p>
<p>The <span>origin</span> of a locally installed system font is a copy of the
<span>origin</span> of the <code>Document</code> in which that font is being used.</p>

<p>Fonts do not have an <span>effective script origin</span>.</p>

a particular <span>URL</span>, <code>Document</code>, image, <span>media element</span>, or
font.</p>

<!-- e.g.:

<p>The <span>origin</span> of a <code>Document</code> object returned by the
<code>XMLHttpRequest</code> API is an <span data-x="concept-origin-alias">alias</span> to the
<span>XMLHttpRequest origin</span> of the <code>XMLHttpRequest</code> object.</p>

-->

<hr>

<p>The <dfn>Unicode serialisation of an origin</dfn> is the string obtained by applying the
<li><p>Set this <code>Document</code> object's <span data-x="the document's domain">domain</span>
to <var>host</var>.</p></li>

<li><p>If the <span>effective script origin</span> of this <code>Document</code> is an <span
data-x="concept-origin-alias">alias</span>, set it to the value of the <span>effective script
origin</span> (essentially de-aliasing the <span>effective script origin</span>).</p></li>

<li><p>Set the host component of the <span>effective script origin</span> tuple of this
<code>Document</code> to <var>host</var>.</p>

0 comments on commit 438155d

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