Skip to content

Commit

Permalink
Remove web-incompatible simplifications of FormData
Browse files Browse the repository at this point in the history
Everything done by f9d4c25 is now
reverted as it turned out nothing there would really stick. I should
avoid experiments like this going forward without solid evidence since
it’s just not worth the time and churn.

Fixes #73.
  • Loading branch information
annevk committed Jun 27, 2016
1 parent ecce390 commit 1a75845
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 47 deletions.
63 changes: 39 additions & 24 deletions Overview.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<p><a class="logo" href="https://whatwg.org/"><img alt="WHATWG" height="100" src="https://resources.whatwg.org/logo-xhr.svg" width="100"></a>
<h1 id="xmlhttprequest-ls">XMLHttpRequest</h1>
<h2 class="no-num no-toc" id="living-standard-—-last-updated-7-june-2016">Living Standard — Last Updated 7 June 2016</h2>
<h2 class="no-num no-toc" id="living-standard-—-last-updated-27-june-2016">Living Standard — Last Updated 27 June 2016</h2>

<dl>
<dt>Participate:
Expand Down Expand Up @@ -1928,7 +1928,7 @@ <h3 id="events"><span class="secno">4.7 </span>Events summary</h3>

<h2 id="interface-formdata"><span class="secno">5 </span>Interface <code title="">FormData</code></h2>

<pre class="idl">typedef (<a class="external" data-anolis-spec="fileapi" href="https://w3c.github.io/FileAPI/#blob">Blob</a> or USVString) <dfn id="formdataentryvalue">FormDataEntryValue</dfn>;
<pre class="idl">typedef (<a class="external" data-anolis-spec="fileapi" href="https://w3c.github.io/FileAPI/#file">File</a> or USVString) <dfn id="formdataentryvalue">FormDataEntryValue</dfn>;

[<a href="#dom-formdata" title="dom-FormData">Constructor</a>(optional <a class="external" data-anolis-spec="html" href="https://html.spec.whatwg.org/multipage/forms.html#htmlformelement">HTMLFormElement</a> <var>form</var>),
Exposed=(Window,Worker)]
Expand Down Expand Up @@ -1960,6 +1960,34 @@ <h2 id="interface-formdata"><span class="secno">5 </span>Interface <code title="
<a href="#concept-formdata-entry-value" title="concept-FormData-entry-value">value</a>'s
<a href="https://w3c.github.io/FileAPI/#dfn-name"><code class="external" data-anolis-spec="fileapi" title="dom-File-name">name</code></a> attribute.

<p>To <dfn id="create-an-entry">create an entry</dfn> for <var>name</var>, <var>value</var>, and optionally a
<var>filename</var>, run these steps:

<ol>
<li><p>Let <var>entry</var> be a new <a href="#concept-formdata-entry" title="concept-FormData-entry">entry</a>.

<li><p>Set <var>entry</var>'s <a href="#concept-formdata-entry-name" title="concept-FormData-entry-name">name</a> to
<var>name</var>.

<li><p>If <var>value</var> is a <a href="https://w3c.github.io/FileAPI/#blob"><code class="external" data-anolis-spec="fileapi">Blob</code></a> object and not a
<a href="https://w3c.github.io/FileAPI/#file"><code class="external" data-anolis-spec="fileapi">File</code></a> object, then set <var>value</var> to a new
<a href="https://w3c.github.io/FileAPI/#file"><code class="external" data-anolis-spec="fileapi">File</code></a> object, representing the same bytes, whose
<a href="https://w3c.github.io/FileAPI/#dfn-name"><code class="external" data-anolis-spec="fileapi" title="dom-File-name">name</code></a> attribute value is
"<code title="">blob</code>".
<!-- XXX at some point File API should get internal slots for this -->

<li><p>If <var>value</var> is (now) a <a href="https://w3c.github.io/FileAPI/#file"><code class="external" data-anolis-spec="fileapi">File</code></a> object and
<var title="">filename</var> is given, then set <var>value</var> to a new
<a href="https://w3c.github.io/FileAPI/#file"><code class="external" data-anolis-spec="fileapi">File</code></a> object, representing the same bytes, whose
<a href="https://w3c.github.io/FileAPI/#dfn-name"><code class="external" data-anolis-spec="fileapi" title="dom-File-name">name</code></a> attribute value is
<var>filename</var>.

<li><p>Set <var>entry</var>'s <a href="#concept-formdata-entry-value" title="concept-FormData-entry-value">value</a> to
<var>value</var>.

<li><p>Return <var>entry</var>.
</ol>

<hr>

<p>The
Expand All @@ -1981,15 +2009,10 @@ <h2 id="interface-formdata"><span class="secno">5 </span>Interface <code title="
method, when invoked, must run these steps:

