Skip to content

Commit

Permalink
[] (0) WF2: Define 'Submit as entity body', factor out some common pr…
Browse files Browse the repository at this point in the history
…ose to make it less redundant.

git-svn-id: http://svn.whatwg.org/webapps@2166 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Sep 12, 2008
1 parent 0ec99b7 commit b871954
Show file tree
Hide file tree
Showing 2 changed files with 156 additions and 26 deletions.
88 changes: 75 additions & 13 deletions index
Expand Up @@ -27808,18 +27808,8 @@ interface <dfn id=htmloptionelement>HTMLOptionElement</dfn> : <a href="#htmlelem
replaced by <var title="">query</var> (adding a U+003F QUESTION MARK
(?) character if appropriate).</p>

<p>If the user indicated a specific <a href="#browsing1">browsing
context</a> to use when submitting the form, then let <var
title="">target browsing context</var> be that <a
href="#browsing1">browsing context</a>.</p>

<p>Otherwise, apply <a href="#the-rules">the rules for choosing a
browsing context given a browsing context name</a> using <var
title="">target</var> as the name and the <a
href="#browsing1">browsing context</a> of <var title="">form</var> as
the context in which the algorithm is executed, and let <var
title="">target browsing context</var> be the resulting <a
href="#browsing1">browsing context</a>.</p>
<p>Let <var title="">target browsing context</var> be <a
href="#the-form0">the form submission target browsing context</a>.</p>

<p><a href="#navigate">Navigate</a> <var title="">target browsing
context</var> to <var title="">destination</var>. If <var
Expand All @@ -27830,7 +27820,20 @@ interface <dfn id=htmloptionelement>HTMLOptionElement</dfn> : <a href="#htmlelem
<dt><dfn id=submit title=submit-body>Submit as entity body</dfn>

<dd>
<p class=big-issue>...
<p>Let <var title="">entity body</var> be the resulting encoding the
<var title="">form data set</var> using the <a
href="#appropriate">appropriate form encoding algorithm</a>.</p>

<p>Let <var title="">target browsing context</var> be <a
href="#the-form0">the form submission target browsing context</a>.</p>

<p><a href="#navigate">Navigate</a> <var title="">target browsing
context</var> to <var title="">action</var> using the HTTP method
given by <var title="">method</var> and with <var title="">entity
body</var> as the entity body. If <var title="">target browsing
context</var> was newly created for this purpose by the steps above,
then it must be navigated with <a href="#replacement">replacement
enabled</a>.</p>

<dt><dfn id=delete title=submit-delete-action>Delete action</dfn>

Expand Down Expand Up @@ -27864,6 +27867,41 @@ interface <dfn id=htmloptionelement>HTMLOptionElement</dfn> : <a href="#htmlelem
<p class=big-issue>...
</dl>

<p><dfn id=the-form0>The form submission target browsing context</dfn> is
obtained, when needed by the behaviors described above, as follows: If
the user indicated a specific <a href="#browsing1">browsing context</a>
to use when submitting the form, then that is the target browsing
context. Otherwise, apply <a href="#the-rules">the rules for choosing a
browsing context given a browsing context name</a> using <var
title="">target</var> as the name and the <a href="#browsing1">browsing
context</a> of <var title="">form</var> as the context in which the
algorithm is executed; the resulting <a href="#browsing1">browsing
context</a> is the target browsing context.</p>

<p>The <dfn id=appropriate>appropriate form encoding algorithm</dfn> is
determined as follows:</p>

<dl>
<dt>If <var title="">enctype</var> is <code
title=attr-fs-enctype-urlencoded>application/x-www-form-urlencoded</code>

<dd>Use the <a href="#applicationx-www-form-urlencoded"><code
title="">application/x-www-form-urlencoded</code> encoding
algorithm</a>.

<dt>If <var title="">enctype</var> is <code
title=attr-fs-enctype-formdata>multpart/form-data</code>

<dd>Use the <a href="#multipartform-data"><code
title="">multipart/form-data</code> encoding algorithm</a>.

<dt>If <var title="">enctype</var> is <code
title=attr-fs-enctype-text>text/plain</code>

<dd>Use the <a href="#textplain"><code title="">text/plain</code>
encoding algorithm</a>.
</dl>

<li>
<p class=big-issue>...
</ol>
Expand All @@ -27881,6 +27919,30 @@ interface <dfn id=htmloptionelement>HTMLOptionElement</dfn> : <a href="#htmlelem
encoding. -->
</ol>

<p>The <dfn id=multipartform-data><code title="">multipart/form-data</code>
encoding algorithm</dfn> is as follows:

<ol>
<li>
<p class=big-issue>...
</li>
<!-- During this step, the form data set is examined to ensure all
the characters are representable in the submission character
encoding. -->
</ol>

