Permalink
Browse files

Redo AnonXMLHttpRequest as dictionary argument

  • Loading branch information...
1 parent f4652f2 commit d43a3637bf99933df33712d14dc8fdef7a29bea7 @annevk annevk committed Oct 11, 2012
Showing with 56 additions and 72 deletions.
  1. +28 −36 Overview.html
  2. +28 −36 Overview.src.html
View
@@ -279,7 +279,11 @@ <h2 id="interface-xmlhttprequest"><span class="secno">4 </span>Interface <code t
"text"
};
-[<a href="#dom-xmlhttprequest" title="dom-XMLHttpRequest">Constructor</a>]
+dictionary <dfn id="xmlhttprequestoptions">XMLHttpRequestOptions</dfn> {
+ boolean anon = false;
+};
+
+[<a href="#dom-xmlhttprequest" title="dom-XMLHttpRequest">Constructor</a>(optional <a href="#xmlhttprequestoptions">XMLHttpRequestOptions</a> <var title="">options</var>)]
interface <dfn id="xmlhttprequest">XMLHttpRequest</dfn> : <a href="#xmlhttprequesteventtarget">XMLHttpRequestEventTarget</a> {
// <a href="#event-handlers">event handler</a>
attribute <a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#eventhandler">EventHandler</a> <a href="#handler-xhr-onreadystatechange" title="handler-xhr-onreadystatechange">onreadystatechange</a>;
@@ -311,10 +315,6 @@ <h2 id="interface-xmlhttprequest"><span class="secno">4 </span>Interface <code t
readonly attribute any <a href="#dom-xmlhttprequest-response" title="dom-XMLHttpRequest-response">response</a>;
readonly attribute DOMString <a href="#dom-xmlhttprequest-responsetext" title="dom-XMLHttpRequest-responseText">responseText</a>;
readonly attribute <a class="external" href="http://dom.spec.whatwg.org/#document">Document</a>? <a href="#dom-xmlhttprequest-responsexml" title="dom-XMLHttpRequest-responseXML">responseXML</a>;
-};
-
-[<a href="#dom-anonxmlhttprequest" title="dom-AnonXMLHttpRequest">Constructor</a>]
-interface <dfn id="anonxmlhttprequest">AnonXMLHttpRequest</dfn> : <a href="#xmlhttprequest">XMLHttpRequest</a> {
};</pre>
@@ -361,44 +361,36 @@ <h3 id="task-sources"><span class="secno">4.2 </span>Task sources</h3>
<dfn id="xmlhttprequest-task-source"><code>XMLHttpRequest</code> task source</dfn>.
- <h3 id="constructors"><span class="secno">4.3 </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 class="external" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/fetching-resources.html#fetch" title="fetch">fetching</a> resources. It can
- only be set to true by using the
- <code title="dom-AnonXMLHttpRequest"><a href="#dom-anonxmlhttprequest">AnonXMLHttpRequest()</a></code>
- constructor.</p>
-
- <p class="XXX">We
- <a href="https://www.w3.org/Bugs/Public/show_bug.cgi?id=17242">might remove</a>
- the <code title="dom-AnonXMLHttpRequest"><a href="#dom-anonxmlhttprequest">AnonXMLHttpRequest()</a></code>
- constructor.
-
+<h3 id="constructors"><span class="secno">4.3 </span>Constructors</h3>
- <dl class="domintro">
- <dt><var title="">client</var> = new <code title="dom-XMLHttpRequest"><a href="#dom-xmlhttprequest">XMLHttpRequest</a></code>()</dt>
- <dd>Returns a new <code><a href="#xmlhttprequest">XMLHttpRequest</a></code> object.</dd>
-
- <dt><var title="">client</var> = new <code title="dom-AnonXMLHttpRequest"><a href="#dom-anonxmlhttprequest">AnonXMLHttpRequest</a></code>()</dt>
- <dd>Returns a new <code><a href="#anonxmlhttprequest">AnonXMLHttpRequest</a></code> object that has the
- <a href="#anonymous-flag">anonymous flag</a> set.</dd>
+<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 class="external" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/fetching-resources.html#fetch" title="fetch">fetching</a> resources.
- </dl>
+<dl class="domintro">
+ <dt><code><var title="">client</var> = new <a href="#dom-xmlhttprequest" title="dom-XMLHttpRequest">XMLHttpRequest</a>()</code>
+ <dd>Returns a new <code><a href="#xmlhttprequest">XMLHttpRequest</a></code> object.
- <p>The <dfn id="dom-xmlhttprequest" title="dom-XMLHttpRequest"><code>XMLHttpRequest()</code></dfn>
- constructor must return a new <code><a href="#xmlhttprequest">XMLHttpRequest</a></code> object.
+ <dt><code><var title="">client</var> = new <a href="#dom-xmlhttprequest" title="dom-XMLHttpRequest">XMLHttpRequest</a>({anon:true})</code>
+ <dd>Returns a new <code><a href="#xmlhttprequest">XMLHttpRequest</a></code> object that has its
+ <a href="#anonymous-flag">anonymous flag</a> set.
+</dl>
+<p>The
+<dfn id="dom-xmlhttprequest" title="dom-XMLHttpRequest"><code>XMLHttpRequest(<var title="">options</var>)</code></dfn>
+constructor must run these steps:
- <p>The
- <dfn id="dom-anonxmlhttprequest" title="dom-AnonXMLHttpRequest"><code>AnonXMLHttpRequest()</code></dfn>
- constructor must return a new <code><a href="#anonxmlhttprequest">AnonXMLHttpRequest</a></code> object with
- its <a href="#anonymous-flag">anonymous flag</a> set.</p>
+<ol>
+ <li><p>Let <var title="">xhr</var> be a new <code><a href="#xmlhttprequest">XMLHttpRequest</a></code>
+ object.
+ <li><p>If <var title="">options</var>'s <code title="">anon</code> member is
+ true, set <var title="">xhr</var>'s <a href="#anonymous-flag">anonymous flag</a>.
+ <li><p>Return <var title="">xhr</var>.
+</ol>
<h3 id="garbage-collection"><span class="secno">4.4 </span>Garbage collection</h3>
View
@@ -227,7 +227,11 @@ <h2 id="terminology">Terminology</h2>
"text"
};
-[<span title="dom-XMLHttpRequest">Constructor</span>]
+dictionary <dfn>XMLHttpRequestOptions</dfn> {
+ boolean anon = false;
+};
+
+[<span title="dom-XMLHttpRequest">Constructor</span>(optional <span>XMLHttpRequestOptions</span> <var title>options</var>)]
interface <dfn id="xmlhttprequest">XMLHttpRequest</dfn> : <span>XMLHttpRequestEventTarget</span> {
// <a href="#event-handlers">event handler</a>
attribute <span data-anolis-spec=html>EventHandler</span> <span title="handler-xhr-onreadystatechange">onreadystatechange</span>;
@@ -259,10 +263,6 @@ <h2 id="terminology">Terminology</h2>
readonly attribute any <span title="dom-XMLHttpRequest-response">response</span>;
readonly attribute DOMString <span title="dom-XMLHttpRequest-responseText">responseText</span>;
readonly attribute <span data-anolis-spec=dom>Document</span>? <span title="dom-XMLHttpRequest-responseXML">responseXML</span>;
-};
-
-[<span title="dom-AnonXMLHttpRequest">Constructor</span>]
-interface <dfn id="anonxmlhttprequest">AnonXMLHttpRequest</dfn> : <span>XMLHttpRequest</span> {
};</pre>
@@ -309,44 +309,36 @@ <h2 id="terminology">Terminology</h2>
<dfn><code>XMLHttpRequest</code> task source</dfn>.
- <h3 id="constructors">Constructors</h3>
-
-
- <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 data-anolis-spec=html title=fetch>fetching</span> resources. It can
- only be set to true by using the
- <code title="dom-AnonXMLHttpRequest">AnonXMLHttpRequest()</code>
- constructor.</p>
-
- <p class=XXX>We
- <a href="https://www.w3.org/Bugs/Public/show_bug.cgi?id=17242">might remove</a>
- the <code title="dom-AnonXMLHttpRequest">AnonXMLHttpRequest()</code>
- constructor.
-
+<h3 id="constructors">Constructors</h3>
- <dl class="domintro">
- <dt><var title>client</var> = new <code title="dom-XMLHttpRequest">XMLHttpRequest</code>()</dt>
- <dd>Returns a new <code>XMLHttpRequest</code> object.</dd>
-
- <dt><var title>client</var> = new <code title="dom-AnonXMLHttpRequest">AnonXMLHttpRequest</code>()</dt>
- <dd>Returns a new <code>AnonXMLHttpRequest</code> object that has the
- <span>anonymous flag</span> set.</dd>
+<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 data-anolis-spec=html title=fetch>fetching</span> resources.
- </dl>
+<dl class="domintro">
+ <dt><code><var title>client</var> = new <span title="dom-XMLHttpRequest">XMLHttpRequest</span>()</code>
+ <dd>Returns a new <code>XMLHttpRequest</code> object.
- <p>The <dfn title="dom-XMLHttpRequest"><code>XMLHttpRequest()</code></dfn>
- constructor must return a new <code>XMLHttpRequest</code> object.
+ <dt><code><var title>client</var> = new <span title="dom-XMLHttpRequest">XMLHttpRequest</span>({anon:true})</code>
+ <dd>Returns a new <code>XMLHttpRequest</code> object that has its
+ <span>anonymous flag</span> set.
+</dl>
+<p>The
+<dfn title="dom-XMLHttpRequest"><code>XMLHttpRequest(<var title>options</var>)</code></dfn>
+constructor must run these steps:
- <p>The
- <dfn title="dom-AnonXMLHttpRequest"><code>AnonXMLHttpRequest()</code></dfn>
- constructor must return a new <code>AnonXMLHttpRequest</code> object with
- its <span>anonymous flag</span> set.</p>
+<ol>
+ <li><p>Let <var title>xhr</var> be a new <code>XMLHttpRequest</code>
+ object.
+ <li><p>If <var title>options</var>'s <code title>anon</code> member is
+ true, set <var title>xhr</var>'s <span>anonymous flag</span>.
+ <li><p>Return <var title>xhr</var>.
+</ol>
<h3>Garbage collection</h3>

0 comments on commit d43a363

Please sign in to comment.