<ol>
<li><p>If the <var>filename</var> argument is given, set <var>value</var> to a new
<a href="https://w3c.github.io/FileAPI/#file"><code class="external" data-anolis-spec="fileapi">File</code></a> object whose contents are <var>value</var> and
<a href="https://w3c.github.io/FileAPI/#dfn-name"><code class="external" data-anolis-spec="fileapi" title="dom-File-name">name</code></a> is <var>filename</var>.
<!-- XXX at some point File API should get internal slots for this -->
<li><p>Let <var>entry</var> be the result of <a href="#create-an-entry" title="create an entry">creating an entry</a>
with <var>name</var>, <var>value</var>, and <var>filename</var> if given.

<li><p>Append a new <a href="#concept-formdata-entry" title="concept-FormData-entry">entry</a> whose
<a href="#concept-formdata-entry-name" title="concept-FormData-entry-name">name</a> is <var>name</var>, and
<a href="#concept-formdata-entry-value" title="concept-FormData-entry-value">value</a> is <var>value</var>, to
<a class="external" data-anolis-spec="dom" href="https://dom.spec.whatwg.org/#context-object">context object</a>'s list of
<li><p>Append <var>entry</var> to <a class="external" data-anolis-spec="dom" href="https://dom.spec.whatwg.org/#context-object">context object</a>'s list of
<a href="#concept-formdata-entry" title="concept-FormData-entry">entries</a>.
</ol>

Expand Down Expand Up @@ -2020,25 +2043,17 @@ <h2 id="interface-formdata"><span class="secno">5 </span>Interface <code title="
method, when invoked, must run these steps:

<ol>
<li><p>If the <var>filename</var> argument is given, set <var>value</var> to a new
<a href="https://w3c.github.io/FileAPI/#file"><code class="external" data-anolis-spec="fileapi">File</code></a> object whose contents are <var>value</var> and
<a href="https://w3c.github.io/FileAPI/#dfn-name"><code class="external" data-anolis-spec="fileapi" title="dom-File-name">name</code></a> is <var>filename</var>.
<!-- XXX at some point File API should get internal slots for this -->

<li><p>Let <var>entry</var> be a new <a href="#concept-formdata-entry" title="concept-FormData-entry">entry</a>
whose <a href="#concept-formdata-entry-name" title="concept-FormData-entry-name">name</a> is <var>name</var>, and
<a href="#concept-formdata-entry-value" title="concept-FormData-entry-value">value</a> is <var>value</var>.
<li><p>Let <var>entry</var> be the result of <a href="#create-an-entry" title="create an entry">creating an entry</a>
with <var>name</var>, <var>value</var>, and <var>filename</var> if given.

<li><p>If there are any <a href="#concept-formdata-entry" title="concept-FormData-entry">entries</a> in
<a class="external" data-anolis-spec="dom" href="https://dom.spec.whatwg.org/#context-object">context object</a>'s list of
<a href="#concept-formdata-entry" title="concept-FormData-entry">entries</a> whose
<a href="#concept-formdata-entry-name" title="concept-FormData-entry-name">name</a> is <var>name</var>, replace
the first such <a href="#concept-formdata-entry" title="concept-FormData-entry">entry</a> with <var>entry</var> and
remove the others.
<a href="#concept-formdata-entry-name" title="concept-FormData-entry-name">name</a> is <var>name</var>, then replace the first such
<a href="#concept-formdata-entry" title="concept-FormData-entry">entry</a> with <var>entry</var> and remove the others.

<li><p>Otherwise, append <var>entry</var> to
<a class="external" data-anolis-spec="dom" href="https://dom.spec.whatwg.org/#context-object">context object</a>'s list of
<a href="#concept-formdata-entry" title="concept-FormData-entry">entries</a>.
<li><p>Otherwise, append <var>entry</var> to <a class="external" data-anolis-spec="dom" href="https://dom.spec.whatwg.org/#context-object">context object</a>'s
list of <a href="#concept-formdata-entry" title="concept-FormData-entry">entries</a>.
</ol>

<p>The <a class="external" data-anolis-spec="webidl" href="https://heycam.github.io/webidl/#dfn-value-pairs-to-iterate-over">value pairs to iterate over</a> are the
Expand Down
61 changes: 38 additions & 23 deletions Overview.src.html
Original file line number Diff line number Diff line change
Expand Up @@ -1880,7 +1880,7 @@ <h3 id="events">Events summary</h3>

<h2>Interface <code title>FormData</code></h2>

<pre class="idl">typedef (<span data-anolis-spec=fileapi>Blob</span> or USVString) <dfn>FormDataEntryValue</dfn>;
<pre class="idl">typedef (<span data-anolis-spec=fileapi>File</span> or USVString) <dfn>FormDataEntryValue</dfn>;

