Skip to content

Commit

Permalink
Use new BufferSource concept from IDL
Browse files Browse the repository at this point in the history
  • Loading branch information
annevk committed Oct 4, 2014
1 parent 0f14352 commit 0511b50
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
13 changes: 7 additions & 6 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-3-october-2014">Living Standard — Last Updated 3 October 2014</h2>
<h2 class="no-num no-toc" id="living-standard-—-last-updated-4-october-2014">Living Standard — Last Updated 4 October 2014</h2>

<dl>
<dt>Participate:
Expand Down Expand Up @@ -2416,7 +2416,7 @@ <h3 id="headers-class"><span class="secno">5.1 </span>Headers class</h3>
<h3 id="body-mixin"><span class="secno">5.2 </span>Body mixin</h3>

<pre class="idl">typedef object <dfn id="json">JSON</dfn>;
typedef (ArrayBuffer or ArrayBufferView or <a class="external" href="http://dev.w3.org/2006/webapi/FileAPI/#blob">Blob</a> or <a class="external" href="https://xhr.spec.whatwg.org/#formdata">FormData</a> or USVString or <a class="external" href="https://url.spec.whatwg.org/#urlsearchparams">URLSearchParams</a>) <dfn id="bodyinit">BodyInit</dfn>;</pre>
typedef (BufferSource or <a class="external" href="http://dev.w3.org/2006/webapi/FileAPI/#blob">Blob</a> or <a class="external" href="https://xhr.spec.whatwg.org/#formdata">FormData</a> or USVString or <a class="external" href="https://url.spec.whatwg.org/#urlsearchparams">URLSearchParams</a>) <dfn id="bodyinit">BodyInit</dfn>;</pre>

<p>To <dfn id="concept-bodyinit-extract" title="concept-BodyInit-extract">extract</dfn> a byte stream and a
`<code title="">Content-Type</code>` <a href="#concept-header-value" title="concept-header-value">value</a> from
Expand All @@ -2431,10 +2431,11 @@ <h3 id="body-mixin"><span class="secno">5.2 </span>Body mixin</h3>
<p>Switch on <var title="">object</var>'s type:

<dl class="switch">
<dt><code title="">ArrayBuffer</code>
<dt><code title="">ArrayBufferView</code>
<dt><code title="">BufferSource</code>
<dd>
<p>Push a copy of <var title="">object</var>'s contents to <var title="">stream</var>.
<p>Push a
<a class="external" href="http://heycam.github.io/webidl/#dfn-get-buffer-source-copy" title="get a copy of the bytes held by the buffer source">copy of</a>
<var title="">object</var> to <var title="">stream</var>.

<dt><code class="external"><a href="http://dev.w3.org/2006/webapi/FileAPI/#blob">Blob</a></code>
<dd>
Expand All @@ -2460,7 +2461,7 @@ <h3 id="body-mixin"><span class="secno">5.2 </span>Body mixin</h3>
generated by the
<a class="external" href="https://html.spec.whatwg.org/multipage/forms.html#multipart/form-data-encoding-algorithm"><code>multipart/form-data</code> encoding algorithm</a>.

<dt>USVString
<dt><code title="">USVString</code>
<dd>
<p>Push the result of running <a class="external" href="https://encoding.spec.whatwg.org/#utf-8-encode">utf-8 encode</a> on
<var title="">object</var> to <var title="">stream</var>.
Expand Down
11 changes: 6 additions & 5 deletions Overview.src.html
Original file line number Diff line number Diff line change
Expand Up @@ -2371,7 +2371,7 @@ <h3>Headers class</h3>
<h3>Body mixin</h3>

<pre class=idl>typedef object <dfn>JSON</dfn>;
typedef (ArrayBuffer or ArrayBufferView or <span data-anolis-spec=fileapi>Blob</span> or <span data-anolis-spec=xhr>FormData</span> or USVString or <span data-anolis-spec=url>URLSearchParams</span>) <dfn>BodyInit</dfn>;</pre>
typedef (BufferSource or <span data-anolis-spec=fileapi>Blob</span> or <span data-anolis-spec=xhr>FormData</span> or USVString or <span data-anolis-spec=url>URLSearchParams</span>) <dfn>BodyInit</dfn>;</pre>

<p>To <dfn title=concept-BodyInit-extract>extract</dfn> a byte stream and a
`<code title>Content-Type</code>` <span title=concept-header-value>value</span> from
Expand All @@ -2386,10 +2386,11 @@ <h3>Body mixin</h3>
<p>Switch on <var title>object</var>'s type:

<dl class=switch>
<dt><code title>ArrayBuffer</code>
<dt><code title>ArrayBufferView</code>
<dt><code title>BufferSource</code>
<dd>
<p>Push a copy of <var title>object</var>'s contents to <var title>stream</var>.
<p>Push a
<span data-anolis-spec=webidl title="get a copy of the bytes held by the buffer source">copy of</span>
<var title>object</var> to <var title>stream</var>.

<dt><code data-anolis-spec=fileapi>Blob</code>
<dd>
Expand All @@ -2415,7 +2416,7 @@ <h3>Body mixin</h3>
generated by the
<span data-anolis-spec=html><code>multipart/form-data</code> encoding algorithm</span>.

<dt>USVString
<dt><code title>USVString</code>
<dd>
<p>Push the result of running <span data-anolis-spec=encoding>utf-8 encode</span> on
<var title>object</var> to <var title>stream</var>.
Expand Down

0 comments on commit 0511b50

Please sign in to comment.