Merge Anne's change: Nov 07, 2012, Instead of Workers monkey-patching XMLHttpRequest, recognize Workers
--- a/Overview.html Mon Nov 19 16:08:18 2012 +0900
+++ b/Overview.html Mon Nov 19 17:15:18 2012 +0900
@@ -169,35 +169,34 @@
<li><a class="no-test" href="#terminology"><span class="secno">3 </span>Terminology</a></li>
<li><a href="#interface-xmlhttprequest"><span class="secno">4 </span>Interface <code title="">XMLHttpRequest</code></a>
<ol class="toc">
- <li><a href="#base-url,-origin,-and-referer"><span class="secno">4.1 </span>Base URL, origin, and referer</a></li>
- <li><a href="#task-sources"><span class="secno">4.2 </span>Task sources</a></li>
- <li><a href="#constructors"><span class="secno">4.3 </span>Constructors</a></li>
- <li><a href="#garbage-collection"><span class="secno">4.4 </span>Garbage collection</a></li>
- <li><a href="#event-handlers"><span class="secno">4.5 </span>Event handlers</a></li>
- <li><a href="#states"><span class="secno">4.6 </span>States</a></li>
- <li><a href="#request"><span class="secno">4.7 </span>Request</a>
+ <li><a href="#task-sources"><span class="secno">4.1 </span>Task sources</a></li>
+ <li><a href="#constructors"><span class="secno">4.2 </span>Constructors</a></li>
+ <li><a href="#garbage-collection"><span class="secno">4.3 </span>Garbage collection</a></li>
+ <li><a href="#event-handlers"><span class="secno">4.4 </span>Event handlers</a></li>
+ <li><a href="#states"><span class="secno">4.5 </span>States</a></li>
+ <li><a href="#request"><span class="secno">4.6 </span>Request</a>
<ol class="toc">
- <li><a href="#the-open()-method"><span class="secno">4.7.1 </span>The <code title="">open()</code> method</a></li>
- <li><a href="#the-setrequestheader()-method"><span class="secno">4.7.2 </span>The <code title="">setRequestHeader()</code> method</a></li>
- <li><a href="#the-timeout-attribute"><span class="secno">4.7.3 </span>The <code title="">timeout</code> attribute</a></li>
- <li><a href="#the-withcredentials-attribute"><span class="secno">4.7.4 </span>The <code title="">withCredentials</code> attribute</a></li>
- <li><a href="#the-upload-attribute"><span class="secno">4.7.5 </span>The <code title="">upload</code> attribute</a></li>
- <li><a href="#the-send()-method"><span class="secno">4.7.6 </span>The <code title="">send()</code> method</a></li>
- <li><a href="#infrastructure-for-the-send()-method"><span class="secno">4.7.7 </span>Infrastructure for the <code title="">send()</code> method</a></li>
- <li><a href="#the-abort()-method"><span class="secno">4.7.8 </span>The <code title="">abort()</code> method</a></ol></li>
- <li><a href="#response"><span class="secno">4.8 </span>Response</a>
+ <li><a href="#the-open()-method"><span class="secno">4.6.1 </span>The <code title="">open()</code> method</a></li>
+ <li><a href="#the-setrequestheader()-method"><span class="secno">4.6.2 </span>The <code title="">setRequestHeader()</code> method</a></li>
+ <li><a href="#the-timeout-attribute"><span class="secno">4.6.3 </span>The <code title="">timeout</code> attribute</a></li>
+ <li><a href="#the-withcredentials-attribute"><span class="secno">4.6.4 </span>The <code title="">withCredentials</code> attribute</a></li>
+ <li><a href="#the-upload-attribute"><span class="secno">4.6.5 </span>The <code title="">upload</code> attribute</a></li>
+ <li><a href="#the-send()-method"><span class="secno">4.6.6 </span>The <code title="">send()</code> method</a></li>
+ <li><a href="#infrastructure-for-the-send()-method"><span class="secno">4.6.7 </span>Infrastructure for the <code title="">send()</code> method</a></li>
+ <li><a href="#the-abort()-method"><span class="secno">4.6.8 </span>The <code title="">abort()</code> method</a></ol></li>
+ <li><a href="#response"><span class="secno">4.7 </span>Response</a>
<ol class="toc">
- <li><a href="#the-status-attribute"><span class="secno">4.8.1 </span>The <code title="">status</code> attribute</a></li>
- <li><a href="#the-statustext-attribute"><span class="secno">4.8.2 </span>The <code title="">statusText</code> attribute</a></li>
- <li><a href="#the-getresponseheader()-method"><span class="secno">4.8.3 </span>The <code title="">getResponseHeader()</code> method</a></li>
- <li><a href="#the-getallresponseheaders()-method"><span class="secno">4.8.4 </span>The <code title="">getAllResponseHeaders()</code> method</a></li>
- <li><a href="#response-entity-body-0"><span class="secno">4.8.5 </span>Response entity body</a></li>
- <li><a href="#the-overridemimetype()-method"><span class="secno">4.8.6 </span>The <code title="">overrideMimeType()</code> method</a></li>
- <li><a href="#the-responsetype-attribute"><span class="secno">4.8.7 </span>The <code title="">responseType</code> attribute</a></li>
- <li><a href="#the-response-attribute"><span class="secno">4.8.8 </span>The <code title="">response</code> attribute</a></li>
- <li><a href="#the-responsetext-attribute"><span class="secno">4.8.9 </span>The <code title="">responseText</code> attribute</a></li>
- <li><a href="#the-responsexml-attribute"><span class="secno">4.8.10 </span>The <code title="">responseXML</code> attribute</a></ol></li>
- <li><a href="#events"><span class="secno">4.9 </span>Events summary</a></ol></li>
+ <li><a href="#the-status-attribute"><span class="secno">4.7.1 </span>The <code title="">status</code> attribute</a></li>
+ <li><a href="#the-statustext-attribute"><span class="secno">4.7.2 </span>The <code title="">statusText</code> attribute</a></li>
+ <li><a href="#the-getresponseheader()-method"><span class="secno">4.7.3 </span>The <code title="">getResponseHeader()</code> method</a></li>
+ <li><a href="#the-getallresponseheaders()-method"><span class="secno">4.7.4 </span>The <code title="">getAllResponseHeaders()</code> method</a></li>
+ <li><a href="#response-entity-body-0"><span class="secno">4.7.5 </span>Response entity body</a></li>
+ <li><a href="#the-overridemimetype()-method"><span class="secno">4.7.6 </span>The <code title="">overrideMimeType()</code> method</a></li>
+ <li><a href="#the-responsetype-attribute"><span class="secno">4.7.7 </span>The <code title="">responseType</code> attribute</a></li>
+ <li><a href="#the-response-attribute"><span class="secno">4.7.8 </span>The <code title="">response</code> attribute</a></li>
+ <li><a href="#the-responsetext-attribute"><span class="secno">4.7.9 </span>The <code title="">responseText</code> attribute</a></li>
+ <li><a href="#the-responsexml-attribute"><span class="secno">4.7.10 </span>The <code title="">responseXML</code> attribute</a></ol></li>
+ <li><a href="#events"><span class="secno">4.8 </span>Events summary</a></ol></li>
<li><a href="#interface-formdata"><span class="secno">5 </span>Interface <code title="">FormData</code></a></li>
<li><a href="#data:-urls-and-http"><span class="secno">6 </span><code>data:</code> URLs and HTTP</a></li>
<li><a class="no-num" href="#references">References</a></li>
@@ -471,56 +470,22 @@
readonly attribute <a class="external" href="http://dev.w3.org/2006/webapi/DOM4Core/#document">Document</a>? <a href="#dom-xmlhttprequest-responsexml" title="dom-XMLHttpRequest-responseXML">responseXML</a>;
};</pre>
-
-
- <h3 id="base-url,-origin,-and-referer"><span class="secno">4.1 </span>Base URL, origin, and referer</h3>
-
- <p>Each <code><a href="#xmlhttprequest">XMLHttpRequest</a></code> object has an associated
- <dfn id="xmlhttprequest-base-url"><code>XMLHttpRequest</code> base URL</dfn>,
- <dfn id="xmlhttprequest-origin"><code>XMLHttpRequest</code> origin</dfn>, and
- <dfn id="xmlhttprequest-referer-source"><code>XMLHttpRequest</code> referer source</dfn> (originally a misspelling of referrer).
-
- <p class="note">The XMLHttpRequest standard defines
- <a href="#xmlhttprequest-base-url"><code>XMLHttpRequest</code> base URL</a>,
- <a href="#xmlhttprequest-origin"><code>XMLHttpRequest</code> origin</a>, and
- <a href="#xmlhttprequest-referer-source"><code>XMLHttpRequest</code> referer source</a> when the global
- object is represented by the <code class="external"><a href="http://dev.w3.org/html5/spec/browsers.html#window">Window</a></code>
- object. Other contexts will have to define them as appropriate for
- <code><a href="#xmlhttprequest">XMLHttpRequest</a></code> to function as other contexts are considered
- out of scope for this document.</p>
-
- <p>In environments where the global object is represented by the
- <code class="external"><a href="http://dev.w3.org/html5/spec/browsers.html#window">Window</a></code> object the
- <code><a href="#xmlhttprequest">XMLHttpRequest</a></code> object has an associated
- <dfn id="xmlhttprequest-document"><code>XMLHttpRequest</code> document</dfn> which is the
- <a class="external" href="http://dev.w3.org/2006/webapi/DOM4Core/#concept-document" title="concept-document">document</a>
- associated with the <code class="external"><a href="http://dev.w3.org/html5/spec/browsers.html#window">Window</a></code> object for
- which the <code><a href="#xmlhttprequest">XMLHttpRequest</a></code> interface object was created.</p>
-
- <p>In these environments the
- <a href="#xmlhttprequest-referer-source"><code>XMLHttpRequest</code> referer source</a> is that
- <a href="#xmlhttprequest-document"><code>XMLHttpRequest</code> document</a>.
-
- <p class="note">The
- <a href="#xmlhttprequest-document"><code>XMLHttpRequest</code> document</a> is also used to
- determine the <a href="#xmlhttprequest-base-url"><code>XMLHttpRequest</code> base URL</a> and
- <a href="#xmlhttprequest-origin"><code>XMLHttpRequest</code> origin</a> at a later stage.
-
-
-
-<h3 id="task-sources"><span class="secno">4.2 </span>Task sources</h3>
+<p>Each <code><a href="#xmlhttprequest">XMLHttpRequest</a></code> object has a unique, associated
+<code><a href="#xmlhttprequestupload">XMLHttpRequestUpload</a></code> object.
+
+<h3 id="task-sources"><span class="secno">4.1 </span>Task sources</h3>
<p>Each <code><a href="#xmlhttprequest">XMLHttpRequest</a></code> object has its own
<a class="external" href="http://dev.w3.org/html5/spec/webappapis.html#task-source">task source</a>. Namely, the
<dfn id="xmlhttprequest-task-source"><code>XMLHttpRequest</code> task source</dfn>.
- <h3 id="constructors"><span class="secno">4.3 </span>Constructors</h3>
+ <h3 id="constructors"><span class="secno">4.2 </span>Constructors</h3>
<p>The <code><a href="#xmlhttprequest">XMLHttpRequest</a></code> object has an associated
<dfn id="anonymous-flag">anonymous flag</dfn>. If the <a href="#anonymous-flag">anonymous flag</a> is set,
<a href="#user-credentials">user credentials</a> and the
- <a href="#xmlhttprequest-origin"><code>XMLHttpRequest</code> origin</a> are not exposed when
+ <a href="#source-origin">source origin</a> are not exposed when
<a class="external" href="http://dev.w3.org/html5/spec/urls.html#fetch" title="fetch">fetching</a> resources.
<dl class="domintro">
@@ -547,7 +512,7 @@
</ol>
-<h3 id="garbage-collection"><span class="secno">4.4 </span>Garbage collection</h3>
+<h3 id="garbage-collection"><span class="secno">4.3 </span>Garbage collection</h3>
<!-- Based on EventSource and WebSocket. Not sure what I am doing. -->
@@ -590,7 +555,7 @@
- <h3 id="event-handlers"><span class="secno">4.5 </span>Event handlers</h3>
+ <h3 id="event-handlers"><span class="secno">4.4 </span>Event handlers</h3>
<p>The following are the
@@ -648,7 +613,7 @@
</table>
- <h3 id="states"><span class="secno">4.6 </span>States</h3>
+ <h3 id="states"><span class="secno">4.5 </span>States</h3>
<dl class="domintro">
<dt><code><var title="">client</var> . <a href="#dom-xmlhttprequest-readystate" title="dom-XMLHttpRequest-readyState">readyState</a></code>
@@ -698,62 +663,38 @@
network error or request abortion. It is initially unset and is used
during the <a href="#dom-xmlhttprequest-done" title="dom-XMLHttpRequest-DONE">DONE</a> state.
-
- <h3 id="request"><span class="secno">4.7 </span>Request</h3>
-
- <p>Each <code><a href="#xmlhttprequest">XMLHttpRequest</a></code> object has the following
- request-associated concepts:</p>
-
- <dl>
- <dt><dfn id="synchronous-flag">synchronous flag</dfn></dt>
- <dd>Set when <a class="external" href="http://dev.w3.org/html5/spec/urls.html#fetch" title="fetch">fetching</a> is
- done synchronously. Initially unset.</dd>
-
- <dt><dfn id="request-method">request method</dfn></dt>
- <dd>The HTTP method used in the request.</dd>
-
- <dt><dfn id="request-url">request URL</dfn></dt>
- <dd>The resolved <a class="external" href="http://dev.w3.org/html5/spec/urls.html#url">URL</a> used in the
- request.</dd>
-
- <dt><dfn id="request-username">request username</dfn></dt>
- <dd>The username used in the request or null if there is no
- username.</dd>
-
- <dt><dfn id="request-password">request password</dfn></dt>
- <dd>The password used in the request or null if there is no
- password.</dd>
-
- <dt><dfn id="author-request-headers">author request headers</dfn></dt>
- <dd>A list consisting of HTTP header name/value pairs to be used in the
- request. Checking against the header names in this list must always be
- done in a case-insensitive manner.
-
- <dt><dfn id="request-entity-body">request entity body</dfn></dt>
- <dd>The <a class="external" href="http://tools.ietf.org/html/rfc2616/#section-7.2">entity body</a> used in the
- request or null if there is no
- <a class="external" href="http://tools.ietf.org/html/rfc2616/#section-7.2">entity body</a>.</dd>
-
- <dt><dfn id="upload-complete-flag">upload complete flag</dfn></dt>
- <dd>Set when no more events are to be dispatched on the
- <code><a href="#xmlhttprequestupload">XMLHttpRequestUpload</a></code> object. Initially unset.
-
- <dt><dfn id="upload-events-flag">upload events flag</dfn></dt>
- <dd>Set when event listeners are registered on the
- <code><a href="#xmlhttprequestupload">XMLHttpRequestUpload</a></code> object to determine whether a preflight
- request is needed. Initially unset.</dd>
-
- </dl>
-
-
- <p>Each <code><a href="#xmlhttprequest">XMLHttpRequest</a></code> object also has a unique, associated
- <code><a href="#xmlhttprequestupload">XMLHttpRequestUpload</a></code> object.</p>
-
-
-
- <h4 id="the-open()-method"><span class="secno">4.7.1 </span>The <code title="">open()</code> method</h4>
+<h3 id="request"><span class="secno">4.6 </span>Request</h3>
+
+<p>Each <code><a href="#xmlhttprequest">XMLHttpRequest</a></code> object has the following
+request-associated concepts:
+
+<dfn id="request-method">request method</dfn>,
+<dfn id="request-url">request URL</dfn>,
+<dfn id="request-username">request username</dfn>,
+<dfn id="request-password">request password</dfn>,
+<dfn id="author-request-headers">author request headers</dfn>,
+<dfn id="request-entity-body">request entity body</dfn>,
+<dfn id="source-origin">source origin</dfn>,
+<dfn id="referrer-source">referrer source</dfn>,
+<dfn id="synchronous-flag">synchronous flag</dfn>,
+<dfn id="upload-complete-flag">upload complete flag</dfn>, and
+<dfn id="upload-events-flag">upload events flag</dfn>.
+
+<p>The <a href="#author-request-headers">author request headers</a> is a list of HTTP header names
+and corresponding header values. Comparisons against the HTTP header names
+must be done in a case-insensitive manner. Initially it must be empty.
+
+<p>The <a href="#request-entity-body">request entity body</a> must initially be null.
+
+<p>The <a href="#synchronous-flag">synchronous flag</a>,
+<a href="#upload-complete-flag">upload complete flag</a>, and
+<a href="#upload-events-flag">upload events flag</a> must be initially unset.
+
+
+ <h4 id="the-open()-method"><span class="secno">4.6.1 </span>The <code title="">open()</code> method</h4>
<dl class="domintro">
+ <br>
<dt><code><var title="">client</var> . <a href="#dom-xmlhttprequest-open" title="dom-XMLHttpRequest-open">open</a>(<var title="">method</var>,
<var title="">url</var> [, <var title="">async</var> = true [, <var title="">user</var> = null [,
<var title="">password</var> = null]]])</code>
@@ -778,8 +719,9 @@
<code>CONNECT</code>, <code>TRACE</code> or <code>TRACK</code>.</p>
<p>Throws an "<code class="external"><a href="http://dev.w3.org/2006/webapi/DOM4Core/#invalidaccesserror">InvalidAccessError</a></code>"
- exception if <var title="">async</var> is false, there is an associated
- <a href="#xmlhttprequest-document"><code>XMLHttpRequest</code> document</a> and either the
+ exception if <var title="">async</var> is false, the
+ <a class="external" href="http://dev.w3.org/html5/spec/infrastructure.html#javascript-global-environment">JavaScript global environment</a> is a
+ <a class="external" href="http://dev.w3.org/html5/spec/webappapis.html#document-environment">document environment</a>, and either the
<a href="#anonymous-flag">anonymous flag</a> is set, the
<code title="dom-XMLHttpRequest-timeout"><a href="#dom-xmlhttprequest-timeout">timeout</a></code> attribute is not
zero, the
@@ -794,30 +736,57 @@
method must run these steps (unless otherwise indicated):</p>
<ol>
+ <li><p>Let <var title="">base</var> be null.
+
<li>
- <p>If there is an associated
- <a href="#xmlhttprequest-document"><code>XMLHttpRequest</code> document</a> run
- these substeps:</p>
+ <p>If the
+ <a class="external" href="http://dev.w3.org/html5/spec/infrastructure.html#javascript-global-environment">JavaScript global environment</a> is a
+ <a class="external" href="http://dev.w3.org/html5/spec/webappapis.html#document-environment">document environment</a>, run these steps:
<ol>
- <li><p>If the
- <a href="#xmlhttprequest-document"><code>XMLHttpRequest</code> document</a> is not
+ <li>
+ <p>Let <var title="">document</var> be the
+ <a class="external" href="http://dev.w3.org/2006/webapi/DOM4Core/#concept-document" title="concept-document">document</a>
+ associated with the global object for which the
+ <code><a href="#xmlhttprequest">XMLHttpRequest</a></code> interface object was created from which
+ this <code><a href="#xmlhttprequest">XMLHttpRequest</a></code> object was created.
+
+ <p class="XXX">Should this move to the constructor phase?
+
+ <li><p>If <var title="">document</var> is not
<a class="external" href="http://dev.w3.org/html5/spec/browsers.html#fully-active">fully active</a>,
<a class="external" href="http://dev.w3.org/2006/webapi/DOM4Core/#concept-throw" title="concept-throw">throw</a> an
"<code class="external"><a href="http://dev.w3.org/2006/webapi/DOM4Core/#invalidstateerror">InvalidStateError</a></code>" exception and
terminate the overall set of steps.
- <li><p>Let <a href="#xmlhttprequest-base-url"><code>XMLHttpRequest</code> base URL</a> be the
- <a class="external" href="http://dev.w3.org/html5/spec/urls.html#document-base-url">document base URL</a> of the
- <a href="#xmlhttprequest-document"><code>XMLHttpRequest</code> document</a>.</li>
-
- <li><p>Let <a href="#xmlhttprequest-origin"><code>XMLHttpRequest</code> origin</a> be the
- <a class="external" href="http://dev.w3.org/html5/spec/browsers.html#origin">origin</a> of the
- <a href="#xmlhttprequest-document"><code>XMLHttpRequest</code> document</a>
- and let it be a globally unique identifier if the
- <a href="#anonymous-flag">anonymous flag</a> is set.</li>
+ <li><p>Set <var title="">base</var> to the
+ <a class="external" href="http://dev.w3.org/html5/spec/urls.html#document-base-url">document base URL</a> of
+ <var title="">document</var>.
+
+ <li><p>Set <a href="#source-origin">source origin</a> to a globally unique identifier,
+ if the <a href="#anonymous-flag">anonymous flag</a> is set, and the
+ <a class="external" href="http://dev.w3.org/html5/spec/browsers.html#origin">origin</a> of <var title="">document</var>
+ otherwise.
+
+ <li><p>Set <a href="#referrer-source">referrer source</a> to <var title="">document</var>.
</ol>
- </li>
+
+ <li>
+ <p>If the
+ <a class="external" href="http://dev.w3.org/html5/spec/infrastructure.html#javascript-global-environment">JavaScript global environment</a> is a
+ <a class="external" href="http://dev.w3.org/html5/spec/webappapis.html#worker-environment">worker environment</a>, run these steps:
+
+ <ol>
+ <li><p>Set <var title="">base</var> to the
+ <a class="external" href="http://dev.w3.org/html5/spec/webappapis.html#script's-base-url">script's base URL</a>.
+
+ <li><p>Set <a href="#source-origin">source origin</a> to the
+ <a class="external" href="http://dev.w3.org/html5/spec/webappapis.html#concept-script" title="concept-script">script</a>'s
+ <a class="external" href="http://dev.w3.org/html5/spec/browsers.html#origin">origin</a>.
+
+ <li><p>Set <a href="#referrer-source">referrer source</a> to the
+ <a class="external" href="http://dev.w3.org/html5/spec/webappapis.html#script's-referrer-source">script's referrer source</a>.
+ </ol>
<li><p>If <var>method</var> does not match the
<a class="external" href="http://tools.ietf.org/html/rfc2616/#section-5.1.1">Method</a> token production,
@@ -854,8 +823,7 @@
<a class="external" href="http://dev.w3.org/html5/spec/urls.html#url">URL</a> with character encoding UTF-8.
<li><p><a class="external" href="http://dev.w3.org/html5/spec/urls.html#resolve-a-url" title="Resolve a URL">Resolve</a>
- <var title="">url</var> relative to the
- <a href="#xmlhttprequest-base-url"><code>XMLHttpRequest</code> base URL</a>. If the algorithm
+ <var title="">url</var> relative to <var title="">base</var>. If the algorithm
returns an error,
<a class="external" href="http://dev.w3.org/2006/webapi/DOM4Core/#concept-throw" title="concept-throw">throw</a> a
"<code class="external"><a href="http://dev.w3.org/2006/webapi/DOM4Core/#syntaxerror">SyntaxError</a></code>" exception and terminate
@@ -888,8 +856,9 @@
<li><p>If <var title="">url</var> just contains the <code>"user"</code>
format let <var>temp user</var> be the user part.</li>
- <li><p>If <var>async</var> is false, there is an associated
- <a href="#xmlhttprequest-document"><code>XMLHttpRequest</code> document</a> and either the
+ <li><p>If <var>async</var> is false, the
+ <a class="external" href="http://dev.w3.org/html5/spec/infrastructure.html#javascript-global-environment">JavaScript global environment</a> is a
+ <a class="external" href="http://dev.w3.org/html5/spec/webappapis.html#document-environment">document environment</a>, and either the
<a href="#anonymous-flag">anonymous flag</a> is set, the
<code title="dom-XMLHttpRequest-timeout"><a href="#dom-xmlhttprequest-timeout">timeout</a></code> attribute value is
not zero, the
@@ -953,7 +922,7 @@
- <h4 id="the-setrequestheader()-method"><span class="secno">4.7.2 </span>The <code title="">setRequestHeader()</code> method</h4>
+ <h4 id="the-setrequestheader()-method"><span class="secno">4.6.2 </span>The <code title="">setRequestHeader()</code> method</h4>
<dl class="domintro">
<dt><code><var title="">client</var> . <a href="#dom-xmlhttprequest-setrequestheader" title="dom-XMLHttpRequest-setRequestHeader">setRequestHeader</a>(<var title="">header</var>, <var title="">value</var>)</code>
@@ -1070,6 +1039,8 @@
matching <var>header</var> in the <a href="#author-request-headers">author request headers</a>
list (for combine see section 4.2, RFC 2616).
<a href="#refsHTTP">[HTTP]</a>
+ <!-- XXX "combine" should probably be replaced with
+ 'append ", ", followed by value' -->
<p class="note">The XMLHttpRequest standard intentionally constraints the
use of HTTP here in line with contemporary implementations.
@@ -1096,7 +1067,7 @@
</div>
- <h4 id="the-timeout-attribute"><span class="secno">4.7.3 </span>The <code title="">timeout</code> attribute</h4>
+ <h4 id="the-timeout-attribute"><span class="secno">4.6.3 </span>The <code title="">timeout</code> attribute</h4>
<dl class="domintro">
<dt><code><var title="">client</var> . <a href="#dom-xmlhttprequest-timeout" title="dom-XMLHttpRequest-timeout">timeout</a></code>
@@ -1112,8 +1083,9 @@
(for the <code title="dom-XMLHttpRequest"><a href="#dom-xmlhttprequest">send()</a></code> method).
<p>When set: throws an
"<code class="external"><a href="http://dev.w3.org/2006/webapi/DOM4Core/#invalidaccesserror">InvalidAccessError</a></code>" exception if
- the <a href="#synchronous-flag">synchronous flag</a> is set when there is an
- associated <a href="#xmlhttprequest-document"><code>XMLHttpRequest</code> document</a>.
+ the <a href="#synchronous-flag">synchronous flag</a> is set and the
+ <a class="external" href="http://dev.w3.org/html5/spec/infrastructure.html#javascript-global-environment">JavaScript global environment</a> is a
+ <a class="external" href="http://dev.w3.org/html5/spec/webappapis.html#document-environment">document environment</a>.
</dd>
</dl>
@@ -1125,8 +1097,9 @@
attribute must run these steps:
<ol>
- <li><p>If there is an associated
- <a href="#xmlhttprequest-document"><code>XMLHttpRequest</code> document</a> and the
+ <li><p>If the
+ <a class="external" href="http://dev.w3.org/html5/spec/infrastructure.html#javascript-global-environment">JavaScript global environment</a> is a
+ <a class="external" href="http://dev.w3.org/html5/spec/webappapis.html#document-environment">document environment</a> and the
<a href="#synchronous-flag">synchronous flag</a> is set,
<a class="external" href="http://dev.w3.org/2006/webapi/DOM4Core/#concept-throw" title="concept-throw">throw</a> an
"<code class="external"><a href="http://dev.w3.org/2006/webapi/DOM4Core/#invalidaccesserror">InvalidAccessError</a></code>" exception and
@@ -1142,7 +1115,7 @@
of <a class="external" href="http://dev.w3.org/html5/spec/urls.html#fetch" title="fetch">fetching</a>.
- <h4 id="the-withcredentials-attribute"><span class="secno">4.7.4 </span>The <code title="">withCredentials</code> attribute</h4>
+ <h4 id="the-withcredentials-attribute"><span class="secno">4.6.4 </span>The <code title="">withCredentials</code> attribute</h4>
<dl class="domintro">
<dt><code><var title="">client</var> . <a href="#dom-xmlhttprequest-withcredentials" title="dom-XMLHttpRequest-withCredentials">withCredentials</a></code>
@@ -1159,8 +1132,9 @@
the <a href="#send-flag"><code>send()</code> flag</a> is set.</p>
<p>When set: throws an
"<code class="external"><a href="http://dev.w3.org/2006/webapi/DOM4Core/#invalidaccesserror">InvalidAccessError</a></code>" exception if
- either the <a href="#synchronous-flag">synchronous flag</a> is set when there is an
- associated <a href="#xmlhttprequest-document"><code>XMLHttpRequest</code> document</a> or if the
+ either the <a href="#synchronous-flag">synchronous flag</a> is set and the
+ <a class="external" href="http://dev.w3.org/html5/spec/infrastructure.html#javascript-global-environment">JavaScript global environment</a> is a
+ <a class="external" href="http://dev.w3.org/html5/spec/webappapis.html#document-environment">document environment</a> or if the
<a href="#anonymous-flag">anonymous flag</a> is set.</p>
</dd>
</dl>
@@ -1191,8 +1165,9 @@
"<code class="external"><a href="http://dev.w3.org/2006/webapi/DOM4Core/#invalidaccesserror">InvalidAccessError</a></code>" exception and
terminate these steps.
- <li><p>If there is an associated
- <a href="#xmlhttprequest-document"><code>XMLHttpRequest</code> document</a> and the
+ <li><p>If the
+ <a class="external" href="http://dev.w3.org/html5/spec/infrastructure.html#javascript-global-environment">JavaScript global environment</a> is a
+ <a class="external" href="http://dev.w3.org/html5/spec/webappapis.html#document-environment">document environment</a> and the
<a href="#synchronous-flag">synchronous flag</a> is set,
<a class="external" href="http://dev.w3.org/2006/webapi/DOM4Core/#concept-throw" title="concept-throw">throw</a> an
"<code class="external"><a href="http://dev.w3.org/2006/webapi/DOM4Core/#invalidaccesserror">InvalidAccessError</a></code>" exception and
@@ -1211,7 +1186,7 @@
resources.</p>
- <h4 id="the-upload-attribute"><span class="secno">4.7.5 </span>The <code title="">upload</code> attribute</h4>
+ <h4 id="the-upload-attribute"><span class="secno">4.6.5 </span>The <code title="">upload</code> attribute</h4>
<dl class="domintro">
<dt><code><var title="">client</var> . <a href="#dom-xmlhttprequest-upload" title="dom-XMLHttpRequest-upload">upload</a></code>
@@ -1229,7 +1204,7 @@
object has an associated <code><a href="#xmlhttprequestupload">XMLHttpRequestUpload</a></code> object.
- <h4 id="the-send()-method"><span class="secno">4.7.6 </span>The <code title="">send()</code> method</h4>
+ <h4 id="the-send()-method"><span class="secno">4.6.6 </span>The <code title="">send()</code> method</h4>
<dl class="domintro">
<dt><code><var title="">client</var> . <a href="#dom-xmlhttprequest-send" title="dom-XMLHttpRequest-send">send</a>([<var title="">data</var> = null])</code>
@@ -1418,8 +1393,8 @@
<li>
<dl class="switch">
- <dt>If the <a href="#xmlhttprequest-origin"><code>XMLHttpRequest</code> origin</a> and the
- <a href="#request-url">request URL</a> are <a class="external" href="http://dev.w3.org/html5/spec/browsers.html#same-origin">same origin</a></dt>
+ <dt>If the <a href="#source-origin">source origin</a> and the <a href="#request-url">request URL</a>
+ are <a class="external" href="http://dev.w3.org/html5/spec/browsers.html#same-origin">same origin</a></dt>
<dt>If the <a href="#request-url">request URL</a>'s
<code class="external" title="url-scheme"><a href="http://dev.w3.org/html5/spec/urls.html#url-scheme"><scheme></a></code> is
"<code title="">data</code>"
@@ -1429,8 +1404,8 @@
<p><a class="external" href="http://dev.w3.org/html5/spec/urls.html#fetch">Fetch</a> the
<a href="#request-url">request URL</a> from <i title="">origin</i>
- <a href="#xmlhttprequest-origin"><code>XMLHttpRequest</code> origin</a>, using
- <a href="#xmlhttprequest-referer-source"><code>XMLHttpRequest</code> referer source</a> as
+ <a href="#source-origin">source origin</a>, using
+ <a href="#referrer-source">referrer source</a> as
<i title="">override referer source</i>, with the
<i title="">synchronous flag</i> set if the
<a href="#synchronous-flag">synchronous flag</a> is set, using HTTP method
@@ -1498,13 +1473,13 @@
<dd>The <a href="#request-entity-body">request entity body</a>.</dd>
<dt>source origin</dt>
- <dd>The <a href="#xmlhttprequest-origin"><code>XMLHttpRequest</code> origin</a>.</dd>
+ <dd>The <a href="#source-origin">source origin</a>.</dd>
<dt>referer source
<dd>If the <a href="#anonymous-flag">anonymous flag</a> is set, the
<a class="external" href="http://dev.w3.org/html5/spec/urls.html#url">URL</a>
- "<code title="">about:blank</code>", or the
- <a href="#xmlhttprequest-referer-source"><code>XMLHttpRequest</code> referer source</a> otherwise.
+ "<code title="">about:blank</code>", and the
+ <a href="#referrer-source">referrer source</a> otherwise.
<dt>omit credentials flag</dt>
<dd>Set if
@@ -1566,7 +1541,7 @@
handle <code>401 Unauthorized</code> requests appropriately.</p>
<p>If authentication fails,
- <a href="#xmlhttprequest-origin"><code>XMLHttpRequest</code> origin</a> and the
+ <a href="#source-origin">source origin</a> and the
<a href="#request-url">request URL</a> are <a class="external" href="http://dev.w3.org/html5/spec/browsers.html#same-origin">same origin</a>,
<code title="http-authorization">Authorization</code> is not in the list
of <a href="#author-request-headers">author request headers</a>, <a href="#request-username">request username</a> is
@@ -1641,7 +1616,7 @@
This ensures that authors have a predictable API.</p>
- <h4 id="infrastructure-for-the-send()-method"><span class="secno">4.7.7 </span>Infrastructure for the <code title="">send()</code> method</h4>
+ <h4 id="infrastructure-for-the-send()-method"><span class="secno">4.6.7 </span>Infrastructure for the <code title="">send()</code> method</h4>
<p>The <dfn id="same-origin-request-event-rules">same-origin request event rules</dfn> are as follows:</p>
@@ -1658,7 +1633,7 @@
<a class="external" href="http://dev.w3.org/html5/spec/urls.html#url">URL</a> conveyed by the
<code>Location</code> header.</li>
- <li><p>If the <a href="#xmlhttprequest-origin"><code>XMLHttpRequest</code> origin</a> and the
+ <li><p>If the <a href="#source-origin">source origin</a> and the
<a class="external" href="http://dev.w3.org/html5/spec/browsers.html#origin">origin</a> of <a href="#request-url">request URL</a>
are <a class="external" href="http://dev.w3.org/html5/spec/browsers.html#same-origin">same origin</a> transparently follow
the redirect while observing the
@@ -1935,7 +1910,7 @@
- <h4 id="the-abort()-method"><span class="secno">4.7.8 </span>The <code title="">abort()</code> method</h4>
+ <h4 id="the-abort()-method"><span class="secno">4.6.8 </span>The <code title="">abort()</code> method</h4>
<dl class="domintro">
<dt><code><var title="">client</var> . <a href="#dom-xmlhttprequest-abort" title="dom-XMLHttpRequest-abort">abort</a>()</code>
@@ -2024,9 +1999,9 @@
- <h3 id="response"><span class="secno">4.8 </span>Response</h3>
-
- <h4 id="the-status-attribute"><span class="secno">4.8.1 </span>The <code title="">status</code> attribute</h4>
+ <h3 id="response"><span class="secno">4.7 </span>Response</h3>
+
+ <h4 id="the-status-attribute"><span class="secno">4.7.1 </span>The <code title="">status</code> attribute</h4>
<dl class="domintro">
<dt><code><var title="">client</var> . <a href="#dom-xmlhttprequest-status" title="dom-XMLHttpRequest-status">status</a></code>
@@ -2051,7 +2026,7 @@
</ol>
- <h4 id="the-statustext-attribute"><span class="secno">4.8.2 </span>The <code title="">statusText</code> attribute</h4>
+ <h4 id="the-statustext-attribute"><span class="secno">4.7.2 </span>The <code title="">statusText</code> attribute</h4>
<dl class="domintro">
<dt><code><var title="">client</var> . <a href="#dom-xmlhttprequest-statustext" title="dom-XMLHttpRequest-statusText">statusText</a></code>
@@ -2075,7 +2050,7 @@
</ol>
- <h4 id="the-getresponseheader()-method"><span class="secno">4.8.3 </span>The <code title="">getResponseHeader()</code> method</h4>
+ <h4 id="the-getresponseheader()-method"><span class="secno">4.7.3 </span>The <code title="">getResponseHeader()</code> method</h4>
<dl class="domintro">
<dt><code><var title="">client</var> . <a href="#dom-xmlhttprequest-getresponseheader" title="dom-XMLHttpRequest-getResponseHeader">getResponseHeader</a>(<var title="">header</var>)</code>
@@ -2140,7 +2115,7 @@
</div>
- <h4 id="the-getallresponseheaders()-method"><span class="secno">4.8.4 </span>The <code title="">getAllResponseHeaders()</code> method</h4>
+ <h4 id="the-getallresponseheaders()-method"><span class="secno">4.7.4 </span>The <code title="">getAllResponseHeaders()</code> method</h4>
<dl class="domintro">
<dt><code><var title="">client</var> . <a href="#dom-xmlhttprequest-getallresponseheaders" title="dom-XMLHttpRequest-getAllResponseHeaders">getAllResponseHeaders</a>()</code>
@@ -2203,7 +2178,7 @@
- <h4 id="response-entity-body-0"><span class="secno">4.8.5 </span>Response entity body</h4>
+ <h4 id="response-entity-body-0"><span class="secno">4.7.5 </span>Response entity body</h4>
<p>The <dfn id="response-mime-type">response MIME type</dfn> is the
MIME type the <code>Content-Type</code> header contains excluding any
@@ -2352,7 +2327,7 @@
<li><p>Set <var title="">document</var>'s
<a class="external" href="http://dev.w3.org/html5/spec/browsers.html#origin">origin</a> to the
- <a href="#xmlhttprequest-origin"><code>XMLHttpRequest</code> origin</a>.
+ <a href="#source-origin">source origin</a>.
<li><p>Set <var title="">document</var>'s
<a class="external" href="http://dev.w3.org/2006/webapi/DOM4Core/#concept-document-content-type" title="concept-document-content-type">content type</a>
@@ -2422,7 +2397,7 @@
- <h4 id="the-overridemimetype()-method"><span class="secno">4.8.6 </span>The <code title="">overrideMimeType()</code> method</h4>
+ <h4 id="the-overridemimetype()-method"><span class="secno">4.7.6 </span>The <code title="">overrideMimeType()</code> method</h4>
<dl class="domintro">
<dt><code><var title="">client</var> . <a href="#dom-xmlhttprequest-overridemimetype" title="dom-XMLHttpRequest-overrideMimeType">overrideMimeType</a>(<var title="">mime</var>)</code>
@@ -2469,10 +2444,10 @@
- <h4 id="the-responsetype-attribute"><span class="secno">4.8.7 </span>The <code title="">responseType</code> attribute</h4>
+ <h4 id="the-responsetype-attribute"><span class="secno">4.7.7 </span>The <code title="">responseType</code> attribute</h4>
<dl class="domintro">
- <dt><code><var title="">client</var> . <a href="#dom-xmlhttprequest-responsetype" title="dom-XMLHttpRequest-responseType">responseType</a></code> [ = <var title="">value</var> ]
+ <dt><code><var title="">client</var> . <a href="#dom-xmlhttprequest-responsetype" title="dom-XMLHttpRequest-responseType">responseType</a></code><code> [ = <var title="">value</var> ]</code>
<dd>
<p>Returns the response type.</p>
<p>Can be set to change the response type. Values are:
@@ -2488,8 +2463,9 @@
<a href="#dom-xmlhttprequest-done" title="dom-XMLHttpRequest-DONE">DONE</a>.
<p>When set: throws an
"<code class="external"><a href="http://dev.w3.org/2006/webapi/DOM4Core/#invalidaccesserror">InvalidAccessError</a></code>" exception if the
- <a href="#synchronous-flag">synchronous flag</a> is set and there is an associated
- <a href="#xmlhttprequest-document"><code>XMLHttpRequest</code> document</a>.</p>
+ <a href="#synchronous-flag">synchronous flag</a> is set and the
+ <a class="external" href="http://dev.w3.org/html5/spec/infrastructure.html#javascript-global-environment">JavaScript global environment</a> is a
+ <a class="external" href="http://dev.w3.org/html5/spec/webappapis.html#document-environment">document environment</a>.
</dl>
@@ -2510,8 +2486,9 @@
"<code class="external"><a href="http://dev.w3.org/2006/webapi/DOM4Core/#invalidstateerror">InvalidStateError</a></code>" exception and
terminate these steps.
- <li><p>If there is an associated
- <a href="#xmlhttprequest-document"><code>XMLHttpRequest</code> document</a> and the
+ <li><p>If the
+ <a class="external" href="http://dev.w3.org/html5/spec/infrastructure.html#javascript-global-environment">JavaScript global environment</a> is a
+ <a class="external" href="http://dev.w3.org/html5/spec/webappapis.html#document-environment">document environment</a> and the
<a href="#synchronous-flag">synchronous flag</a> is set,
<a class="external" href="http://dev.w3.org/2006/webapi/DOM4Core/#concept-throw" title="concept-throw">throw</a> an
"<code class="external"><a href="http://dev.w3.org/2006/webapi/DOM4Core/#invalidaccesserror">InvalidAccessError</a></code>" exception and
@@ -2525,7 +2502,7 @@
- <h4 id="the-response-attribute"><span class="secno">4.8.8 </span>The <code title="">response</code> attribute</h4>
+ <h4 id="the-response-attribute"><span class="secno">4.7.8 </span>The <code title="">response</code> attribute</h4>
<dl class="domintro">
<dt><code><var title="">client</var> . <a href="#dom-xmlhttprequest-response" title="dom-XMLHttpRequest-response">response</a></code>
@@ -2596,7 +2573,7 @@
- <h4 id="the-responsetext-attribute"><span class="secno">4.8.9 </span>The <code title="">responseText</code> attribute</h4>
+ <h4 id="the-responsetext-attribute"><span class="secno">4.7.9 </span>The <code title="">responseText</code> attribute</h4>
<dl class="domintro">
<dt><code><var title="">client</var> . <a href="#dom-xmlhttprequest-responsetext" title="dom-XMLHttpRequest-responseText">responseText</a></code>
@@ -2636,7 +2613,7 @@
</ol>
- <h4 id="the-responsexml-attribute"><span class="secno">4.8.10 </span>The <code title="">responseXML</code> attribute</h4>
+ <h4 id="the-responsexml-attribute"><span class="secno">4.7.10 </span>The <code title="">responseXML</code> attribute</h4>
<dl class="domintro">
<dt><code><var title="">client</var> . <a href="#dom-xmlhttprequest-responsexml" title="dom-XMLHttpRequest-responseXML">responseXML</a></code>
@@ -2680,7 +2657,7 @@
as documents.</p>
- <h3 id="events"><span class="secno">4.9 </span>Events summary</h3>
+ <h3 id="events"><span class="secno">4.8 </span>Events summary</h3>
<p><em>This section is non-normative.</em></p>
--- a/Overview.src.html Mon Nov 19 16:08:18 2012 +0900
+++ b/Overview.src.html Mon Nov 19 17:15:18 2012 +0900
@@ -438,42 +438,8 @@
readonly attribute <span data-anolis-spec=dom>Document</span>? <span title="dom-XMLHttpRequest-responseXML">responseXML</span>;
};</pre>
-
-
- <h3>Base URL, origin, and referer</h3>
-
- <p>Each <code>XMLHttpRequest</code> object has an associated
- <dfn><code>XMLHttpRequest</code> base URL</dfn>,
- <dfn><code>XMLHttpRequest</code> origin</dfn>, and
- <dfn><code>XMLHttpRequest</code> referer source</dfn> (originally a misspelling of referrer).
-
- <p class=note>The XMLHttpRequest standard defines
- <span><code>XMLHttpRequest</code> base URL</span>,
- <span><code>XMLHttpRequest</code> origin</span>, and
- <span><code>XMLHttpRequest</code> referer source</span> when the global
- object is represented by the <code data-anolis-spec=html>Window</code>
- object. Other contexts will have to define them as appropriate for
- <code>XMLHttpRequest</code> to function as other contexts are considered
- out of scope for this document.</p>
-
- <p>In environments where the global object is represented by the
- <code data-anolis-spec=html>Window</code> object the
- <code>XMLHttpRequest</code> object has an associated
- <dfn><code>XMLHttpRequest</code> document</dfn> which is the
- <span data-anolis-spec=dom title=concept-document>document</span>
- associated with the <code data-anolis-spec=html>Window</code> object for
- which the <code>XMLHttpRequest</code> interface object was created.</p>
-
- <p>In these environments the
- <span><code>XMLHttpRequest</code> referer source</span> is that
- <span><code>XMLHttpRequest</code> document</span>.
-
- <p class=note>The
- <span><code>XMLHttpRequest</code> document</span> is also used to
- determine the <span><code>XMLHttpRequest</code> base URL</span> and
- <span><code>XMLHttpRequest</code> origin</span> at a later stage.
-
-
+<p>Each <code>XMLHttpRequest</code> object has a unique, associated
+<code>XMLHttpRequestUpload</code> object.
<h3>Task sources</h3>
@@ -487,7 +453,7 @@
<p>The <code>XMLHttpRequest</code> object has an associated
<dfn>anonymous flag</dfn>. If the <span>anonymous flag</span> is set,
<span>user credentials</span> and the
- <span><code>XMLHttpRequest</code> origin</span> are not exposed when
+ <span>source origin</span> are not exposed when
<span data-anolis-spec=html title=fetch>fetching</span> resources.
<dl class=domintro>
@@ -665,62 +631,38 @@
network error or request abortion. It is initially unset and is used
during the <span title="dom-XMLHttpRequest-DONE">DONE</span> state.
-
- <h3 id="request">Request</h3>
-
- <p>Each <code>XMLHttpRequest</code> object has the following
- request-associated concepts:</p>
-
- <dl>
- <dt><dfn>synchronous flag</dfn></dt>
- <dd>Set when <span data-anolis-spec=html title=fetch>fetching</span> is
- done synchronously. Initially unset.</dd>
-
- <dt><dfn>request method</dfn></dt>
- <dd>The HTTP method used in the request.</dd>
-
- <dt><dfn>request URL</dfn></dt>
- <dd>The resolved <span data-anolis-spec=html>URL</span> used in the
- request.</dd>
-
- <dt><dfn>request username</dfn></dt>
- <dd>The username used in the request or null if there is no
- username.</dd>
-
- <dt><dfn>request password</dfn></dt>
- <dd>The password used in the request or null if there is no
- password.</dd>
-
- <dt><dfn id="author-request-headers">author request headers</dfn></dt>
- <dd>A list consisting of HTTP header name/value pairs to be used in the
- request. Checking against the header names in this list must always be
- done in a case-insensitive manner.
-
- <dt><dfn>request entity body</dfn></dt>
- <dd>The <span data-anolis-spec=http>entity body</span> used in the
- request or null if there is no
- <span data-anolis-spec=http>entity body</span>.</dd>
-
- <dt><dfn id="upload-complete-flag">upload complete flag</dfn></dt>
- <dd>Set when no more events are to be dispatched on the
- <code>XMLHttpRequestUpload</code> object. Initially unset.
-
- <dt><dfn id="upload-events-flag">upload events flag</dfn></dt>
- <dd>Set when event listeners are registered on the
- <code>XMLHttpRequestUpload</code> object to determine whether a preflight
- request is needed. Initially unset.</dd>
-
- </dl>
-
-
- <p>Each <code>XMLHttpRequest</code> object also has a unique, associated
- <code>XMLHttpRequestUpload</code> object.</p>
-
+<h3 id="request">Request</h3>
+
+<p>Each <code>XMLHttpRequest</code> object has the following
+request-associated concepts:
+
+<dfn>request method</dfn>,
+<dfn>request URL</dfn>,
+<dfn>request username</dfn>,
+<dfn>request password</dfn>,
+<dfn id="author-request-headers">author request headers</dfn>,
+<dfn>request entity body</dfn>,
+<dfn>source origin</dfn>,
+<dfn>referrer source</dfn>,
+<dfn>synchronous flag</dfn>,
+<dfn id="upload-complete-flag">upload complete flag</dfn>, and
+<dfn id="upload-events-flag">upload events flag</dfn>.
+
+<p>The <span>author request headers</span> is a list of HTTP header names
+and corresponding header values. Comparisons against the HTTP header names
+must be done in a case-insensitive manner. Initially it must be empty.
+
+<p>The <span>request entity body</span> must initially be null.
+
+<p>The <span>synchronous flag</span>,
+<span>upload complete flag</span>, and
+<span>upload events flag</span> must be initially unset.
<h4>The <code title>open()</code> method</h4>
<dl class=domintro>
+ <br>
<dt><code><var title>client</var> . <span title=dom-XMLHttpRequest-open>open</span>(<var title>method</var>,
<var title>url</var> [, <var title>async</var> = true [, <var title>user</var> = null [,
<var title>password</var> = null]]])</code>
@@ -745,8 +687,9 @@
<code>CONNECT</code>, <code>TRACE</code> or <code>TRACK</code>.</p>
<p>Throws an "<code data-anolis-spec=dom>InvalidAccessError</code>"
- exception if <var title>async</var> is false, there is an associated
- <span><code>XMLHttpRequest</code> document</span> and either the
+ exception if <var title>async</var> is false, the
+ <span data-anolis-spec=html>JavaScript global environment</span> is a
+ <span data-anolis-spec=html>document environment</span>, and either the
<span>anonymous flag</span> is set, the
<code title=dom-XMLHttpRequest-timeout>timeout</code> attribute is not
zero, the
@@ -761,30 +704,57 @@
method must run these steps (unless otherwise indicated):</p>
<ol>
+ <li><p>Let <var title>base</var> be null.
+
<li>
- <p>If there is an associated
- <span><code>XMLHttpRequest</code> document</span> run
- these substeps:</p>
+ <p>If the
+ <span data-anolis-spec=html>JavaScript global environment</span> is a
+ <span data-anolis-spec=html>document environment</span>, run these steps:
<ol>
- <li><p>If the
- <span><code>XMLHttpRequest</code> document</span> is not
+ <li>
+ <p>Let <var title>document</var> be the
+ <span data-anolis-spec=dom title=concept-document>document</span>
+ associated with the global object for which the
+ <code>XMLHttpRequest</code> interface object was created from which
+ this <code>XMLHttpRequest</code> object was created.
+
+ <p class=XXX>Should this move to the constructor phase?
+
+ <li><p>If <var title>document</var> is not
<span data-anolis-spec=html>fully active</span>,
<span data-anolis-spec=dom title=concept-throw>throw</span> an
"<code data-anolis-spec=dom>InvalidStateError</code>" exception and
terminate the overall set of steps.
- <li><p>Let <span><code>XMLHttpRequest</code> base URL</span> be the
- <span data-anolis-spec=html>document base URL</span> of the
- <span><code>XMLHttpRequest</code> document</span>.</p></li>
-
- <li><p>Let <span><code>XMLHttpRequest</code> origin</span> be the
- <span data-anolis-spec=html>origin</span> of the
- <span><code>XMLHttpRequest</code> document</span>
- and let it be a globally unique identifier if the
- <span>anonymous flag</span> is set.</p></li>
+ <li><p>Set <var title>base</var> to the
+ <span data-anolis-spec=html>document base URL</span> of
+ <var title>document</var>.
+
+ <li><p>Set <span>source origin</span> to a globally unique identifier,
+ if the <span>anonymous flag</span> is set, and the
+ <span data-anolis-spec=html>origin</span> of <var title>document</var>
+ otherwise.
+
+ <li><p>Set <span>referrer source</span> to <var title>document</var>.
</ol>
- </li>
+
+ <li>
+ <p>If the
+ <span data-anolis-spec=html>JavaScript global environment</span> is a
+ <span data-anolis-spec=html>worker environment</span>, run these steps:
+
+ <ol>
+ <li><p>Set <var title>base</var> to the
+ <span data-anolis-spec=html>script's base URL</span>.
+
+ <li><p>Set <span>source origin</span> to the
+ <span data-anolis-spec=html title=concept-script>script</span>'s
+ <span data-anolis-spec=html>origin</span>.
+
+ <li><p>Set <span>referrer source</span> to the
+ <span data-anolis-spec=html>script's referrer source</span>.
+ </ol>
<li><p>If <var>method</var> does not match the
<span data-anolis-spec=http>Method</span> token production,
@@ -821,8 +791,7 @@
<span data-anolis-spec=html>URL</span> with character encoding UTF-8.
<li><p><span title="Resolve a URL" data-anolis-spec=html>Resolve</span>
- <var title>url</var> relative to the
- <span><code>XMLHttpRequest</code> base URL</span>. If the algorithm
+ <var title>url</var> relative to <var title>base</var>. If the algorithm
returns an error,
<span data-anolis-spec=dom title=concept-throw>throw</span> a
"<code data-anolis-spec=dom>SyntaxError</code>" exception and terminate
@@ -855,8 +824,9 @@
<li><p>If <var title>url</var> just contains the <code>"user"</code>
format let <var>temp user</var> be the user part.</p></li>
- <li><p>If <var>async</var> is false, there is an associated
- <span><code>XMLHttpRequest</code> document</span> and either the
+ <li><p>If <var>async</var> is false, the
+ <span data-anolis-spec=html>JavaScript global environment</span> is a
+ <span data-anolis-spec=html>document environment</span>, and either the
<span>anonymous flag</span> is set, the
<code title=dom-XMLHttpRequest-timeout>timeout</code> attribute value is
not zero, the
@@ -1037,6 +1007,8 @@
matching <var>header</var> in the <span>author request headers</span>
list (for combine see section 4.2, RFC 2616).
<span data-anolis-ref>HTTP</span>
+ <!-- XXX "combine" should probably be replaced with
+ 'append ", ", followed by value' -->
<p class=note>The XMLHttpRequest standard intentionally constraints the
use of HTTP here in line with contemporary implementations.
@@ -1079,8 +1051,9 @@
(for the <code title=dom-XMLHttpRequest>send()</code> method).
<p>When set: throws an
"<code data-anolis-spec=dom>InvalidAccessError</code>" exception if
- the <span>synchronous flag</span> is set when there is an
- associated <span><code>XMLHttpRequest</code> document</span>.
+ the <span>synchronous flag</span> is set and the
+ <span data-anolis-spec=html>JavaScript global environment</span> is a
+ <span data-anolis-spec=html>document environment</span>.
</dd>
</dl>
@@ -1092,8 +1065,9 @@
attribute must run these steps:
<ol>
- <li><p>If there is an associated
- <span><code>XMLHttpRequest</code> document</span> and the
+ <li><p>If the
+ <span data-anolis-spec=html>JavaScript global environment</span> is a
+ <span data-anolis-spec=html>document environment</span> and the
<span>synchronous flag</span> is set,
<span data-anolis-spec=dom title=concept-throw>throw</span> an
"<code data-anolis-spec=dom>InvalidAccessError</code>" exception and
@@ -1126,8 +1100,9 @@
the <span><code>send()</code> flag</span> is set.</p>
<p>When set: throws an
"<code data-anolis-spec=dom>InvalidAccessError</code>" exception if
- either the <span>synchronous flag</span> is set when there is an
- associated <span><code>XMLHttpRequest</code> document</span> or if the
+ either the <span>synchronous flag</span> is set and the
+ <span data-anolis-spec=html>JavaScript global environment</span> is a
+ <span data-anolis-spec=html>document environment</span> or if the
<span>anonymous flag</span> is set.</p>
</dd>
</dl>
@@ -1158,8 +1133,9 @@
"<code data-anolis-spec=dom>InvalidAccessError</code>" exception and
terminate these steps.
- <li><p>If there is an associated
- <span><code>XMLHttpRequest</code> document</span> and the
+ <li><p>If the
+ <span data-anolis-spec=html>JavaScript global environment</span> is a
+ <span data-anolis-spec=html>document environment</span> and the
<span>synchronous flag</span> is set,
<span data-anolis-spec=dom title=concept-throw>throw</span> an
"<code data-anolis-spec=dom>InvalidAccessError</code>" exception and
@@ -1385,8 +1361,8 @@
<li>
<dl class=switch>
- <dt>If the <span><code>XMLHttpRequest</code> origin</span> and the
- <span>request URL</span> are <span data-anolis-spec=html>same origin</span></dt>
+ <dt>If the <span>source origin</span> and the <span>request URL</span>
+ are <span data-anolis-spec=html>same origin</span></dt>
<dt>If the <span>request URL</span>'s
<code data-anolis-spec=html title=url-scheme><scheme></code> is
"<code title>data</code>"
@@ -1396,8 +1372,8 @@
<p><span data-anolis-spec=html>Fetch</span> the
<span>request URL</span> from <i title>origin</i>
- <span><code>XMLHttpRequest</code> origin</span>, using
- <span><code>XMLHttpRequest</code> referer source</span> as
+ <span>source origin</span>, using
+ <span>referrer source</span> as
<i title>override referer source</i>, with the
<i title>synchronous flag</i> set if the
<span>synchronous flag</span> is set, using HTTP method
@@ -1465,13 +1441,13 @@
<dd>The <span>request entity body</span>.</dd>
<dt>source origin</dt>
- <dd>The <span><code>XMLHttpRequest</code> origin</span>.</dd>
+ <dd>The <span>source origin</span>.</dd>
<dt>referer source
<dd>If the <span>anonymous flag</span> is set, the
<span data-anolis-spec=html>URL</span>
- "<code title>about:blank</code>", or the
- <span><code>XMLHttpRequest</code> referer source</span> otherwise.
+ "<code title>about:blank</code>", and the
+ <span>referrer source</span> otherwise.
<dt>omit credentials flag</dt>
<dd>Set if
@@ -1533,7 +1509,7 @@
handle <code>401 Unauthorized</code> requests appropriately.</p>
<p>If authentication fails,
- <span><code>XMLHttpRequest</code> origin</span> and the
+ <span>source origin</span> and the
<span>request URL</span> are <span data-anolis-spec=html>same origin</span>,
<code title="http-authorization">Authorization</code> is not in the list
of <span>author request headers</span>, <span>request username</span> is
@@ -1625,7 +1601,7 @@
<span data-anolis-spec=html>URL</span> conveyed by the
<code>Location</code> header.</p></li>
- <li><p>If the <span><code>XMLHttpRequest</code> origin</span> and the
+ <li><p>If the <span>source origin</span> and the
<span data-anolis-spec=html>origin</span> of <span>request URL</span>
are <span data-anolis-spec=html>same origin</span> transparently follow
the redirect while observing the
@@ -2319,7 +2295,7 @@
<li><p>Set <var title>document</var>'s
<span data-anolis-spec=html>origin</span> to the
- <span><code>XMLHttpRequest</code> origin</span>.
+ <span>source origin</span>.
<li><p>Set <var title>document</var>'s
<span data-anolis-spec=dom title=concept-document-content-type>content type</span>
@@ -2439,7 +2415,7 @@
<h4>The <code title>responseType</code> attribute</h4>
<dl class=domintro>
- <dt><code><var title>client</var> . <span title=dom-XMLHttpRequest-responseType>responseType</code> [ = <var title>value</var> ]</code>
+ <dt><code><var title>client</var> . <span title=dom-XMLHttpRequest-responseType>responseType</code><code> [ = <var title>value</var> ]</code>
<dd>
<p>Returns the response type.</p>
<p>Can be set to change the response type. Values are:
@@ -2455,8 +2431,9 @@
<span title="dom-XMLHttpRequest-DONE">DONE</span>.
<p>When set: throws an
"<code data-anolis-spec=dom>InvalidAccessError</code>" exception if the
- <span>synchronous flag</span> is set and there is an associated
- <span><code>XMLHttpRequest</code> document</span>.</p>
+ <span>synchronous flag</span> is set and the
+ <span data-anolis-spec=html>JavaScript global environment</span> is a
+ <span data-anolis-spec=html>document environment</span>.
</dl>
@@ -2477,8 +2454,9 @@
"<code data-anolis-spec=dom>InvalidStateError</code>" exception and
terminate these steps.
- <li><p>If there is an associated
- <span><code>XMLHttpRequest</code> document</span> and the
+ <li><p>If the
+ <span data-anolis-spec=html>JavaScript global environment</span> is a
+ <span data-anolis-spec=html>document environment</span> and the
<span>synchronous flag</span> is set,
<span data-anolis-spec=dom title=concept-throw>throw</span> an
"<code data-anolis-spec=dom>InvalidAccessError</code>" exception and