[<span title="dom-FormData">Constructor</span>(optional <span data-anolis-spec=html>HTMLFormElement</span> <var>form</var>),
Exposed=(Window,Worker)]
Expand Down Expand Up @@ -1912,6 +1912,34 @@ <h2>Interface <code title>FormData</code></h2>
<span title=concept-FormData-entry-value>value</span>'s
<code data-anolis-spec=fileapi title=dom-File-name>name</code> attribute.

<p>To <dfn>create an entry</dfn> for <var>name</var>, <var>value</var>, and optionally a
<var>filename</var>, run these steps:

<ol>
<li><p>Let <var>entry</var> be a new <span title=concept-FormData-entry>entry</span>.

<li><p>Set <var>entry</var>'s <span title=concept-FormData-entry-name>name</span> to
<var>name</var>.

<li><p>If <var>value</var> is a <code data-anolis-spec=fileapi>Blob</code> object and not a
<code data-anolis-spec=fileapi>File</code> object, then set <var>value</var> to a new
<code data-anolis-spec=fileapi>File</code> object, representing the same bytes, whose
<code data-anolis-spec=fileapi title=dom-File-name>name</code> attribute value is
"<code title>blob</code>".
<!-- XXX at some point File API should get internal slots for this -->

<li><p>If <var>value</var> is (now) a <code data-anolis-spec=fileapi>File</code> object and
<var title>filename</var> is given, then set <var>value</var> to a new
<code data-anolis-spec=fileapi>File</code> object, representing the same bytes, whose
<code data-anolis-spec=fileapi title=dom-File-name>name</code> attribute value is
<var>filename</var>.

<li><p>Set <var>entry</var>'s <span title=concept-FormData-entry-value>value</span> to
<var>value</var>.

<li><p>Return <var>entry</var>.
</ol>

<hr>

<p>The
Expand All @@ -1933,15 +1961,10 @@ <h2>Interface <code title>FormData</code></h2>
method, when invoked, must run these steps:

<ol>
<li><p>If the <var>filename</var> argument is given, set <var>value</var> to a new
<code data-anolis-spec=fileapi>File</code> object whose contents are <var>value</var> and
<code data-anolis-spec=fileapi title=dom-File-name>name</code> is <var>filename</var>.
<!-- XXX at some point File API should get internal slots for this -->
<li><p>Let <var>entry</var> be the result of <span title="create an entry">creating an entry</span>
with <var>name</var>, <var>value</var>, and <var>filename</var> if given.

<li><p>Append a new <span title=concept-FormData-entry>entry</span> whose
<span title=concept-FormData-entry-name>name</span> is <var>name</var>, and
<span title=concept-FormData-entry-value>value</span> is <var>value</var>, to
<span data-anolis-spec=dom>context object</span>'s list of
<li><p>Append <var>entry</var> to <span data-anolis-spec=dom>context object</span>'s list of
<span title=concept-FormData-entry>entries</span>.
</ol>

Expand Down Expand Up @@ -1972,25 +1995,17 @@ <h2>Interface <code title>FormData</code></h2>
method, when invoked, must run these steps:

<ol>
<li><p>If the <var>filename</var> argument is given, set <var>value</var> to a new
<code data-anolis-spec=fileapi>File</code> object whose contents are <var>value</var> and
<code data-anolis-spec=fileapi title=dom-File-name>name</code> is <var>filename</var>.
<!-- XXX at some point File API should get internal slots for this -->

<li><p>Let <var>entry</var> be a new <span title=concept-FormData-entry>entry</span>
whose <span title=concept-FormData-entry-name>name</span> is <var>name</var>, and
<span title=concept-FormData-entry-value>value</span> is <var>value</var>.
<li><p>Let <var>entry</var> be the result of <span title="create an entry">creating an entry</span>
with <var>name</var>, <var>value</var>, and <var>filename</var> if given.

<li><p>If there are any <span title=concept-FormData-entry>entries</span> in
<span data-anolis-spec=dom>context object</span>'s list of
<span title=concept-FormData-entry>entries</span> whose
<span title=concept-FormData-entry-name>name</span> is <var>name</var>, replace
the first such <span title=concept-FormData-entry>entry</span> with <var>entry</var> and
remove the others.
<span title=concept-FormData-entry-name>name</span> is <var>name</var>, then replace the first such
<span title=concept-FormData-entry>entry</span> with <var>entry</var> and remove the others.

<li><p>Otherwise, append <var>entry</var> to
<span data-anolis-spec=dom>context object</span>'s list of
<span title=concept-FormData-entry>entries</span>.
<li><p>Otherwise, append <var>entry</var> to <span data-anolis-spec=dom>context object</span>'s
list of <span title=concept-FormData-entry>entries</span>.
</ol>

<p>The <span data-anolis-spec=webidl>value pairs to iterate over</span> are the
Expand Down

0 comments on commit 1a75845

Please sign in to comment.