[html5] r6450 - [] (0) Define how to parse the various form submission formats. Register the leg [...]

whatwg at whatwg.org whatwg at whatwg.org
Sun Aug 14 20:45:28 PDT 2011


Author: ianh
Date: 2011-08-14 20:45:26 -0700 (Sun, 14 Aug 2011)
New Revision: 6450

Modified:
   complete.html
   index
   source
Log:
[] (0) Define how to parse the various form submission formats. Register the legacy one. Some editorial tweaks for consistency.
Fixing http://www.w3.org/Bugs/Public/show_bug.cgi?id=12819

Modified: complete.html
===================================================================
--- complete.html	2011-08-14 19:11:52 UTC (rev 6449)
+++ complete.html	2011-08-15 03:45:26 UTC (rev 6450)
@@ -239,7 +239,7 @@
 
   <header class=head id=head><p><a class=logo href=http://www.whatwg.org/><img alt=WHATWG height=101 src=/images/logo width=101></a></p>
    <hgroup><h1>Web Applications 1.0</h1>
-    <h2 class="no-num no-toc">Living Standard — Last Updated 14 August 2011</h2>
+    <h2 class="no-num no-toc">Living Standard — Last Updated 15 August 2011</h2>
    </hgroup><dl><dt>Multiple-page version:</dt>
     <dd><a href=http://www.whatwg.org/specs/web-apps/current-work/complete/>http://www.whatwg.org/specs/web-apps/current-work/complete/</a></dd>
     <dt>One-page version:</dt>
@@ -1353,13 +1353,14 @@
    <li><a href=#text/html><span class=secno>17.1 </span><code>text/html</code></a></li>
    <li><a href=#text/html-sandboxed><span class=secno>17.2 </span><code>text/html-sandboxed</code></a></li>
    <li><a href=#application/xhtml+xml><span class=secno>17.3 </span><code>application/xhtml+xml</code></a></li>
-   <li><a href=#text/cache-manifest><span class=secno>17.4 </span><code>text/cache-manifest</code></a></li>
-   <li><a href=#text/ping><span class=secno>17.5 </span><code>text/ping</code></a></li>
-   <li><a href=#text/vtt><span class=secno>17.6 </span><code>text/vtt</code></a></li>
-   <li><a href=#application/microdata+json><span class=secno>17.7 </span><code>application/microdata+json</code></a></li>
-   <li><a href=#application/html-peer-connection-data><span class=secno>17.8 </span><code>application/html-peer-connection-data</code></a></li>
-   <li><a href=#ping-from><span class=secno>17.9 </span><code>Ping-From</code></a></li>
-   <li><a href=#ping-to><span class=secno>17.10 </span><code>Ping-To</code></a></ol></li>
+   <li><a href=#application/x-www-form-urlencoded><span class=secno>17.4 </span><code>application/x-www-form-urlencoded</code></a></li>
+   <li><a href=#text/cache-manifest><span class=secno>17.5 </span><code>text/cache-manifest</code></a></li>
+   <li><a href=#text/ping><span class=secno>17.6 </span><code>text/ping</code></a></li>
+   <li><a href=#text/vtt><span class=secno>17.7 </span><code>text/vtt</code></a></li>
+   <li><a href=#application/microdata+json><span class=secno>17.8 </span><code>application/microdata+json</code></a></li>
+   <li><a href=#application/html-peer-connection-data><span class=secno>17.9 </span><code>application/html-peer-connection-data</code></a></li>
+   <li><a href=#ping-from><span class=secno>17.10 </span><code>Ping-From</code></a></li>
+   <li><a href=#ping-to><span class=secno>17.11 </span><code>Ping-To</code></a></ol></li>
  <li><a class=no-num href=#index>Index</a>
   <ol>
    <li><a class=no-num href=#elements-1>Elements</a></li>
@@ -1871,7 +1872,7 @@
 
    <dd>This specification introduces a mechanism for adding
    machine-readable annotations to documents, so that tools can
-   extract trees of name/value pairs from the document. This section
+   extract trees of name-value pairs from the document. This section
    describes this mechanism<span class=impl> and some algorithms
    that can be used to convert HTML documents into other
    formats</span>.
@@ -4395,6 +4396,37 @@
   <p>The <dfn id=code-point-length>code-point length</dfn> of a string is the number of
   Unicode code points in that string.</p>
 
