use default values in IDL for async and data arguments per public-webapps discussion
--- a/Overview.html Mon Mar 26 18:44:50 2012 +0100
+++ b/Overview.html Thu Apr 12 08:43:04 2012 +0200
@@ -40,7 +40,7 @@
<h1 class="head" id="xmlhttprequest-ls">XMLHttpRequest</h1>
- <h2 class="no-num no-toc" id="w3c-doctype">Editor's Draft 26 March 2012</h2>
+ <h2 class="no-num no-toc" id="w3c-doctype">Editor's Draft 12 April 2012</h2>
<dl>
<dt>This Version:</dt>
@@ -75,7 +75,7 @@
<p class="dontpublish copyright"><a href="http://creativecommons.org/publicdomain/zero/1.0/" rel="license"><img alt="CC0" src="http://i.creativecommons.org/p/zero/1.0/80x15.png"></a>
To the extent possible under law, the editor has waived all copyright and
related or neighboring rights to this work. In addition, as of
-26 March 2012, the editor has made this specification available
+12 April 2012, the editor has made this specification available
under the
<a href="http://www.openwebfoundation.org/legal/the-owf-1-0-agreements/owfa-1-0" rel="license">Open Web Foundation Agreement Version 1.0</a>,
which is available at
@@ -393,17 +393,12 @@
readonly attribute unsigned short <a href="#dom-xmlhttprequest-readystate" title="dom-XMLHttpRequest-readyState">readyState</a>;
// <a href="#request">request</a>
- void <a href="#dom-xmlhttprequest-open" title="dom-XMLHttpRequest-open">open</a>(DOMString <var>method</var>, DOMString <var title="">url</var>, optional boolean <var>async</var>, optional DOMString? <var>user</var>, optional DOMString? <var>password</var>);
+ void <a href="#dom-xmlhttprequest-open" title="dom-XMLHttpRequest-open">open</a>(DOMString <var>method</var>, DOMString <var title="">url</var>, optional boolean <var>async</var> = true, optional DOMString? <var>user</var>, optional DOMString? <var>password</var>);
void <a href="#dom-xmlhttprequest-setrequestheader" title="dom-XMLHttpRequest-setRequestHeader">setRequestHeader</a>(DOMString <var>header</var>, DOMString <var>value</var>);
attribute unsigned long <a href="#dom-xmlhttprequest-timeout" title="dom-XMLHttpRequest-timeout">timeout</a>;
attribute boolean <a href="#dom-xmlhttprequest-withcredentials" title="dom-XMLHttpRequest-withCredentials">withCredentials</a>;
readonly attribute <a href="#xmlhttprequestupload">XMLHttpRequestUpload</a> <a href="#dom-xmlhttprequest-upload" title="dom-XMLHttpRequest-upload">upload</a>;
- void <a href="#dom-xmlhttprequest-send" title="dom-XMLHttpRequest-send">send</a>();
- void <a href="#dom-xmlhttprequest-send" title="dom-XMLHttpRequest-send">send</a>(<a class="external" href="http://www.khronos.org/registry/typedarray/specs/latest/#5">ArrayBuffer</a> <var>data</var>);
- void <a href="#dom-xmlhttprequest-send" title="dom-XMLHttpRequest-send">send</a>(<a class="external" href="http://dev.w3.org/2006/webapi/FileAPI/#blob">Blob</a> <var>data</var>);
- void <a href="#dom-xmlhttprequest-send" title="dom-XMLHttpRequest-send">send</a>(<a class="external" href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#document">Document</a> <var>data</var>);
- void <a href="#dom-xmlhttprequest-send" title="dom-XMLHttpRequest-send">send</a>(DOMString? <var>data</var>);
- void <a href="#dom-xmlhttprequest-send" title="dom-XMLHttpRequest-send">send</a>(<a href="#formdata">FormData</a> <var>data</var>);
+ void <a href="#dom-xmlhttprequest-send" title="dom-XMLHttpRequest-send">send</a>(optional (<a class="external" href="http://www.khronos.org/registry/typedarray/specs/latest/#5">ArrayBuffer</a> or <a class="external" href="http://dev.w3.org/2006/webapi/FileAPI/#blob">Blob</a> or <a class="external" href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#document">Document</a> or DOMString or <a href="#formdata">FormData</a>)? <var>data</var> = null);
void <a href="#dom-xmlhttprequest-abort" title="dom-XMLHttpRequest-abort">abort</a>();
// <a href="#response">response</a>
@@ -848,23 +843,17 @@
<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>Let <var>async</var> be the value of the <var>async</var> argument or
- true if it was omitted.
-
-
- <p>If <var>async</var> is false, there is an associated
- <a href="#xmlhttprequest-document"><code>XMLHttpRequest</code> document</a> and either the
- <code title="dom-XMLHttpRequest-timeout"><a href="#dom-xmlhttprequest-timeout">timeout</a></code> attribute value is
- not zero, the
- <code title="dom-XMLHttpRequest-withCredentials"><a href="#dom-xmlhttprequest-withcredentials">withCredentials</a></code>
- attribute value is true, or the
- <code title="dom-XMLHttpRequest-responseType"><a href="#dom-xmlhttprequest-responsetype">responseType</a></code>
- attribute value is not the empty string,
- <a class="external" href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#concept-throw" title="concept-throw">throw</a> an
- "<code class="external"><a href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#invalidaccesserror">InvalidAccessError</a></code>" exception and
- terminate these steps.
-
+ <li><p>If <var>async</var> is false, there is an associated
+ <a href="#xmlhttprequest-document"><code>XMLHttpRequest</code> document</a> and either the
+ <code title="dom-XMLHttpRequest-timeout"><a href="#dom-xmlhttprequest-timeout">timeout</a></code> attribute value is
+ not zero, the
+ <code title="dom-XMLHttpRequest-withCredentials"><a href="#dom-xmlhttprequest-withcredentials">withCredentials</a></code>
+ attribute value is true, or the
+ <code title="dom-XMLHttpRequest-responseType"><a href="#dom-xmlhttprequest-responsetype">responseType</a></code>
+ attribute value is not the empty string,
+ <a class="external" href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#concept-throw" title="concept-throw">throw</a> an
+ "<code class="external"><a href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#invalidaccesserror">InvalidAccessError</a></code>" exception and
+ terminate these steps.
<li>
<p>If the <var title="">user</var> argument was not omitted follow these
@@ -1280,14 +1269,12 @@
"<code class="external"><a href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#invalidstateerror">InvalidStateError</a></code>" exception and
terminate these steps.
+ <li><p>If the <a href="#request-method">request method</a> is <code>GET</code> or
+ <code>HEAD</code>, set <var title="">data</var> to null.
+
<li>
- <p>If the <a href="#request-method">request method</a> is a case-sensitive match for
- <code>GET</code> or <code>HEAD</code> act as if <var title="">data</var>
- is null.</p>
-
- <p>If the <var>data</var> argument has been omitted or is
- null, do not include a <a href="#request-entity-body">request entity body</a>
- and go to the next step.</p>
+ <p>If <var title="">data</var> is null, do not include a
+ <a href="#request-entity-body">request entity body</a> and go to the next step.
<p>Otherwise, let <var>encoding</var> be null, <var>mime type</var> be
null, and then follow these rules:</p>
--- a/Overview.src.html Mon Mar 26 18:44:50 2012 +0100
+++ b/Overview.src.html Thu Apr 12 08:43:04 2012 +0200
@@ -400,17 +400,12 @@
readonly attribute unsigned short <span title="dom-XMLHttpRequest-readyState">readyState</span>;
// <a href="#request">request</a>
- void <span title="dom-XMLHttpRequest-open">open</span>(DOMString <var>method</var>, DOMString <var title>url</var>, optional boolean <var>async</var>, optional DOMString? <var>user</var>, optional DOMString? <var>password</var>);
+ void <span title="dom-XMLHttpRequest-open">open</span>(DOMString <var>method</var>, DOMString <var title>url</var>, optional boolean <var>async</var> = true, optional DOMString? <var>user</var>, optional DOMString? <var>password</var>);
void <span title="dom-XMLHttpRequest-setRequestHeader">setRequestHeader</span>(DOMString <var>header</var>, DOMString <var>value</var>);
attribute unsigned long <span title="dom-XMLHttpRequest-timeout">timeout</span>;
attribute boolean <span title="dom-XMLHttpRequest-withCredentials">withCredentials</span>;
readonly attribute <span>XMLHttpRequestUpload</span> <span title="dom-XMLHttpRequest-upload">upload</span>;
- void <span title="dom-XMLHttpRequest-send">send</span>();
- void <span title="dom-XMLHttpRequest-send">send</span>(<span data-anolis-spec=typedarray>ArrayBuffer</span> <var>data</var>);
- void <span title="dom-XMLHttpRequest-send">send</span>(<span data-anolis-spec=fileapi>Blob</span> <var>data</var>);
- void <span title="dom-XMLHttpRequest-send">send</span>(<span data-anolis-spec=dom>Document</span> <var>data</var>);
- void <span title="dom-XMLHttpRequest-send">send</span>(DOMString? <var>data</var>);
- void <span title="dom-XMLHttpRequest-send">send</span>(<span>FormData</span> <var>data</var>);
+ void <span title="dom-XMLHttpRequest-send">send</span>(optional (<span data-anolis-spec=typedarray>ArrayBuffer</span> or <span data-anolis-spec=fileapi>Blob</span> or <span data-anolis-spec=dom>Document</span> or DOMString or <span>FormData</span>)? <var>data</var> = null);
void <span title="dom-XMLHttpRequest-abort">abort</span>();
// <a href="#response">response</a>
@@ -855,23 +850,17 @@
<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>Let <var>async</var> be the value of the <var>async</var> argument or
- true if it was omitted.
-
-
- <p>If <var>async</var> is false, there is an associated
- <span><code>XMLHttpRequest</code> document</span> and either the
- <code title=dom-XMLHttpRequest-timeout>timeout</code> attribute value is
- not zero, the
- <code title=dom-XMLHttpRequest-withCredentials>withCredentials</code>
- attribute value is true, or the
- <code title=dom-XMLHttpRequest-responseType>responseType</code>
- attribute value is not the empty string,
- <span data-anolis-spec=dom title=concept-throw>throw</span> an
- "<code data-anolis-spec=dom>InvalidAccessError</code>" exception and
- terminate these steps.
-
+ <li><p>If <var>async</var> is false, there is an associated
+ <span><code>XMLHttpRequest</code> document</span> and either the
+ <code title=dom-XMLHttpRequest-timeout>timeout</code> attribute value is
+ not zero, the
+ <code title=dom-XMLHttpRequest-withCredentials>withCredentials</code>
+ attribute value is true, or the
+ <code title=dom-XMLHttpRequest-responseType>responseType</code>
+ attribute value is not the empty string,
+ <span data-anolis-spec=dom title=concept-throw>throw</span> an
+ "<code data-anolis-spec=dom>InvalidAccessError</code>" exception and
+ terminate these steps.
<li>
<p>If the <var title>user</var> argument was not omitted follow these
@@ -1287,14 +1276,12 @@
"<code data-anolis-spec=dom>InvalidStateError</code>" exception and
terminate these steps.
+ <li><p>If the <span>request method</span> is <code>GET</code> or
+ <code>HEAD</code>, set <var title>data</var> to null.
+
<li>
- <p>If the <span>request method</span> is a case-sensitive match for
- <code>GET</code> or <code>HEAD</code> act as if <var title>data</var>
- is null.</p>
-
- <p>If the <var>data</var> argument has been omitted or is
- null, do not include a <span>request entity body</span>
- and go to the next step.</p>
+ <p>If <var title>data</var> is null, do not include a
+ <span>request entity body</span> and go to the next step.
<p>Otherwise, let <var>encoding</var> be null, <var>mime type</var> be
null, and then follow these rules:</p>