Skip to content

Commit

Permalink
Make it more clear how fetch()'s parameters map to internal state htt…
Browse files Browse the repository at this point in the history
  • Loading branch information
annevk committed Dec 10, 2014
1 parent acbdc35 commit 174a674
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 15 deletions.
36 changes: 28 additions & 8 deletions Overview.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<p><a class="logo" href="//whatwg.org/"><img alt="WHATWG" height="100" src="//resources.whatwg.org/logo-fetch.svg" width="100"></a>
<h1 id="cors">Fetch</h1>
<h2 class="no-num no-toc" id="living-standard-—-last-updated-8-december-2014">Living Standard — Last Updated 8 December 2014</h2>
<h2 class="no-num no-toc" id="living-standard-—-last-updated-10-december-2014">Living Standard — Last Updated 10 December 2014</h2>

<dl>
<dt>Participate:
Expand Down Expand Up @@ -2910,18 +2910,29 @@ <h3 id="request-class"><span class="secno">5.3 </span>Request class</h3>
<li><p>Set <var title="">request</var>'s <a href="#concept-request-url" title="concept-request-url">url</a> to
<var title="">parsedURL</var>.

<li><p>Set <var title="">fallbackMode</var> to <i title="">CORS</i>.
<li><p>Set <var title="">fallbackMode</var> to "<code title="">cors</code>".

<li><p>Set <var title="">fallbackCredentials</var> to <i title="">omit</i>.
<li><p>Set <var title="">fallbackCredentials</var> to "<code title="">omit</code>".

<li><p>Set <var title="">fallbackCache</var> to <i title="">default</i>.
<li><p>Set <var title="">fallbackCache</var> to "<code title="">default</code>".
</ol>

<li><p>Let <var title="">mode</var> be <var title="">init</var>'s <code title="">mode</code>
member if it is present, and <var title="">fallbackMode</var> otherwise.

<li><p>If <var title="">mode</var> is non-null, set <var title="">request</var>'s
<a href="#concept-request-mode" title="concept-request-mode">mode</a> to <var title="">mode</var>.
<li>
<p>If <var title="">mode</var> is non-null, set <var title="">request</var>'s
<a href="#concept-request-mode" title="concept-request-mode">mode</a> to the value corresponding to the first
matching statement, switching on <var title="">mode</var>:

<dl class="switch">
<dt>"<code title="">same-origin</code>"
<dd><i title="">same-origin</i>
<dt>"<code title="">no-cors</code>"
<dd><i title="">no CORS</i>
<dt>"<code title="">cors</code>"
<dd><i title="">CORS</i>
</dl>

<li><p>Let <var title="">credentials</var> be <var title="">init</var>'s
<code title="">credentials</code> member if it is present, and
Expand All @@ -2934,8 +2945,17 @@ <h3 id="request-class"><span class="secno">5.3 </span>Request class</h3>
<li><p>Let <var title="">cache</var> be <var title="">init</var>'s <code title="">cache</code>
member if it is present, and <var title="">fallbackCache</var> otherwise.

<li><p>If <var title="">cache</var> is non-null, set <var title="">request</var>'s
<a href="#concept-request-cache-mode" title="concept-request-cache-mode">cache mode</a> to <var title="">cache</var>.
<li>
<p>If <var title="">cache</var> is non-null, set <var title="">request</var>'s
<a href="#concept-request-cache-mode" title="concept-request-cache-mode">cache mode</a> to the value corresponding to
the first matching statement, switching on <var title="">cache</var>:

<dl class="switch">
<dt>"<code title="">force-cache</code>"
<dt><i title="">force cache</i>
<dt>Otherwise
<dd>Value as is.
</dl>

<li>
<p>If <var title="">init</var>'s <code title="">method</code> member is present, let
Expand Down
34 changes: 27 additions & 7 deletions Overview.src.html
Original file line number Diff line number Diff line change
Expand Up @@ -2864,18 +2864,29 @@ <h3>Request class</h3>
<li><p>Set <var title>request</var>'s <span title=concept-request-url>url</span> to
<var title>parsedURL</var>.

<li><p>Set <var title>fallbackMode</var> to <i title>CORS</i>.
<li><p>Set <var title>fallbackMode</var> to "<code title>cors</code>".

<li><p>Set <var title>fallbackCredentials</var> to <i title>omit</i>.
<li><p>Set <var title>fallbackCredentials</var> to "<code title>omit</code>".

<li><p>Set <var title>fallbackCache</var> to <i title>default</i>.
<li><p>Set <var title>fallbackCache</var> to "<code title>default</code>".
</ol>

<li><p>Let <var title>mode</var> be <var title>init</var>'s <code title>mode</code>
member if it is present, and <var title>fallbackMode</var> otherwise.

<li><p>If <var title>mode</var> is non-null, set <var title>request</var>'s
<span title=concept-request-mode>mode</span> to <var title>mode</var>.
<li>
<p>If <var title>mode</var> is non-null, set <var title>request</var>'s
<span title=concept-request-mode>mode</span> to the value corresponding to the first
matching statement, switching on <var title>mode</var>:

<dl class=switch>
<dt>"<code title>same-origin</code>"
<dd><i title>same-origin</i>
<dt>"<code title>no-cors</code>"
<dd><i title>no CORS</i>
<dt>"<code title>cors</code>"
<dd><i title>CORS</i>
</dl>

<li><p>Let <var title>credentials</var> be <var title>init</var>'s
<code title>credentials</code> member if it is present, and
Expand All @@ -2888,8 +2899,17 @@ <h3>Request class</h3>
<li><p>Let <var title>cache</var> be <var title>init</var>'s <code title>cache</code>
member if it is present, and <var title>fallbackCache</var> otherwise.

<li><p>If <var title>cache</var> is non-null, set <var title>request</var>'s
<span title=concept-request-cache-mode>cache mode</span> to <var title>cache</var>.
<li>
<p>If <var title>cache</var> is non-null, set <var title>request</var>'s
<span title=concept-request-cache-mode>cache mode</span> to the value corresponding to
the first matching statement, switching on <var title>cache</var>:

<dl class=switch>
<dt>"<code title>force-cache</code>"
<dt><i title>force cache</i>
<dt>Otherwise
<dd>Value as is.
</dl>

<li>
<p>If <var title>init</var>'s <code title>method</code> member is present, let
Expand Down

0 comments on commit 174a674

Please sign in to comment.