<p>The <dfn id=textplain><code title="">text/plain</code> encoding
algorithm</dfn> is as follows:

<ol>
<li>
<p class=big-issue>...
</li>
<!-- During this step, the form data set is examined to ensure all
the characters are representable in the submission character
encoding. -->
</ol>

<h3 id=scripting1><span class=secno>4.10 </span>Scripting</h3>

<p>Scripts allow authors to add interactivity to their documents.
Expand Down
94 changes: 81 additions & 13 deletions source
Expand Up @@ -24926,18 +24926,8 @@ interface <dfn>HTMLOptionElement</dfn> : <span>HTMLElement</span> {
replaced by <var title="">query</var> (adding a U+003F QUESTION
MARK (?) character if appropriate).</p>

<p>If the user indicated a specific <span>browsing
context</span> to use when submitting the form, then let <var
title="">target browsing context</var> be that <span>browsing
context</span>.</p>

<p>Otherwise, apply <span>the rules for choosing a browsing
context given a browsing context name</span> using <var
title="">target</var> as the name and the <span>browsing
context</span> of <var title="">form</var> as the context in
which the algorithm is executed, and let <var title="">target
browsing context</var> be the resulting <span>browsing
context</span>.</p>
<p>Let <var title="">target browsing context</var> be <span>the
form submission target browsing context</span>.</p>

<p><span>Navigate</span> <var title="">target browsing
context</var> to <var title="">destination</var>. If <var
Expand All @@ -24948,7 +24938,24 @@ interface <dfn>HTMLOptionElement</dfn> : <span>HTMLElement</span> {
</dd>

<dt><dfn title="submit-body">Submit as entity body</dfn>
<dd><p class="big-issue">...</p></dd>
<dd>

<p>Let <var title="">entity body</var> be the resulting encoding
the <var title="">form data set</var> using the
<span>appropriate form encoding algorithm</span>.</p>

<p>Let <var title="">target browsing context</var> be <span>the
form submission target browsing context</span>.</p>

<p><span>Navigate</span> <var title="">target browsing
context</var> to <var title="">action</var> using the HTTP
method given by <var title="">method</var> and with <var
title="">entity body</var> as the entity body. If <var
title="">target browsing context</var> was newly created for
this purpose by the steps above, then it must be navigated with
<span>replacement enabled</span>.</p>

</dd>

<dt><dfn title="submit-delete-action">Delete action</dfn>
<dd><p class="big-issue">...</p></dd>
Expand All @@ -24970,6 +24977,41 @@ interface <dfn>HTMLOptionElement</dfn> : <span>HTMLElement</span> {

</dl>

<p><dfn>The form submission target browsing context</dfn> is
obtained, when needed by the behaviors described above, as
follows: If the user indicated a specific <span>browsing
context</span> to use when submitting the form, then that is the
target browsing context. Otherwise, apply <span>the rules for
choosing a browsing context given a browsing context name</span>
using <var title="">target</var> as the name and the
<span>browsing context</span> of <var title="">form</var> as the
context in which the algorithm is executed; the resulting
<span>browsing context</span> is the target browsing context.</p>

<p>The <dfn>appropriate form encoding algorithm</dfn> is
determined as follows:</p>

<dl>

<dt>If <var title="">enctype</var> is <code title="attr-fs-enctype-urlencoded">application/x-www-form-urlencoded</code></dt>

<dd>Use the <span><code
title="">application/x-www-form-urlencoded</code> encoding
algorithm</span>.</dd>

<dt>If <var title="">enctype</var> is <code title="attr-fs-enctype-formdata">multpart/form-data</code></dt>

<dd>Use the <span><code
title="">multipart/form-data</code> encoding
algorithm</span>.</dd>

<dt>If <var title="">enctype</var> is <code title="attr-fs-enctype-text">text/plain</code></dt>

<dd>Use the <span><code title="">text/plain</code> encoding
algorithm</span>.</dd>

</dl>

</li>

<li><p class="big-issue">...</p></li>
Expand All @@ -24990,6 +25032,32 @@ interface <dfn>HTMLOptionElement</dfn> : <span>HTMLElement</span> {

</ol>

<p>The <dfn><code title="">multipart/form-data</code> encoding
algorithm</dfn> is as follows:</p>

<ol>

<li><p class="big-issue">...</p></li>

<!-- During this step, the form data set is examined to ensure all
the characters are representable in the submission character
encoding. -->

</ol>

<p>The <dfn><code title="">text/plain</code> encoding
algorithm</dfn> is as follows:</p>

<ol>

<li><p class="big-issue">...</p></li>

<!-- During this step, the form data set is examined to ensure all
the characters are representable in the submission character
encoding. -->

</ol>




Expand Down

0 comments on commit b871954

Please sign in to comment.