Skip to content
Browse files

Define what origin and effective script origin are in various Documen…

…t contexts. This further intertwines HTML and DOM in not clearly avoidable ways.

Fixes https://www.w3.org/Bugs/Public/show_bug.cgi?id=20390 in a better
way.
  • Loading branch information...
1 parent 4b60feb commit 2f2cdf4a29b7ed299c38f60eb35ed98918a7f439 @annevk annevk committed Dec 20, 2012
Showing with 96 additions and 48 deletions.
  1. +48 −24 Overview.src.html
  2. +48 −24 dom-core.html
View
72 Overview.src.html
@@ -3769,23 +3769,27 @@ <h2 class=no-num>Goals</h2>
<p>Each <span title=concept-document>document</span> has an associated
<dfn title=concept-document-encoding>encoding</dfn>,
-<dfn title=concept-document-content-type>content type</dfn>,
-<dfn title=concept-document-url>URL</dfn>, and
-<dfn title=concept-document-origin>origin</dfn>.
-<span data-anolis-ref>HTML</span>
+<dfn title=concept-document-content-type>content type</dfn>, and
+<dfn title=concept-document-url>URL</dfn>.
+<span data-anolis-ref>ENCODING</span>
<span data-anolis-ref>URL</span>
<p>Unless explicitly given when a
-<span title=concept-document>document</span> is created its
+<span title=concept-document>document</span> is created, its
<span title=concept-document-encoding>encoding</span> is the
<code data-anolis-spec=encoding>utf-8</code>
<span data-anolis-spec=encoding>encoding</span>, its
<span title=concept-document-content-type>content type</span> is
-"<code title>application/xml</code>", its
+"<code title>application/xml</code>", and its
<span title=concept-document-url>URL</span> is
-"<code title>about:blank</code>", and its
-<span title=concept-document-origin>origin</span> is a globally unique
-identifier.
+"<code title>about:blank</code>".
+
+<p>Unless explicitly given when a
+<span title=concept-document>document</span> is created, its
+<span data-anolis-spec=html>origin</span> and
+<span data-anolis-spec=html>effective script origin</span> are
+globally unique identifiers.
+<span data-anolis-ref>HTML</span>
<p>A <span title=concept-document>document</span> is assumed to be an
<dfn>XML document</dfn> unless it is flagged as being an
@@ -3848,9 +3852,14 @@ <h2 class=no-num>Goals</h2>
<p>The <dfn title=dom-Document><code>Document()</code></dfn> constructor
must return a new <span title=concept-document>document</span> whose
-<span title=concept-document-origin>origin</span> is the
-<span data-anolis-spec=html>entry script</span>'s
-<span data-anolis-spec=html>origin</span>.
+<span data-anolis-spec=html>origin</span> is an
+<span data-anolis-spec=html title=concept-origin-alias>alias</span> to the
+<span data-anolis-spec=html>origin</span> of the global object's associated
+<span title=concept-document>document</span>, and
+<span data-anolis-spec=html>effective script origin</span> is an
+<span data-anolis-spec=html title=concept-origin-alias>alias</span> to the
+<span data-anolis-spec=html>effective script origin</span> of the
+global object's associated <span title=concept-document>document</span>.
<span data-anolis-ref>HTML</span>
<p class=note>Unlike
@@ -4588,10 +4597,18 @@ <h2 class=no-num>Goals</h2>
<span title=concept-node-append>append</span>
<var title>element</var> to <var title>document</var>.
- <li><p>Set <var title>document</var>'s
- <span title=concept-document-origin>origin</span> to
- <span data-anolis-spec=html>entry script</span>'s
- <span data-anolis-spec=html>origin</span>.
+ <li><p><var title>document</var>'s
+ <span data-anolis-spec=html>origin</span> is an
+ <span data-anolis-spec=html title=concept-origin-alias>alias</span> to the
+ <span data-anolis-spec=html>origin</span> of the
+ <span>context object</span>'s associated
+ <span title=concept-document>document</span>, and
+ <var title>document</var>'s
+ <span data-anolis-spec=html>effective script origin</span> is an
+ <span data-anolis-spec=html title=concept-origin-alias>alias</span> to the
+ <span data-anolis-spec=html>effective script origin</span> of the
+ <span>context object</span>'s associated
+ <span title=concept-document>document</span>.
<span data-anolis-ref>HTML</span>
<li><p>Return <var title>document</var>.
@@ -4602,10 +4619,9 @@ <h2 class=no-num>Goals</h2>
method must run these steps:
<ol>
- <li><p>Let <var title>doc</var> be a newly created
- <span title=concept-document>document</span>.
-
- <li><p>Mark <var title>doc</var> as being an <span>HTML document</span>.
+ <li><p>Let <var title>doc</var> be a new
+ <span title=concept-document>document</span> that is an
+ <span>HTML document</span>.
<li><p>Set <var title>doc</var>'s
<span title=concept-document-content-type>content type</span> to
@@ -4647,10 +4663,18 @@ <h2 class=no-num>Goals</h2>
<span title=concept-node-append>append</span> it to the
<code title>html</code> element created in the earlier step.
- <li><p>Set <var title>doc</var>'s
- <span title=concept-document-origin>origin</span> to
- <span data-anolis-spec=html>entry script</span>'s
- <span data-anolis-spec=html>origin</span>.
+ <li><p><var title>doc</var>'s
+ <span data-anolis-spec=html>origin</span> is an
+ <span data-anolis-spec=html title=concept-origin-alias>alias</span> to the
+ <span data-anolis-spec=html>origin</span> of the
+ <span>context object</span>'s associated
+ <span title=concept-document>document</span>, and
+ <var title>doc</var>'s
+ <span data-anolis-spec=html>effective script origin</span> is an
+ <span data-anolis-spec=html title=concept-origin-alias>alias</span> to the
+ <span data-anolis-spec=html>effective script origin</span> of the
+ <span>context object</span>'s associated
+ <span title=concept-document>document</span>.
<span data-anolis-ref>HTML</span>
<li><p>Return <var title>doc</var>.
View
72 dom-core.html
@@ -3839,23 +3839,27 @@ <h3 id="interface-document"><span class="secno">5.5 </span>Interface <code><a hr
<p>Each <a href="#concept-document" title="concept-document">document</a> has an associated
<dfn id="concept-document-encoding" title="concept-document-encoding">encoding</dfn>,
-<dfn id="concept-document-content-type" title="concept-document-content-type">content type</dfn>,
-<dfn id="concept-document-url" title="concept-document-url">URL</dfn>, and
-<dfn id="concept-document-origin" title="concept-document-origin">origin</dfn>.
-<a href="#refsHTML">[HTML]</a>
+<dfn id="concept-document-content-type" title="concept-document-content-type">content type</dfn>, and
+<dfn id="concept-document-url" title="concept-document-url">URL</dfn>.
+<a href="#refsENCODING">[ENCODING]</a>
<a href="#refsURL">[URL]</a>
<p>Unless explicitly given when a
-<a href="#concept-document" title="concept-document">document</a> is created its
+<a href="#concept-document" title="concept-document">document</a> is created, its
<a href="#concept-document-encoding" title="concept-document-encoding">encoding</a> is the
<code class="external" data-anolis-spec="encoding"><a href="http://encoding.spec.whatwg.org/#utf-8">utf-8</a></code>
<a class="external" data-anolis-spec="encoding" href="http://encoding.spec.whatwg.org/#encoding">encoding</a>, its
<a href="#concept-document-content-type" title="concept-document-content-type">content type</a> is
-"<code title="">application/xml</code>", its
+"<code title="">application/xml</code>", and its
<a href="#concept-document-url" title="concept-document-url">URL</a> is
-"<code title="">about:blank</code>", and its
-<a href="#concept-document-origin" title="concept-document-origin">origin</a> is a globally unique
-identifier.
+"<code title="">about:blank</code>".
+
+<p>Unless explicitly given when a
+<a href="#concept-document" title="concept-document">document</a> is created, its
+<a class="external" data-anolis-spec="html" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/origin-0.html#origin">origin</a> and
+<a class="external" data-anolis-spec="html" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/origin-0.html#effective-script-origin">effective script origin</a> are
+globally unique identifiers.
+<a href="#refsHTML">[HTML]</a>
<p>A <a href="#concept-document" title="concept-document">document</a> is assumed to be an
<dfn id="xml-document">XML document</dfn> unless it is flagged as being an
@@ -3918,9 +3922,14 @@ <h3 id="interface-document"><span class="secno">5.5 </span>Interface <code><a hr
<p>The <dfn id="dom-document" title="dom-Document"><code>Document()</code></dfn> constructor
must return a new <a href="#concept-document" title="concept-document">document</a> whose
-<a href="#concept-document-origin" title="concept-document-origin">origin</a> is the
-<a class="external" data-anolis-spec="html" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#entry-script">entry script</a>'s
-<a class="external" data-anolis-spec="html" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/origin-0.html#origin">origin</a>.
+<a class="external" data-anolis-spec="html" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/origin-0.html#origin">origin</a> is an
+<a class="external" data-anolis-spec="html" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/origin-0.html#concept-origin-alias" title="concept-origin-alias">alias</a> to the
+<a class="external" data-anolis-spec="html" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/origin-0.html#origin">origin</a> of the global object's associated
+<a href="#concept-document" title="concept-document">document</a>, and
+<a class="external" data-anolis-spec="html" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/origin-0.html#effective-script-origin">effective script origin</a> is an
+<a class="external" data-anolis-spec="html" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/origin-0.html#concept-origin-alias" title="concept-origin-alias">alias</a> to the
+<a class="external" data-anolis-spec="html" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/origin-0.html#effective-script-origin">effective script origin</a> of the
+global object's associated <a href="#concept-document" title="concept-document">document</a>.
<a href="#refsHTML">[HTML]</a>
<p class="note">Unlike
@@ -4649,10 +4658,18 @@ <h4 id="interface-domimplementation"><span class="secno">5.5.1 </span>Interface
<a href="#concept-node-append" title="concept-node-append">append</a>
<var title="">element</var> to <var title="">document</var>.
- <li><p>Set <var title="">document</var>'s
- <a href="#concept-document-origin" title="concept-document-origin">origin</a> to
- <a class="external" data-anolis-spec="html" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#entry-script">entry script</a>'s
- <a class="external" data-anolis-spec="html" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/origin-0.html#origin">origin</a>.
+ <li><p><var title="">document</var>'s
+ <a class="external" data-anolis-spec="html" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/origin-0.html#origin">origin</a> is an
+ <a class="external" data-anolis-spec="html" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/origin-0.html#concept-origin-alias" title="concept-origin-alias">alias</a> to the
+ <a class="external" data-anolis-spec="html" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/origin-0.html#origin">origin</a> of the
+ <a href="#context-object">context object</a>'s associated
+ <a href="#concept-document" title="concept-document">document</a>, and
+ <var title="">document</var>'s
+ <a class="external" data-anolis-spec="html" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/origin-0.html#effective-script-origin">effective script origin</a> is an
+ <a class="external" data-anolis-spec="html" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/origin-0.html#concept-origin-alias" title="concept-origin-alias">alias</a> to the
+ <a class="external" data-anolis-spec="html" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/origin-0.html#effective-script-origin">effective script origin</a> of the
+ <a href="#context-object">context object</a>'s associated
+ <a href="#concept-document" title="concept-document">document</a>.
<a href="#refsHTML">[HTML]</a>
<li><p>Return <var title="">document</var>.
@@ -4663,10 +4680,9 @@ <h4 id="interface-domimplementation"><span class="secno">5.5.1 </span>Interface
method must run these steps:
<ol>
- <li><p>Let <var title="">doc</var> be a newly created
- <a href="#concept-document" title="concept-document">document</a>.
-
- <li><p>Mark <var title="">doc</var> as being an <a href="#html-document">HTML document</a>.
+ <li><p>Let <var title="">doc</var> be a new
+ <a href="#concept-document" title="concept-document">document</a> that is an
+ <a href="#html-document">HTML document</a>.
<li><p>Set <var title="">doc</var>'s
<a href="#concept-document-content-type" title="concept-document-content-type">content type</a> to
@@ -4708,10 +4724,18 @@ <h4 id="interface-domimplementation"><span class="secno">5.5.1 </span>Interface
<a href="#concept-node-append" title="concept-node-append">append</a> it to the
<code title="">html</code> element created in the earlier step.
- <li><p>Set <var title="">doc</var>'s
- <a href="#concept-document-origin" title="concept-document-origin">origin</a> to
- <a class="external" data-anolis-spec="html" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#entry-script">entry script</a>'s
- <a class="external" data-anolis-spec="html" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/origin-0.html#origin">origin</a>.
+ <li><p><var title="">doc</var>'s
+ <a class="external" data-anolis-spec="html" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/origin-0.html#origin">origin</a> is an
+ <a class="external" data-anolis-spec="html" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/origin-0.html#concept-origin-alias" title="concept-origin-alias">alias</a> to the
+ <a class="external" data-anolis-spec="html" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/origin-0.html#origin">origin</a> of the
+ <a href="#context-object">context object</a>'s associated
+ <a href="#concept-document" title="concept-document">document</a>, and
+ <var title="">doc</var>'s
+ <a class="external" data-anolis-spec="html" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/origin-0.html#effective-script-origin">effective script origin</a> is an
+ <a class="external" data-anolis-spec="html" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/origin-0.html#concept-origin-alias" title="concept-origin-alias">alias</a> to the
+ <a class="external" data-anolis-spec="html" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/origin-0.html#effective-script-origin">effective script origin</a> of the
+ <a href="#context-object">context object</a>'s associated
+ <a href="#concept-document" title="concept-document">document</a>.
<a href="#refsHTML">[HTML]</a>
<li><p>Return <var title="">doc</var>.

0 comments on commit 2f2cdf4

Please sign in to comment.
Something went wrong with that request. Please try again.