+  <div class=impl>
+
+  <p>When a user agent has to <dfn id=strictly-split-a-string>strictly split a string</dfn> on a
+  particular delimiter character <var title="">delimiter</var>, it
+  must use the following algorithm:</p>
+
+  <ol><li><p>Let <var title="">input</var> be the string being
+   parsed.</li>
+
+   <li><p>Let <var title="">position</var> be a pointer into <var title="">input</var>, initially pointing at the start of the
+   string.</li>
+
+   <li><p>Let <var title="">tokens</var> be a list of tokens,
+   initially empty.</li>
+
+   <li><p>While <var title="">position</var> is not past the end of
+   <var title="">input</var>:</p>
+
+    <ol><li><p><a href=#collect-a-sequence-of-characters>Collect a sequence of characters</a> that are not
+     the <var title="">delimiter</var> character.</li>
+
+     <li><p>Add the string collected in the previous step to <var title="">tokens</var>.</li>
+
+    </ol></li>
+
+   <li><p>Return <var title="">tokens</var>.</li>
+
+  </ol><p class=note>For the special cases of splitting a string <a href=#split-a-string-on-spaces title="split a string on spaces">on spaces</a> and <a href=#split-a-string-on-spaces title="split a string on spaces">on commas</a>, this algorithm
+  does not apply (those algorithms also perform <a href=#strip-leading-and-trailing-whitespace title="strip
+  leading and trailing whitespace">whitespace trimming</a>).</p>
+
   </div>
 
 
@@ -6473,7 +6505,7 @@
    U+002C COMMA characters (,). Let <var title="">s</var> be the resulting sequence (which might be the
    empty string).</li>
 
-   <li><p>Remove any leading or trailing sequence of <a href=#space-character title="space character">space characters</a> from <var title="">s</var>.</li>
+   <li><p><a href=#strip-leading-and-trailing-whitespace>Strip leading and trailing whitespace</a> from <var title="">s</var>.</li>
 
    <li><p>Add <var title="">s</var> to <var title="">tokens</var>.</li>
 
@@ -6609,8 +6641,7 @@
   <p>To <dfn id=parse-a-url>parse a URL</dfn> <var title="">url</var> into its
   component parts, the user agent must use the following steps:</p>
 
-  <ol><li><p>Strip leading and trailing <a href=#space-character title="space
-   character">space characters</a> from <var title="">url</var>.</li>
+  <ol><li><p><a href=#strip-leading-and-trailing-whitespace>Strip leading and trailing whitespace</a> from <var title="">url</var>.</li>
 
    <li>
 
@@ -9474,8 +9505,7 @@
 
    <li><p>Replace any sequence of one or more consecutive <a href=#space-character title="space character">space characters</a> in <var title="">value</var> with a single U+0020 SPACE character.</li>
 
-   <li><p>Remove any leading or trailing <a href=#space-character title="space
-   character">space characters</a> in <var title="">value</var>.</li>
+   <li><p><a href=#strip-leading-and-trailing-whitespace>Strip leading and trailing whitespace</a> from <var title="">value</var>.</li>
 
    <li><p>Return <var title="">value</var>.</li>
 
@@ -12686,8 +12716,8 @@
     SEMICOLON character (;), remove the first such character and all
     characters from it up to the end of the string.</p>
 
-    <p>Strip all leading and trailing <a href=#space-character title="space
-    character">space characters</a> from <var title="">type</var>.</p>
+    <li><p><a href=#strip-leading-and-trailing-whitespace>Strip leading and trailing whitespace</a> from
+    <var title="">type</var>.</p>
 
     <p>If <var title="">type</var> is <em>not</em> now an <a href=#ascii-case-insensitive>ASCII
     case-insensitive</a> match for the string
@@ -14129,14 +14159,14 @@
 
   <p>If a <code><a href=#the-meta-element>meta</a></code> element has a <dfn id=attr-meta-name title=attr-meta-name><code>name</code></dfn> attribute, it sets
   document metadata. Document metadata is expressed in terms of
-  name/value pairs, the <code title=attr-meta-name><a href=#attr-meta-name>name</a></code>
+  name-value pairs, the <code title=attr-meta-name><a href=#attr-meta-name>name</a></code>
   attribute on the <code><a href=#the-meta-element>meta</a></code> element giving the name, and the
   <code title=attr-meta-content><a href=#attr-meta-content>content</a></code> attribute on the same
   element giving the value. The name specifies what aspect of metadata
   is being set; valid names and the meaning of their values are
   described in the following sections. If a <code><a href=#the-meta-element>meta</a></code> element
   has no <code title=attr-meta-content><a href=#attr-meta-content>content</a></code> attribute,
-  then the value part of the metadata name/value pair is the empty
+  then the value part of the metadata name-value pair is the empty
   string.</p>
 
   <div class=impl>
@@ -15643,7 +15673,8 @@
     script block's type</a></var> for this <code><a href=#the-script-element>script</a></code> element be
     the value of that attribute with any leading or trailing sequences
     of <a href=#space-character title="space character">space characters</a>
-    removed.</p>
+    removed.</p> <!-- <span>Strip leading and trailing
+    whitespace</span> from... -->
 
     <p>Otherwise, the element has a non-empty <code title=attr-script-language><a href=#attr-script-language>language</a></code> attribute; let
     <var><a href="#the-script-block's-type">the script block's type</a></var> for this <code><a href=#the-script-element>script</a></code>
@@ -24534,7 +24565,7 @@
  http://trac.webkit.org/browser/trunk/WebCore/html/HTMLEmbedElement.cpp
  http://trac.webkit.org/browser/trunk/WebCore/rendering/RenderPartObject.cpp (updateWidget)
  e.g. - 240x200 default
-      - the attributes/params are sent in a name/value pair list as follows (for Gecko):
+      - the attributes/params are sent in a name-value pair list as follows (for Gecko):
          + attributes of the element, in source order
          + a synthesised 'src' attribute, if there was no 'src' but
            there was a 'data', with the value of the 'data' attribute
@@ -25126,7 +25157,9 @@
         <var title="">resource type</var> be that type and jump to the
         step below labeled <i>handler</i>.</p>
 
-        <!-- do we need to <span>strip leading and trailing whitespace</span> from anything here? collapse sequences of spaces? drop parameters? -->
+        <!-- do we need to <span>strip leading and trailing
+        whitespace</span> from anything here? collapse sequences of
+        spaces? drop parameters? -->
 
        </li>
 
@@ -25645,7 +25678,7 @@
   <p>If both attributes are present, and if the parent element of the
   <code><a href=#the-param-element>param</a></code> is an <code><a href=#the-object-element>object</a></code> element, then the
   element defines a <dfn id=concept-param-parameter title=concept-param-parameter>parameter</dfn> with the given
-  name/value pair.</p>
+  name-value pair.</p>
 
   <p>If either the name or value of a <a href=#concept-param-parameter title=concept-param-parameter>parameter</a> defined by a
   <code><a href=#the-param-element>param</a></code> element that is the child of an
@@ -52456,8 +52489,13 @@
    <li><p><i>End</i>: Return the <var title="">form data
    step</var>.</li>
 
-  </ol><h5 id=url-encoded-form-data><span class=secno>4.10.22.5 </span>URL-encoded form data</h5>
+  </ol></div>
 
+
+  <h5 id=url-encoded-form-data><span class=secno>4.10.22.5 </span>URL-encoded form data</h5>
+
+  <div class=impl>
+
   <p>The <dfn id=application/x-www-form-urlencoded-encoding-algorithm><code title="">application/x-www-form-urlencoded</code> encoding
   algorithm</dfn> is as follows:</p>
 
@@ -52588,10 +52626,103 @@
 
   </ol></div>
 
+  <p>To decode <code><a href=#application/x-www-form-urlencoded>application/x-www-form-urlencoded</a></code>
+  payloads, the following algorithm should be used. This algorithm
+  uses as inputs the payload itself, <var title="">payload</var>,
+  consisting of a Unicode string using only characters in the range
+  U+0000 to U+007F; a default character encoding <var title="">default
+  encoding</var>; and optionally an <var title="">isindex</var> flag
+  indicating that the payload is to be processed as if it had been
+  generated for a form containing an <code title=attr-fe-name-isindex><a href=#attr-fe-name-isindex>isindex</a></code> control. The output of
+  this algorithm is a sorted list of name-value pairs. If the <var title="">isindex</var> flag is set and the first control really ways
+  an <code title=attr-fe-name-isindex><a href=#attr-fe-name-isindex>isindex</a></code> control, then
+  the first name-value pair will have as its name the empty
+  string.</p>
 
+  <ol><li><p>Let <var title="">strings</var> be the result of <a href=#strictly-split-a-string title="strictly split a string">strictly splitting the
+   string</a> <var title="">payload</var> on U+0026 AMPERSAND
+   characters (&).</li>
 
-  <div class=impl>
+   <li><p>If the <var title="">isindex</var> flag is set and the first
+   string in <var title="">strings</var> does not contain a U+003D
+   EQUALS SIGN character (=), insert a U+003D EQUALS SIGN character
+   (=) at the start of the first string in <var title="">strings</var>.</li>
 
+   <li><p>Let <var title="">pairs</var> be an empty list of name-value
+   pairs.</li>
+
+   <li>
+
+    <p>For each string <var title="">string</var> in <var title="">strings</var>, run these substeps:</p>
+
+    <ol><li>
+
+      <p>If <var title="">string</var> contains a U+003D EQUALS SIGN
+      character (=), then let <var title="">name</var> be the
+      substring of <var title="">string</var> from the start of <var title="">string</var> up to but excluding its first U+003D
+      EQUALS SIGN character (=), and let <var title="">value</var> be
+      the substring from the first character, if any, after the first
+      U+003D EQUALS SIGN character (=) up to the end of <var title="">string</var>. If the first U+003D EQUALS SIGN character
+      (=) is the first character, then <var title="">name</var> will
+      be the empty string. If it is the last character, then <var title="">value</var> will be the empty string.</p>
+
+      <p>Otherwise, <var title="">string</var> contains no U+003D
+      EQUALS SIGN characters (=). Let <var title="">name</var> have
+      the value of <var title="">string</var> and let <var title="">value</var> be the empty string.</p>
+
+     </li>
+
+     <li>
+
+      <p>Replace any U+002B PLUS SIGN characters (+) in <var title="">name</var> and <var title="">value</var> with U+0020
+      SPACE characters.</p>
+
+     </li>
+
+     <li>
+
+      <p>Replace any escape in <var title="">name</var> and <var title="">value</var> with the character represented by the
+      escape. This replacement most not be recursive.</p>
+
+      <p>An escape is a U+0025 PERCENT SIGN character (%) followed by
+      two characters in the ranges U+0030 DIGIT ZERO (0) to U+0039
+      DIGIT NINE (9), U+0041 LATIN CAPITAL LETTER A to U+0046 LATIN
+      CAPITAL LETTER F, and U+0061 LATIN SMALL LETTER A to U+0066
+      LATIN SMALL LETTER F.</p>
+
+      <p>The character represented by an escape is the Unicode
+      character whose code point is equal to the value of the two
+      characters after the U+0025 PERCENT SIGN character (%),
+      interpreted as a hexadecimal number (in the range 0..255).</p>
+
+      <p class=example>So for instance the string "<code title="">A%2BC</code>" would become "<code title="">A+C</code>".
+      Similarly, the string "<code title="">100%25AA%21</code>"
+      becomes the string "<code title="">100%AA!</code>".</p>
+
+     </li>
+
+     <li><p>Convert the <var title="">name</var> and <var title="">value</var> strings to their byte representation in
+     US-ASCII (i.e. convert the Unicode string to a byte
+     string).</li>
+
+     <li><p>Add a pair consisting of <var title="">name</var> and <var title="">value</var> to <var title="">pairs</var>.</li>
+
+    </ol></li>
+
+   <li><p>If any of the name-value pairs in <var title="">pairs</var>
+   have a name component consisting of the string "<code title="">_charset_</code>" encoded in US-ASCII, and the value
+   component of the first such pair is the name of a supported
+   character encoding, then let <var title="">encoding</var> be that
+   character encoding.</li>
+
+   <li><p>Convert the name and value components of each name-value
+   pair in <var title="">pairs</var> to Unicode by interpreting the
+   bytes according to the encoding <var title="">encoding</var>.</li>
+
+   <li><p>Return <var title="">pairs</var>.</li>
+
+  </ol><div class=impl>
+
   <h5 id=multipart-form-data><span class=secno>4.10.22.6 </span>Multipart form data</h5>
 
   <!-- http://hixie.ch/tests/adhoc/html/forms/submission/multipart_form-data/ -->
@@ -52703,12 +52834,15 @@
 
   </ol></div>
 
+  <p>For details on how to interpret <code>multipart/form-data</code>
+  payloads, see RFC 2388. <a href=#refsRFC2388>[RFC2388]</a></p>
 
 
-  <div class=impl>
 
   <h5 id=plain-text-form-data><span class=secno>4.10.22.7 </span>Plain text form data</h5>
 
+  <div class=impl>
+
   <p>The <dfn id=text/plain-encoding-algorithm><code title="">text/plain</code> encoding
   algorithm</dfn> is as follows:</p>
 
@@ -52761,8 +52895,14 @@
 
   </ol></div>
 
+  <p>Payloads using the <code>text/plain</code> format are intended to
+  be human readable. They are not reliably interpretable by computer,
+  as the format is ambiguous (for example, there is no way to
+  distinguish a literal newline in a value from the newline at the end
+  of the value).</p>
 
 
+
   <div class=impl>
 
   <h4 id=resetting-a-form><span class=secno>4.10.23 </span>Resetting a form</h4>
@@ -97201,13 +97341,80 @@
   type</a>. <a href=#refsRFC3023>[RFC3023]</a></p>
 
 
-  <h3 id=text/cache-manifest><span class=secno>17.4 </span><dfn><code>text/cache-manifest</code></dfn></h3>
+  <h3 id=application/x-www-form-urlencoded><span class=secno>17.4 </span><dfn><code>application/x-www-form-urlencoded</code></dfn></h3>
 
   <p>This registration is for community review and will be submitted
   to the IESG for review, approval, and registration with IANA.</p>
 
   <!--
    To: ietf-types at iana.org
+   Subject: Registration of media type application/x-www-form-urlencoded
+  -->
+
+  <dl><dt>Type name:</dt>
+   <dd>application</dd>
+   <dt>Subtype name:</dt>
+   <dd>x-www-form-urlencoded</dd>
+   <dt>Required parameters:</dt>
+   <dd>No parameters</dd>
+   <dt>Optional parameters:</dt>
+   <dd>No parameters</dd>
+   <dt>Encoding considerations:</dt>
+   <dd>7bit US-ASCII encoding of octets that themselves can be encoding text using any <a href=#ascii-compatible-character-encoding>ASCII-compatible character encoding</a></dd>
+   <dt>Security considerations:</dt>
+   <dd>
+    <p>In isolation, an <code><a href=#application/x-www-form-urlencoded>application/x-www-form-urlencoded</a></code>
+    payload poses no security risks. However, as this type is usually
+    used as part of a form submission, all the risks that apply to
+    HTML forms need to be considered in the context of this type.</p>
+   </dd>
+   <dt>Interoperability considerations:</dt>
+   <dd>
+    Rules for generating and processing
+    <code><a href=#application/x-www-form-urlencoded>application/x-www-form-urlencoded</a></code> payloads are
+    defined in this specification.
+   </dd>
+   <dt>Published specification:</dt>
+   <dd>
+    This document is the relevant specification.
+   </dd>
+   <dt>Applications that use this media type:</dt>
+   <dd>
+    Web browsers and servers.
+   </dd>
+   <dt>Additional information:</dt>
+   <dd>
+    <dl><dt>Magic number(s):</dt>
+     <dd>There is no reliable mechanism for recognising <code><a href=#application/x-www-form-urlencoded>application/x-www-form-urlencoded</a></code> payloads.</dd>
+     <dt>File extension(s):</dt>
+     <dd>Not applicable.</dd>
+     <dt>Macintosh file type code(s):</dt>
+     <dd>Not applicable.</dd>
+    </dl></dd>
+   <dt>Person & email address to contact for further information:</dt>
+   <dd>Ian Hickson <ian at hixie.ch></dd>
+   <dt>Intended usage:</dt>
+   <dd>Common</dd>
+   <dt>Restrictions on usage:</dt>
+   <dd>This type is only intended to be used to describe HTML form
+   submission payloads.</dd>
+   <dt>Author:</dt>
+   <dd>Ian Hickson <ian at hixie.ch></dd>
+   <dt>Change controller:</dt>
+   <dd>W3C</dd>
+  </dl><p>Fragment identifiers have no meaning with the
+  <code><a href=#application/x-www-form-urlencoded>application/x-www-form-urlencoded</a></code> type as this type is
+  only used for uploaded payloads that do not have <a href=#url>URL</a>
+  identifiers.</p>
+
+
+  <h3 id=text/cache-manifest><span class=secno>17.5 </span><dfn><code>text/cache-manifest</code></dfn></h3>
+
+  <p>This registration is for community review and will be submitted
+  to the IESG for review, approval, and registration with IANA.</p>
+
+  <!--
+   To: ietf-types at iana.org
    Subject: Registration of media type text/cache-manifest
   -->
 
@@ -97272,7 +97479,7 @@
 
 
 <!--PING-->
-  <h3 id=text/ping><span class=secno>17.5 </span><dfn><code>text/ping</code></dfn></h3>
+  <h3 id=text/ping><span class=secno>17.6 </span><dfn><code>text/ping</code></dfn></h3>
 
   <p>This registration is for community review and will be submitted
   to the IESG for review, approval, and registration with IANA.</p>
@@ -97337,7 +97544,7 @@
 
 <!--TTVTT-->
 <div data-component="other Hixie drafts (editor: Ian Hickson)">
-  <h3 id=text/vtt><span class=secno>17.6 </span><dfn><code>text/vtt</code></dfn></h3>
+  <h3 id=text/vtt><span class=secno>17.7 </span><dfn><code>text/vtt</code></dfn></h3>
 
   <p>This registration is for community review and will be submitted
   to the IESG for review, approval, and registration with IANA.</p>
@@ -97418,7 +97625,7 @@
 
 <!--MD-->
 
-  <h3 id=application/microdata+json><span class=secno>17.7 </span><dfn><code>application/microdata+json</code></dfn></h3>
+  <h3 id=application/microdata+json><span class=secno>17.8 </span><dfn><code>application/microdata+json</code></dfn></h3>
 
 
   <p>This registration is for community review and will be submitted
@@ -97490,7 +97697,7 @@
 
 
 <!--PEERCONNECTION-->
-  <h3 id=application/html-peer-connection-data><span class=secno>17.8 </span><dfn><code>application/html-peer-connection-data</code></dfn></h3>
+  <h3 id=application/html-peer-connection-data><span class=secno>17.9 </span><dfn><code>application/html-peer-connection-data</code></dfn></h3>
 
   <p>This registration is for community review and will be submitted
   to the IESG for review, approval, and registration with IANA.</p>
@@ -97571,7 +97778,7 @@
 
 
 <!--PING-->
-  <h3 id=ping-from><span class=secno>17.9 </span><dfn title=http-ping-from><code>Ping-From</code></dfn></h3>
+  <h3 id=ping-from><span class=secno>17.10 </span><dfn title=http-ping-from><code>Ping-From</code></dfn></h3>
 
   <p>This section describes a header field for registration in the
   Permanent Message Header Field Registry.  <a href=#refsRFC3864>[RFC3864]</a></p>
@@ -97590,7 +97797,7 @@
    </dd>
    <dt>Related information</dt>
    <dd>None.</dd>
-  </dl><h3 id=ping-to><span class=secno>17.10 </span><dfn title=http-ping-to><code>Ping-To</code></dfn></h3>
+  </dl><h3 id=ping-to><span class=secno>17.11 </span><dfn title=http-ping-to><code>Ping-To</code></dfn></h3>
 
   <p>This section describes a header field for registration in the
   Permanent Message Header Field Registry.  <a href=#refsRFC3864>[RFC3864]</a></p>
@@ -102023,4 +102230,4 @@
           hand corner." src="sample-datetime-ui-3"></li>
 -->
 
- 
+ </div>

Modified: index
===================================================================
--- index	2011-08-14 19:11:52 UTC (rev 6449)
+++ index	2011-08-15 03:45:26 UTC (rev 6450)
@@ -243,7 +243,7 @@
 
   <header class=head id=head><p><a class=logo href=http://www.whatwg.org/><img alt=WHATWG height=101 src=/images/logo width=101></a></p>
    <hgroup><h1 class=allcaps>HTML</h1>
-    <h2 class="no-num no-toc">Living Standard — Last Updated 14 August 2011</h2>
+    <h2 class="no-num no-toc">Living Standard — Last Updated 15 August 2011</h2>
    </hgroup><dl><dt><strong>Web developer edition</strong></dt>
     <dd><strong><a href=http://developers.whatwg.org/>http://developers.whatwg.org/</a></strong></dd>
     <dt>Multiple-page version:</dt>
@@ -1266,13 +1266,14 @@
    <li><a href=#text/html><span class=secno>15.1 </span><code>text/html</code></a></li>
    <li><a href=#text/html-sandboxed><span class=secno>15.2 </span><code>text/html-sandboxed</code></a></li>
    <li><a href=#application/xhtml+xml><span class=secno>15.3 </span><code>application/xhtml+xml</code></a></li>
-   <li><a href=#text/cache-manifest><span class=secno>15.4 </span><code>text/cache-manifest</code></a></li>
-   <li><a href=#text/ping><span class=secno>15.5 </span><code>text/ping</code></a></li>
-   <li><a href=#text/vtt><span class=secno>15.6 </span><code>text/vtt</code></a></li>
-   <li><a href=#application/microdata+json><span class=secno>15.7 </span><code>application/microdata+json</code></a></li>
-   <li><a href=#application/html-peer-connection-data><span class=secno>15.8 </span><code>application/html-peer-connection-data</code></a></li>
-   <li><a href=#ping-from><span class=secno>15.9 </span><code>Ping-From</code></a></li>
-   <li><a href=#ping-to><span class=secno>15.10 </span><code>Ping-To</code></a></ol></li>
+   <li><a href=#application/x-www-form-urlencoded><span class=secno>15.4 </span><code>application/x-www-form-urlencoded</code></a></li>
+   <li><a href=#text/cache-manifest><span class=secno>15.5 </span><code>text/cache-manifest</code></a></li>
+   <li><a href=#text/ping><span class=secno>15.6 </span><code>text/ping</code></a></li>
+   <li><a href=#text/vtt><span class=secno>15.7 </span><code>text/vtt</code></a></li>
+   <li><a href=#application/microdata+json><span class=secno>15.8 </span><code>application/microdata+json</code></a></li>
+   <li><a href=#application/html-peer-connection-data><span class=secno>15.9 </span><code>application/html-peer-connection-data</code></a></li>
+   <li><a href=#ping-from><span class=secno>15.10 </span><code>Ping-From</code></a></li>
+   <li><a href=#ping-to><span class=secno>15.11 </span><code>Ping-To</code></a></ol></li>
  <li><a class=no-num href=#index>Index</a>
   <ol>
    <li><a class=no-num href=#elements-1>Elements</a></li>
@@ -1784,7 +1785,7 @@
 
    <dd>This specification introduces a mechanism for adding
    machine-readable annotations to documents, so that tools can
-   extract trees of name/value pairs from the document. This section
+   extract trees of name-value pairs from the document. This section
    describes this mechanism<span class=impl> and some algorithms
    that can be used to convert HTML documents into other
    formats</span>.
@@ -4259,6 +4260,37 @@
   <p>The <dfn id=code-point-length>code-point length</dfn> of a string is the number of
   Unicode code points in that string.</p>
 
+  <div class=impl>
+
+  <p>When a user agent has to <dfn id=strictly-split-a-string>strictly split a string</dfn> on a
+  particular delimiter character <var title="">delimiter</var>, it
+  must use the following algorithm:</p>
+
+  <ol><li><p>Let <var title="">input</var> be the string being
+   parsed.</li>
+
+   <li><p>Let <var title="">position</var> be a pointer into <var title="">input</var>, initially pointing at the start of the
+   string.</li>
+
+   <li><p>Let <var title="">tokens</var> be a list of tokens,
+   initially empty.</li>
+
+   <li><p>While <var title="">position</var> is not past the end of
+   <var title="">input</var>:</p>
+
+    <ol><li><p><a href=#collect-a-sequence-of-characters>Collect a sequence of characters</a> that are not
+     the <var title="">delimiter</var> character.</li>
+
+     <li><p>Add the string collected in the previous step to <var title="">tokens</var>.</li>
+
+    </ol></li>
+
+   <li><p>Return <var title="">tokens</var>.</li>
+
+  </ol><p class=note>For the special cases of splitting a string <a href=#split-a-string-on-spaces title="split a string on spaces">on spaces</a> and <a href=#split-a-string-on-spaces title="split a string on spaces">on commas</a>, this algorithm
+  does not apply (those algorithms also perform <a href=#strip-leading-and-trailing-whitespace title="strip
+  leading and trailing whitespace">whitespace trimming</a>).</p>
+
   </div>
 
 
@@ -6337,7 +6369,7 @@
    U+002C COMMA characters (,). Let <var title="">s</var> be the resulting sequence (which might be the
    empty string).</li>
 
-   <li><p>Remove any leading or trailing sequence of <a href=#space-character title="space character">space characters</a> from <var title="">s</var>.</li>
+   <li><p><a href=#strip-leading-and-trailing-whitespace>Strip leading and trailing whitespace</a> from <var title="">s</var>.</li>
 
    <li><p>Add <var title="">s</var> to <var title="">tokens</var>.</li>
 
@@ -6473,8 +6505,7 @@
   <p>To <dfn id=parse-a-url>parse a URL</dfn> <var title="">url</var> into its
   component parts, the user agent must use the following steps:</p>
 
-  <ol><li><p>Strip leading and trailing <a href=#space-character title="space
-   character">space characters</a> from <var title="">url</var>.</li>
+  <ol><li><p><a href=#strip-leading-and-trailing-whitespace>Strip leading and trailing whitespace</a> from <var title="">url</var>.</li>
 
    <li>
 
@@ -9338,8 +9369,7 @@
 
    <li><p>Replace any sequence of one or more consecutive <a href=#space-character title="space character">space characters</a> in <var title="">value</var> with a single U+0020 SPACE character.</li>
 
-   <li><p>Remove any leading or trailing <a href=#space-character title="space
-   character">space characters</a> in <var title="">value</var>.</li>
+   <li><p><a href=#strip-leading-and-trailing-whitespace>Strip leading and trailing whitespace</a> from <var title="">value</var>.</li>
 
    <li><p>Return <var title="">value</var>.</li>
 
@@ -12550,8 +12580,8 @@
     SEMICOLON character (;), remove the first such character and all
     characters from it up to the end of the string.</p>
 
-    <p>Strip all leading and trailing <a href=#space-character title="space
-    character">space characters</a> from <var title="">type</var>.</p>
+    <li><p><a href=#strip-leading-and-trailing-whitespace>Strip leading and trailing whitespace</a> from
+    <var title="">type</var>.</p>
 
     <p>If <var title="">type</var> is <em>not</em> now an <a href=#ascii-case-insensitive>ASCII
     case-insensitive</a> match for the string
@@ -13993,14 +14023,14 @@
 
   <p>If a <code><a href=#the-meta-element>meta</a></code> element has a <dfn id=attr-meta-name title=attr-meta-name><code>name</code></dfn> attribute, it sets
   document metadata. Document metadata is expressed in terms of
-  name/value pairs, the <code title=attr-meta-name><a href=#attr-meta-name>name</a></code>
+  name-value pairs, the <code title=attr-meta-name><a href=#attr-meta-name>name</a></code>
   attribute on the <code><a href=#the-meta-element>meta</a></code> element giving the name, and the
   <code title=attr-meta-content><a href=#attr-meta-content>content</a></code> attribute on the same
   element giving the value. The name specifies what aspect of metadata
   is being set; valid names and the meaning of their values are
   described in the following sections. If a <code><a href=#the-meta-element>meta</a></code> element
   has no <code title=attr-meta-content><a href=#attr-meta-content>content</a></code> attribute,
-  then the value part of the metadata name/value pair is the empty
+  then the value part of the metadata name-value pair is the empty
   string.</p>
 
   <div class=impl>
@@ -15507,7 +15537,8 @@
     script block's type</a></var> for this <code><a href=#the-script-element>script</a></code> element be
     the value of that attribute with any leading or trailing sequences
     of <a href=#space-character title="space character">space characters</a>
-    removed.</p>
+    removed.</p> <!-- <span>Strip leading and trailing
+    whitespace</span> from... -->
 
     <p>Otherwise, the element has a non-empty <code title=attr-script-language><a href=#attr-script-language>language</a></code> attribute; let
     <var><a href="#the-script-block's-type">the script block's type</a></var> for this <code><a href=#the-script-element>script</a></code>
@@ -24401,7 +24432,7 @@
  http://trac.webkit.org/browser/trunk/WebCore/html/HTMLEmbedElement.cpp
  http://trac.webkit.org/browser/trunk/WebCore/rendering/RenderPartObject.cpp (updateWidget)
  e.g. - 240x200 default
-      - the attributes/params are sent in a name/value pair list as follows (for Gecko):
+      - the attributes/params are sent in a name-value pair list as follows (for Gecko):
          + attributes of the element, in source order
          + a synthesised 'src' attribute, if there was no 'src' but
            there was a 'data', with the value of the 'data' attribute
@@ -24993,7 +25024,9 @@
         <var title="">resource type</var> be that type and jump to the
         step below labeled <i>handler</i>.</p>
 
-        <!-- do we need to <span>strip leading and trailing whitespace</span> from anything here? collapse sequences of spaces? drop parameters? -->
+        <!-- do we need to <span>strip leading and trailing
+        whitespace</span> from anything here? collapse sequences of
+        spaces? drop parameters? -->
 
        </li>
 
@@ -25512,7 +25545,7 @@
   <p>If both attributes are present, and if the parent element of the
   <code><a href=#the-param-element>param</a></code> is an <code><a href=#the-object-element>object</a></code> element, then the
   element defines a <dfn id=concept-param-parameter title=concept-param-parameter>parameter</dfn> with the given
-  name/value pair.</p>
+  name-value pair.</p>
 
   <p>If either the name or value of a <a href=#concept-param-parameter title=concept-param-parameter>parameter</a> defined by a
   <code><a href=#the-param-element>param</a></code> element that is the child of an
@@ -52323,8 +52356,13 @@
    <li><p><i>End</i>: Return the <var title="">form data
    step</var>.</li>
 
-  </ol><h5 id=url-encoded-form-data><span class=secno>4.10.22.5 </span>URL-encoded form data</h5>
+  </ol></div>
 
+
+  <h5 id=url-encoded-form-data><span class=secno>4.10.22.5 </span>URL-encoded form data</h5>
+
+  <div class=impl>
+
   <p>The <dfn id=application/x-www-form-urlencoded-encoding-algorithm><code title="">application/x-www-form-urlencoded</code> encoding
   algorithm</dfn> is as follows:</p>
 
@@ -52455,10 +52493,103 @@
 
   </ol></div>
 
+  <p>To decode <code><a href=#application/x-www-form-urlencoded>application/x-www-form-urlencoded</a></code>
+  payloads, the following algorithm should be used. This algorithm
+  uses as inputs the payload itself, <var title="">payload</var>,
+  consisting of a Unicode string using only characters in the range
+  U+0000 to U+007F; a default character encoding <var title="">default
+  encoding</var>; and optionally an <var title="">isindex</var> flag
+  indicating that the payload is to be processed as if it had been
+  generated for a form containing an <code title=attr-fe-name-isindex><a href=#attr-fe-name-isindex>isindex</a></code> control. The output of
+  this algorithm is a sorted list of name-value pairs. If the <var title="">isindex</var> flag is set and the first control really ways
+  an <code title=attr-fe-name-isindex><a href=#attr-fe-name-isindex>isindex</a></code> control, then
+  the first name-value pair will have as its name the empty
+  string.</p>
 
+  <ol><li><p>Let <var title="">strings</var> be the result of <a href=#strictly-split-a-string title="strictly split a string">strictly splitting the
+   string</a> <var title="">payload</var> on U+0026 AMPERSAND
+   characters (&).</li>
 
-  <div class=impl>
+   <li><p>If the <var title="">isindex</var> flag is set and the first
+   string in <var title="">strings</var> does not contain a U+003D
+   EQUALS SIGN character (=), insert a U+003D EQUALS SIGN character
+   (=) at the start of the first string in <var title="">strings</var>.</li>
 
+   <li><p>Let <var title="">pairs</var> be an empty list of name-value
+   pairs.</li>
+
+   <li>
+
+    <p>For each string <var title="">string</var> in <var title="">strings</var>, run these substeps:</p>
+
+    <ol><li>
+
+      <p>If <var title="">string</var> contains a U+003D EQUALS SIGN
+      character (=), then let <var title="">name</var> be the
+      substring of <var title="">string</var> from the start of <var title="">string</var> up to but excluding its first U+003D
+      EQUALS SIGN character (=), and let <var title="">value</var> be
+      the substring from the first character, if any, after the first
+      U+003D EQUALS SIGN character (=) up to the end of <var title="">string</var>. If the first U+003D EQUALS SIGN character
+      (=) is the first character, then <var title="">name</var> will
+      be the empty string. If it is the last character, then <var title="">value</var> will be the empty string.</p>
+
+      <p>Otherwise, <var title="">string</var> contains no U+003D
+      EQUALS SIGN characters (=). Let <var title="">name</var> have
+      the value of <var title="">string</var> and let <var title="">value</var> be the empty string.</p>
+
+     </li>
+
+     <li>
+
+      <p>Replace any U+002B PLUS SIGN characters (+) in <var title="">name</var> and <var title="">value</var> with U+0020
+      SPACE characters.</p>
+
+     </li>
+
+     <li>
+
+      <p>Replace any escape in <var title="">name</var> and <var title="">value</var> with the character represented by the
+      escape. This replacement most not be recursive.</p>
+
+      <p>An escape is a U+0025 PERCENT SIGN character (%) followed by
+      two characters in the ranges U+0030 DIGIT ZERO (0) to U+0039
+      DIGIT NINE (9), U+0041 LATIN CAPITAL LETTER A to U+0046 LATIN
+      CAPITAL LETTER F, and U+0061 LATIN SMALL LETTER A to U+0066
+      LATIN SMALL LETTER F.</p>
+
+      <p>The character represented by an escape is the Unicode
+      character whose code point is equal to the value of the two
+      characters after the U+0025 PERCENT SIGN character (%),
+      interpreted as a hexadecimal number (in the range 0..255).</p>
+
+      <p class=example>So for instance the string "<code title="">A%2BC</code>" would become "<code title="">A+C</code>".
+      Similarly, the string "<code title="">100%25AA%21</code>"
+      becomes the string "<code title="">100%AA!</code>".</p>
+
+     </li>
+
+     <li><p>Convert the <var title="">name</var> and <var title="">value</var> strings to their byte representation in
+     US-ASCII (i.e. convert the Unicode string to a byte
+     string).</li>
+
+     <li><p>Add a pair consisting of <var title="">name</var> and <var title="">value</var> to <var title="">pairs</var>.</li>
+
+    </ol></li>
+
+   <li><p>If any of the name-value pairs in <var title="">pairs</var>
+   have a name component consisting of the string "<code title="">_charset_</code>" encoded in US-ASCII, and the value
+   component of the first such pair is the name of a supported
+   character encoding, then let <var title="">encoding</var> be that
+   character encoding.</li>
+
+   <li><p>Convert the name and value components of each name-value
+   pair in <var title="">pairs</var> to Unicode by interpreting the
+   bytes according to the encoding <var title="">encoding</var>.</li>
+
+   <li><p>Return <var title="">pairs</var>.</li>
+
+  </ol><div class=impl>
+
   <h5 id=multipart-form-data><span class=secno>4.10.22.6 </span>Multipart form data</h5>
 
   <!-- http://hixie.ch/tests/adhoc/html/forms/submission/multipart_form-data/ -->
@@ -52570,12 +52701,15 @@
 
   </ol></div>
 
+  <p>For details on how to interpret <code>multipart/form-data</code>
+  payloads, see RFC 2388. <a href=#refsRFC2388>[RFC2388]</a></p>
 
 
-  <div class=impl>
 
   <h5 id=plain-text-form-data><span class=secno>4.10.22.7 </span>Plain text form data</h5>
 
+  <div class=impl>
+
   <p>The <dfn id=text/plain-encoding-algorithm><code title="">text/plain</code> encoding
   algorithm</dfn> is as follows:</p>
 
@@ -52628,8 +52762,14 @@
 
   </ol></div>
 
+  <p>Payloads using the <code>text/plain</code> format are intended to
+  be human readable. They are not reliably interpretable by computer,
+  as the format is ambiguous (for example, there is no way to
+  distinguish a literal newline in a value from the newline at the end
+  of the value).</p>
 
 
+
   <div class=impl>
 
   <h4 id=resetting-a-form><span class=secno>4.10.23 </span>Resetting a form</h4>
@@ -92648,13 +92788,80 @@
   type</a>. <a href=#refsRFC3023>[RFC3023]</a></p>
 
 
-  <h3 id=text/cache-manifest><span class=secno>15.4 </span><dfn><code>text/cache-manifest</code></dfn></h3>
+  <h3 id=application/x-www-form-urlencoded><span class=secno>15.4 </span><dfn><code>application/x-www-form-urlencoded</code></dfn></h3>
 
   <p>This registration is for community review and will be submitted
   to the IESG for review, approval, and registration with IANA.</p>
 
   <!--
    To: ietf-types at iana.org
+   Subject: Registration of media type application/x-www-form-urlencoded
+  -->
+
+  <dl><dt>Type name:</dt>
+   <dd>application</dd>
+   <dt>Subtype name:</dt>
+   <dd>x-www-form-urlencoded</dd>
+   <dt>Required parameters:</dt>
+   <dd>No parameters</dd>
+   <dt>Optional parameters:</dt>
+   <dd>No parameters</dd>
+   <dt>Encoding considerations:</dt>
+   <dd>7bit US-ASCII encoding of octets that themselves can be encoding text using any <a href=#ascii-compatible-character-encoding>ASCII-compatible character encoding</a></dd>
+   <dt>Security considerations:</dt>
+   <dd>
+    <p>In isolation, an <code><a href=#application/x-www-form-urlencoded>application/x-www-form-urlencoded</a></code>
+    payload poses no security risks. However, as this type is usually
+    used as part of a form submission, all the risks that apply to
+    HTML forms need to be considered in the context of this type.</p>
+   </dd>
+   <dt>Interoperability considerations:</dt>
+   <dd>
+    Rules for generating and processing
+    <code><a href=#application/x-www-form-urlencoded>application/x-www-form-urlencoded</a></code> payloads are
+    defined in this specification.
+   </dd>
+   <dt>Published specification:</dt>
+   <dd>
+    This document is the relevant specification.
+   </dd>
+   <dt>Applications that use this media type:</dt>
+   <dd>
+    Web browsers and servers.
+   </dd>
+   <dt>Additional information:</dt>
+   <dd>
+    <dl><dt>Magic number(s):</dt>
+     <dd>There is no reliable mechanism for recognising <code><a href=#application/x-www-form-urlencoded>application/x-www-form-urlencoded</a></code> payloads.</dd>
+     <dt>File extension(s):</dt>
+     <dd>Not applicable.</dd>
+     <dt>Macintosh file type code(s):</dt>
+     <dd>Not applicable.</dd>
+    </dl></dd>
+   <dt>Person & email address to contact for further information:</dt>
+   <dd>Ian Hickson <ian at hixie.ch></dd>
+   <dt>Intended usage:</dt>
+   <dd>Common</dd>
+   <dt>Restrictions on usage:</dt>
+   <dd>This type is only intended to be used to describe HTML form
+   submission payloads.</dd>
+   <dt>Author:</dt>
+   <dd>Ian Hickson <ian at hixie.ch></dd>
+   <dt>Change controller:</dt>
+   <dd>W3C</dd>
+  </dl><p>Fragment identifiers have no meaning with the
+  <code><a href=#application/x-www-form-urlencoded>application/x-www-form-urlencoded</a></code> type as this type is
+  only used for uploaded payloads that do not have <a href=#url>URL</a>
+  identifiers.</p>
+
+
+  <h3 id=text/cache-manifest><span class=secno>15.5 </span><dfn><code>text/cache-manifest</code></dfn></h3>
+
+  <p>This registration is for community review and will be submitted
+  to the IESG for review, approval, and registration with IANA.</p>
+
+  <!--
+   To: ietf-types at iana.org
    Subject: Registration of media type text/cache-manifest
   -->
 
@@ -92719,7 +92926,7 @@
 
 
 <!--PING-->
-  <h3 id=text/ping><span class=secno>15.5 </span><dfn><code>text/ping</code></dfn></h3>
+  <h3 id=text/ping><span class=secno>15.6 </span><dfn><code>text/ping</code></dfn></h3>
 
   <p>This registration is for community review and will be submitted
   to the IESG for review, approval, and registration with IANA.</p>
@@ -92784,7 +92991,7 @@
 
 <!--TTVTT-->
 <div data-component="other Hixie drafts (editor: Ian Hickson)">
-  <h3 id=text/vtt><span class=secno>15.6 </span><dfn><code>text/vtt</code></dfn></h3>
+  <h3 id=text/vtt><span class=secno>15.7 </span><dfn><code>text/vtt</code></dfn></h3>
 
   <p>This registration is for community review and will be submitted
   to the IESG for review, approval, and registration with IANA.</p>
@@ -92865,7 +93072,7 @@
 
 <!--MD-->
 
-  <h3 id=application/microdata+json><span class=secno>15.7 </span><dfn><code>application/microdata+json</code></dfn></h3>
+  <h3 id=application/microdata+json><span class=secno>15.8 </span><dfn><code>application/microdata+json</code></dfn></h3>
 
 
   <p>This registration is for community review and will be submitted
@@ -92937,7 +93144,7 @@
 
 
 <!--PEERCONNECTION-->
-  <h3 id=application/html-peer-connection-data><span class=secno>15.8 </span><dfn><code>application/html-peer-connection-data</code></dfn></h3>
+  <h3 id=application/html-peer-connection-data><span class=secno>15.9 </span><dfn><code>application/html-peer-connection-data</code></dfn></h3>
 
   <p>This registration is for community review and will be submitted
   to the IESG for review, approval, and registration with IANA.</p>
@@ -93018,7 +93225,7 @@
 
 
 <!--PING-->
-  <h3 id=ping-from><span class=secno>15.9 </span><dfn title=http-ping-from><code>Ping-From</code></dfn></h3>
+  <h3 id=ping-from><span class=secno>15.10 </span><dfn title=http-ping-from><code>Ping-From</code></dfn></h3>
 
   <p>This section describes a header field for registration in the
   Permanent Message Header Field Registry.  <a href=#refsRFC3864>[RFC3864]</a></p>
@@ -93037,7 +93244,7 @@
    </dd>
    <dt>Related information</dt>
    <dd>None.</dd>
-  </dl><h3 id=ping-to><span class=secno>15.10 </span><dfn title=http-ping-to><code>Ping-To</code></dfn></h3>
+  </dl><h3 id=ping-to><span class=secno>15.11 </span><dfn title=http-ping-to><code>Ping-To</code></dfn></h3>
 
   <p>This section describes a header field for registration in the
   Permanent Message Header Field Registry.  <a href=#refsRFC3864>[RFC3864]</a></p>
@@ -97618,4 +97825,4 @@
           hand corner." src="sample-datetime-ui-3"></li>
 -->
 
- 
+ </div>

Modified: source
===================================================================
--- source	2011-08-14 19:11:52 UTC (rev 6449)
+++ source	2011-08-15 03:45:26 UTC (rev 6450)
@@ -631,7 +631,7 @@
 
    <dd>This specification introduces a mechanism for adding
    machine-readable annotations to documents, so that tools can
-   extract trees of name/value pairs from the document. This section
+   extract trees of name-value pairs from the document. This section
    describes this mechanism<span class="impl"> and some algorithms
    that can be used to convert HTML documents into other
    formats</span>.
@@ -3438,6 +3438,49 @@
   <p>The <dfn>code-point length</dfn> of a string is the number of
   Unicode code points in that string.</p>
 
+  <div class="impl">
+
+  <p>When a user agent has to <dfn>strictly split a string</dfn> on a
+  particular delimiter character <var title="">delimiter</var>, it
+  must use the following algorithm:</p>
+
+  <ol>
+
+   <li><p>Let <var title="">input</var> be the string being
+   parsed.</p></li>
+
+   <li><p>Let <var title="">position</var> be a pointer into <var
+   title="">input</var>, initially pointing at the start of the
+   string.</p></li>
+
+   <li><p>Let <var title="">tokens</var> be a list of tokens,
+   initially empty.</p></li>
+
+   <li><p>While <var title="">position</var> is not past the end of
+   <var title="">input</var>:</p>
+
+    <ol>
+
+     <li><p><span>Collect a sequence of characters</span> that are not
+     the <var title="">delimiter</var> character.</p></li>
+
+     <li><p>Add the string collected in the previous step to <var
+     title="">tokens</var>.</p></li>
+
+    </ol>
+
+   </li>
+
+   <li><p>Return <var title="">tokens</var>.</p></li>
+
+  </ol>
+
+  <p class="note">For the special cases of splitting a string <span
+  title="split a string on spaces">on spaces</span> and <span
+  title="split a string on spaces">on commas</span>, this algorithm
+  does not apply (those algorithms also perform <span title="strip
+  leading and trailing whitespace">whitespace trimming</span>).</p>
+
   </div>
 
 
@@ -6026,8 +6069,7 @@
    title="">s</var> be the resulting sequence (which might be the
    empty string).</p></li>
 
-   <li><p>Remove any leading or trailing sequence of <span
-   title="space character">space characters</span> from <var
+   <li><p><span>Strip leading and trailing whitespace</span> from <var
    title="">s</var>.</p></li>
 
    <li><p>Add <var title="">s</var> to <var
@@ -6190,8 +6232,7 @@
 
   <ol>
 
-   <li><p>Strip leading and trailing <span title="space
-   character">space characters</span> from <var
+   <li><p><span>Strip leading and trailing whitespace</span> from <var
    title="">url</var>.</p></li>
 
    <li>
@@ -9522,8 +9563,7 @@
    title="space character">space characters</span> in <var
    title="">value</var> with a single U+0020 SPACE character.</p></li>
 
-   <li><p>Remove any leading or trailing <span title="space
-   character">space characters</span> in <var
+   <li><p><span>Strip leading and trailing whitespace</span> from <var
    title="">value</var>.</p></li>
 
    <li><p>Return <var title="">value</var>.</p></li>
@@ -13204,9 +13244,8 @@
     SEMICOLON character (;), remove the first such character and all
     characters from it up to the end of the string.</p>
 
-    <p>Strip all leading and trailing <span title="space
-    character">space characters</span> from <var
-    title="">type</var>.</p>
+    <li><p><span>Strip leading and trailing whitespace</span> from
+    <var title="">type</var>.</p>
 
     <p>If <var title="">type</var> is <em>not</em> now an <span>ASCII
     case-insensitive</span> match for the string
@@ -14871,14 +14910,14 @@
   <p>If a <code>meta</code> element has a <dfn
   title="attr-meta-name"><code>name</code></dfn> attribute, it sets
   document metadata. Document metadata is expressed in terms of
-  name/value pairs, the <code title="attr-meta-name">name</code>
+  name-value pairs, the <code title="attr-meta-name">name</code>
   attribute on the <code>meta</code> element giving the name, and the
   <code title="attr-meta-content">content</code> attribute on the same
   element giving the value. The name specifies what aspect of metadata
   is being set; valid names and the meaning of their values are
   described in the following sections. If a <code>meta</code> element
   has no <code title="attr-meta-content">content</code> attribute,
-  then the value part of the metadata name/value pair is the empty
+  then the value part of the metadata name-value pair is the empty
   string.</p>
 
   <div class="impl">
@@ -16604,7 +16643,8 @@
     script block's type</var> for this <code>script</code> element be
     the value of that attribute with any leading or trailing sequences
     of <span title="space character">space characters</span>
-    removed.</p>
+    removed.</p> <!-- <span>Strip leading and trailing
+    whitespace</span> from... -->
 
     <p>Otherwise, the element has a non-empty <code
     title="attr-script-language">language</code> attribute; let
@@ -26305,7 +26345,7 @@
  http://trac.webkit.org/browser/trunk/WebCore/html/HTMLEmbedElement.cpp
  http://trac.webkit.org/browser/trunk/WebCore/rendering/RenderPartObject.cpp (updateWidget)
  e.g. - 240x200 default
-      - the attributes/params are sent in a name/value pair list as follows (for Gecko):
+      - the attributes/params are sent in a name-value pair list as follows (for Gecko):
          + attributes of the element, in source order
          + a synthesised 'src' attribute, if there was no 'src' but
            there was a 'data', with the value of the 'data' attribute
@@ -26970,7 +27010,9 @@
         <var title="">resource type</var> be that type and jump to the
         step below labeled <i>handler</i>.</p>
 
-        <!-- do we need to <span>strip leading and trailing whitespace</span> from anything here? collapse sequences of spaces? drop parameters? -->
+        <!-- do we need to <span>strip leading and trailing
+        whitespace</span> from anything here? collapse sequences of
+        spaces? drop parameters? -->
 
        </li>
 
@@ -27556,7 +27598,7 @@
   <code>param</code> is an <code>object</code> element, then the
   element defines a <dfn
   title="concept-param-parameter">parameter</dfn> with the given
-  name/value pair.</p>
+  name-value pair.</p>
 
   <p>If either the name or value of a <span
   title="concept-param-parameter">parameter</span> defined by a
@@ -59006,9 +59048,13 @@
 
   </ol>
 
+  </div>
 
+
   <h5>URL-encoded form data</h5>
 
+  <div class="impl">
+
   <p>The <dfn><code
   title="">application/x-www-form-urlencoded</code> encoding
   algorithm</dfn> is as follows:</p>
@@ -59169,8 +59215,127 @@
 
   </div>
 
+  <p>To decode <code>application/x-www-form-urlencoded</code>
+  payloads, the following algorithm should be used. This algorithm
+  uses as inputs the payload itself, <var title="">payload</var>,
+  consisting of a Unicode string using only characters in the range
+  U+0000 to U+007F; a default character encoding <var title="">default
+  encoding</var>; and optionally an <var title="">isindex</var> flag
+  indicating that the payload is to be processed as if it had been
+  generated for a form containing an <code
+  title="attr-fe-name-isindex">isindex</code> control. The output of
+  this algorithm is a sorted list of name-value pairs. If the <var
+  title="">isindex</var> flag is set and the first control really ways
+  an <code title="attr-fe-name-isindex">isindex</code> control, then
+  the first name-value pair will have as its name the empty
+  string.</p>
 
+  <ol>
 
+   <li><p>Let <var title="">strings</var> be the result of <span
+   title="strictly split a string">strictly splitting the
+   string</span> <var title="">payload</var> on U+0026 AMPERSAND
+   characters (&).</p></li>
+
+   <li><p>If the <var title="">isindex</var> flag is set and the first
+   string in <var title="">strings</var> does not contain a U+003D
+   EQUALS SIGN character (=), insert a U+003D EQUALS SIGN character
+   (=) at the start of the first string in <var
+   title="">strings</var>.</p></li>
+
+   <li><p>Let <var title="">pairs</var> be an empty list of name-value
+   pairs.</p></li>
+
+   <li>
+
+    <p>For each string <var title="">string</var> in <var
+    title="">strings</var>, run these substeps:</p>
+
+    <ol>
+
+     <li>
+
+      <p>If <var title="">string</var> contains a U+003D EQUALS SIGN
+      character (=), then let <var title="">name</var> be the
+      substring of <var title="">string</var> from the start of <var
+      title="">string</var> up to but excluding its first U+003D
+      EQUALS SIGN character (=), and let <var title="">value</var> be
+      the substring from the first character, if any, after the first
+      U+003D EQUALS SIGN character (=) up to the end of <var
+      title="">string</var>. If the first U+003D EQUALS SIGN character
+      (=) is the first character, then <var title="">name</var> will
+      be the empty string. If it is the last character, then <var
+      title="">value</var> will be the empty string.</p>
+
+      <p>Otherwise, <var title="">string</var> contains no U+003D
+      EQUALS SIGN characters (=). Let <var title="">name</var> have
+      the value of <var title="">string</var> and let <var
+      title="">value</var> be the empty string.</p>
+
+     </li>
+
+     <li>
+
+      <p>Replace any U+002B PLUS SIGN characters (+) in <var
+      title="">name</var> and <var title="">value</var> with U+0020
+      SPACE characters.</p>
+
+     </li>
+
+     <li>
+
+      <p>Replace any escape in <var title="">name</var> and <var
+      title="">value</var> with the character represented by the
+      escape. This replacement most not be recursive.</p>
+
+      <p>An escape is a U+0025 PERCENT SIGN character (%) followed by
+      two characters in the ranges U+0030 DIGIT ZERO (0) to U+0039
+      DIGIT NINE (9), U+0041 LATIN CAPITAL LETTER A to U+0046 LATIN
+      CAPITAL LETTER F, and U+0061 LATIN SMALL LETTER A to U+0066
+      LATIN SMALL LETTER F.</p>
+
+      <p>The character represented by an escape is the Unicode
+      character whose code point is equal to the value of the two
+      characters after the U+0025 PERCENT SIGN character (%),
+      interpreted as a hexadecimal number (in the range 0..255).</p>
+
+      <p class="example">So for instance the string "<code
+      title="">A%2BC</code>" would become "<code title="">A+C</code>".
+      Similarly, the string "<code title="">100%25AA%21</code>"
+      becomes the string "<code title="">100%AA!</code>".</p>
+
+     </li>
+
+     <li><p>Convert the <var title="">name</var> and <var
+     title="">value</var> strings to their byte representation in
+     US-ASCII (i.e. convert the Unicode string to a byte
+     string).</p></li>
+
+     <li><p>Add a pair consisting of <var title="">name</var> and <var
+     title="">value</var> to <var title="">pairs</var>.</p></li>
+
+    </ol>
+
+   </li>
+
+   <li><p>If any of the name-value pairs in <var title="">pairs</var>
+   have a name component consisting of the string "<code
+   title="">_charset_</code>" encoded in US-ASCII, and the value
+   component of the first such pair is the name of a supported
+   character encoding, then let <var title="">encoding</var> be that
+   character encoding.</p></li>
+
+   <li><p>Convert the name and value components of each name-value
+   pair in <var title="">pairs</var> to Unicode by interpreting the
+   bytes according to the encoding <var
+   title="">encoding</var>.</p></li>
+
+   <li><p>Return <var title="">pairs</var>.</p></li>
+
+  </ol>
+
+
+
   <div class="impl">
 
   <h5>Multipart form data</h5>
@@ -59304,12 +59469,15 @@
 
   </div>
 
+  <p>For details on how to interpret <code>multipart/form-data</code>
+  payloads, see RFC 2388. <a href="#refsRFC2388">[RFC2388]</a></p>
 
 
-  <div class="impl">
 
   <h5>Plain text form data</h5>
 
+  <div class="impl">
+
   <p>The <dfn><code title="">text/plain</code> encoding
   algorithm</dfn> is as follows:</p>
 
@@ -59378,8 +59546,14 @@
 
   </div>
 
+  <p>Payloads using the <code>text/plain</code> format are intended to
+  be human readable. They are not reliably interpretable by computer,
+  as the format is ambiguous (for example, there is no way to
+  distinguish a literal newline in a value from the newline at the end
+  of the value).</p>
 
 
+
   <div class="impl">
 
   <h4>Resetting a form</h4>
@@ -110253,6 +110427,78 @@
   type</span>. <a href="#refsRFC3023">[RFC3023]</a></p>
 
 
+  <h3><dfn><code>application/x-www-form-urlencoded</code></dfn></h3>
+
+  <p>This registration is for community review and will be submitted
+  to the IESG for review, approval, and registration with IANA.</p>
+
+  <!--
+   To: ietf-types at iana.org
+   Subject: Registration of media type application/x-www-form-urlencoded
+  -->
+
+  <dl>
+   <dt>Type name:</dt>
+   <dd>application</dd>
+   <dt>Subtype name:</dt>
+   <dd>x-www-form-urlencoded</dd>
+   <dt>Required parameters:</dt>
+   <dd>No parameters</dd>
+   <dt>Optional parameters:</dt>
+   <dd>No parameters</dd>
+   <dt>Encoding considerations:</dt>
+   <dd>7bit US-ASCII encoding of octets that themselves can be encoding text using any <span>ASCII-compatible character encoding</span></dd>
+   <dt>Security considerations:</dt>
+   <dd>
+    <p>In isolation, an <code>application/x-www-form-urlencoded</code>
+    payload poses no security risks. However, as this type is usually
+    used as part of a form submission, all the risks that apply to
+    HTML forms need to be considered in the context of this type.</p>
+   </dd>
+   <dt>Interoperability considerations:</dt>
+   <dd>
+    Rules for generating and processing
+    <code>application/x-www-form-urlencoded</code> payloads are
+    defined in this specification.
+   </dd>
+   <dt>Published specification:</dt>
+   <dd>
+    This document is the relevant specification.
+   </dd>
+   <dt>Applications that use this media type:</dt>
+   <dd>
+    Web browsers and servers.
+   </dd>
+   <dt>Additional information:</dt>
+   <dd>
+    <dl>
+     <dt>Magic number(s):</dt>
+     <dd>There is no reliable mechanism for recognising <code>application/x-www-form-urlencoded</code> payloads.</dd>
+     <dt>File extension(s):</dt>
+     <dd>Not applicable.</dd>
+     <dt>Macintosh file type code(s):</dt>
+     <dd>Not applicable.</dd>
+    </dl>
+   </dd>
+   <dt>Person & email address to contact for further information:</dt>
+   <dd>Ian Hickson <ian at hixie.ch></dd>
+   <dt>Intended usage:</dt>
+   <dd>Common</dd>
+   <dt>Restrictions on usage:</dt>
+   <dd>This type is only intended to be used to describe HTML form
+   submission payloads.</dd>
+   <dt>Author:</dt>
+   <dd>Ian Hickson <ian at hixie.ch></dd>
+   <dt>Change controller:</dt>
+   <dd>W3C</dd>
+  </dl>
+
+  <p>Fragment identifiers have no meaning with the
+  <code>application/x-www-form-urlencoded</code> type as this type is
+  only used for uploaded payloads that do not have <span>URL</span>
+  identifiers.</p>
+
+
   <h3><dfn><code>text/cache-manifest</code></dfn></h3>
 
   <p>This registration is for community review and will be submitted




More information about the Commit-Watchers mailing list