[html5] r2379 - [giow] (2) Define 'button' and 'default button' and define implicit form submission.

whatwg at whatwg.org whatwg at whatwg.org
Wed Oct 29 01:46:27 PDT 2008


Author: ianh
Date: 2008-10-29 01:46:26 -0700 (Wed, 29 Oct 2008)
New Revision: 2379

Modified:
   index
   source
Log:
[giow] (2) Define 'button' and 'default button' and define implicit form submission.

Modified: index
===================================================================
--- index	2008-10-29 08:22:56 UTC (rev 2378)
+++ index	2008-10-29 08:46:26 UTC (rev 2379)
@@ -559,9 +559,11 @@
        <li><a href=#security-0><span class=secno>4.10.14.4 </span>Security</a></ol></li>
      <li><a href=#form-submission-0><span class=secno>4.10.15 </span>Form submission</a>
       <ol>
-       <li><a href=#url-encoded-form-data><span class=secno>4.10.15.1 </span>URL-encoded form data</a></li>
-       <li><a href=#multipart-form-data><span class=secno>4.10.15.2 </span>Multipart form data</a></li>
-       <li><a href=#plain-text-form-data><span class=secno>4.10.15.3 </span>Plain text form data</a></ol></li>
+       <li><a href=#implicit-submission><span class=secno>4.10.15.1 </span>Implicit submission</a></li>
+       <li><a href=#form-submission-algorithm><span class=secno>4.10.15.2 </span>Form submission algorithm</a></li>
+       <li><a href=#url-encoded-form-data><span class=secno>4.10.15.3 </span>URL-encoded form data</a></li>
+       <li><a href=#multipart-form-data><span class=secno>4.10.15.4 </span>Multipart form data</a></li>
+       <li><a href=#plain-text-form-data><span class=secno>4.10.15.5 </span>Plain text form data</a></ol></li>
      <li><a href=#resetting-a-form><span class=secno>4.10.16 </span>Resetting a form</a></li>
      <li><a href=#event-dispatch><span class=secno>4.10.17 </span>Event dispatch</a></ol></li>
    <li><a href=#interactive-elements><span class=secno>4.11 </span>Interactive elements</a>
@@ -22721,9 +22723,9 @@
    <dd>Denotes elements that can be associated with <code><a href=#the-label-element>label</a></code>
    elements.</dd>
 
-  </dl><p>In addition, some <a href=#category-submit title=category-submit>submittable</a> can be, depending on
-  their attributes, <dfn id=concept-button title=concept-button>buttons</dfn>. The
-  prose below defines when an element is a button.</p>
+  </dl><p>In addition, some <a href=#category-submit title=category-submit>submittable
+  elements</a> can be, depending on their attributes, <dfn id=concept-button title=concept-button>buttons</dfn>. The prose below defines when
+  an element is a button. Some buttons are specifically <dfn id=concept-submit-button title=concept-submit-button>submit buttons</dfn>.</p>
 
 
   <h4 id=the-form-element><span class=secno>4.10.1 </span>The <dfn><code>form</code></dfn> element</h4>
@@ -25526,7 +25528,10 @@
   <p>The <code><a href=#the-input-element>input</a></code> element represents a button that, when
   activated, submits the form. If the element has a <code title=attr-input-value><a href=#attr-input-value>value</a></code> attribute, the button's label
   must be the value of that attribute; otherwise, it must be an
-  implementation-defined string that means "Submit" or some such.</p>
+  implementation-defined string that means "Submit" or some such. The
+  element is a <a href=#concept-button title=concept-button>button</a>,
+  specifically a <a href=#concept-submit-button title=concept-submit-button>submit
+  button</a>.</p>
 
   <p>If the element is <i title=concept-input-mutable><a href=#concept-input-mutable>mutable</a></i>,
   the user agent should allow the user to activate the element.</p>
@@ -25590,7 +25595,10 @@
 
   <p>The <code><a href=#the-input-element>input</a></code> element represents either an image from
   which a user can select a coordinate and submit the form, or
-  alternatively a button from which the user can submit the form.</p>
+  alternatively a button from which the user can submit the form. The
+  element is a <a href=#concept-button title=concept-button>button</a>,
+  specifically a <a href=#concept-submit-button title=concept-submit-button>submit
+  button</a>.</p>
 
   <hr><p>The image is given by the <dfn id=attr-input-src title=attr-input-src><code>src</code></dfn> attribute. The <code title=attr-input-src><a href=#attr-input-src>src</a></code> attribute must be present, and
   must contain a <a href=#valid-url>valid URL</a> referencing a non-interactive,
@@ -25753,7 +25761,8 @@
   <p>The <code><a href=#the-input-element>input</a></code> element represents a button that, when
   activated, resets the form. If the element has a <code title=attr-input-value><a href=#attr-input-value>value</a></code> attribute, the button's label
   must be the value of that attribute; otherwise, it must be an
-  implementation-defined string that means "Reset" or some such.</p>
+  implementation-defined string that means "Reset" or some such. The
+  element is a <a href=#concept-button title=concept-button>button</a>.</p>
 
   <p>If the element is <i title=concept-input-mutable><a href=#concept-input-mutable>mutable</a></i>,
   the user agent should allow the user to activate the element.</p>
@@ -25813,7 +25822,7 @@
   <p>The <code><a href=#the-input-element>input</a></code> element represents a button with no
   default behavior. If the element has a <code title=attr-input-value><a href=#attr-input-value>value</a></code> attribute, the button's label
   must be the value of that attribute; otherwise, it must be the empty
-  string.</p>
+  string. The element is a <a href=#concept-button title=concept-button>button</a>.</p>
 
   <p>If the element is <i title=concept-input-mutable><a href=#concept-input-mutable>mutable</a></i>,
   the user agent should allow the user to activate the element. The
@@ -26453,6 +26462,8 @@
   then the user agent should allow the user to activate the
   button.</p>
 
+  <p>The element is a <a href=#concept-button title=concept-button>button</a>.</p>
+
   <p>The <dfn id=attr-button-type title=attr-button-type><code>type</code></dfn>
   attribute controls the behavior of the button when it is activated.
   It is an <a href=#enumerated-attribute>enumerated attribute</a>. The following table
@@ -26475,6 +26486,10 @@
   </table><p>The <i>missing value default</i> is the <a href=#attr-button-type-submit-state title=attr-button-type-submit-state>Submit Button</a>
   state.</p>
 
+  <p>If the <code title=attr-button-type><a href=#attr-button-type>type</a></code> attribute is in
+  the <a href=#attr-button-type-submit-state title=attr-button-type-submit-state>Submit Button</a>
+  state, the element is specifically a <a href=#concept-submit-button title=concept-submit-button>submit button</a>.</p>
+
   <p>If the element is not <a href=#concept-fe-disabled title=concept-fe-disabled>disabled</a>, the <a href=#activation-behavior>activation
   behavior</a> of the <code><a href=#the-button-element>button</a></code> element is to run the
   steps defined in the following list for the current state of the
@@ -27812,6 +27827,33 @@
 
   <h4 id=form-submission-0><span class=secno>4.10.15 </span>Form submission</h4>
 
+  <h5 id=implicit-submission><span class=secno>4.10.15.1 </span>Implicit submission</h5>
+
+  <p>User agents may establish a <a href=#concept-button title=concept-button>button</a> in each form as being the
+  form's <dfn id=default-button>default button</dfn>. This should be the first <a href=#concept-submit-button title=concept-submit-button>submit button</a> in <a href=#tree-order>tree
+  order</a> whose <a href=#form-owner>form owner</a> is that <code><a href=#the-form-element>form</a></code>
+  element, but user agents may pick another button if another would be
+  more appropriate for the platform. If the platform supports letting
+  the user submit a form implicitly (for example, on some platforms
+  hitting the "enter" key while a text field is focused implicitly
+  submits the form), then doing so must cause the form's <a href=#default-button>default
+  button</a>'s <a href=#activation-behavior>activation behavior</a>, if any, to be
+  run.</p>
+
+  <p class=note>Consequently, if the <a href=#default-button>default button</a> is
+  <a href=#concept-fe-disabled title=concept-fe-disabled>disabled</a>, the form is not
+  submitted when such an implicit submission mechanism is used. (A
+  button has no <a href=#activation-behavior>activation behavior</a> when disabled.)</p>
+
+  <p>If the form has no <a href=#concept-submit-button title=concept-submit-button>submit
+  button</a>, then the implicit submission mechanism must just
+  <a href=#concept-form-submit title=concept-form-submit>submit</a> the
+  <code><a href=#the-form-element>form</a></code> element from the <code><a href=#the-form-element>form</a></code> element
+  itself.</p>
+
+
+  <h5 id=form-submission-algorithm><span class=secno>4.10.15.2 </span>Form submission algorithm</h5>
+
   <p>When a form <var title="">form</var> is <dfn id=concept-form-submit title=concept-form-submit>submitted</dfn> from an element <var title="">submitter</var> (typically a button), the user agent must
   run the following steps:</p>
 
@@ -28310,7 +28352,7 @@
 
     </dl></li>
 
-  </ol><h5 id=url-encoded-form-data><span class=secno>4.10.15.1 </span>URL-encoded form data</h5>
+  </ol><h5 id=url-encoded-form-data><span class=secno>4.10.15.3 </span>URL-encoded form data</h5>
 
   <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>
@@ -28401,7 +28443,7 @@
    <li><p>Encode <var title="">result</var> as US-ASCII and return the
    resulting byte stream.</li>
 
-  </ol><h5 id=multipart-form-data><span class=secno>4.10.15.2 </span>Multipart form data</h5>
+  </ol><h5 id=multipart-form-data><span class=secno>4.10.15.4 </span>Multipart form data</h5>
 
   <p>The <dfn id=multipart/form-data-encoding-algorithm><code title="">multipart/form-data</code> encoding
   algorithm</dfn> is to encode the <var title="">form data set</var>
@@ -28420,7 +28462,7 @@
   <!-- XXX define default encoding? -->
 
 
-  <h5 id=plain-text-form-data><span class=secno>4.10.15.3 </span>Plain text form data</h5>
+  <h5 id=plain-text-form-data><span class=secno>4.10.15.5 </span>Plain text form data</h5>
 
   <p>The <dfn id=text/plain-encoding-algorithm><code title="">text/plain</code> encoding
   algorithm</dfn> is as follows:</p>

Modified: source
===================================================================
--- source	2008-10-29 08:22:56 UTC (rev 2378)
+++ source	2008-10-29 08:46:26 UTC (rev 2379)
@@ -25232,10 +25232,11 @@
 
   </dl>
 
-  <p>In addition, some <span
-  title="category-submit">submittable</span> can be, depending on
-  their attributes, <dfn title="concept-button">buttons</dfn>. The
-  prose below defines when an element is a button.</p>
+  <p>In addition, some <span title="category-submit">submittable
+  elements</span> can be, depending on their attributes, <dfn
+  title="concept-button">buttons</dfn>. The prose below defines when
+  an element is a button. Some buttons are specifically <dfn
+  title="concept-submit-button">submit buttons</dfn>.</p>
 
 
   <h4>The <dfn><code>form</code></dfn> element</h4>
@@ -28448,7 +28449,10 @@
   activated, submits the form. If the element has a <code
   title="attr-input-value">value</code> attribute, the button's label
   must be the value of that attribute; otherwise, it must be an
-  implementation-defined string that means "Submit" or some such.</p>
+  implementation-defined string that means "Submit" or some such. The
+  element is a <span title="concept-button">button</span>,
+  specifically a <span title="concept-submit-button">submit
+  button</span>.</p>
 
   <p>If the element is <i title="concept-input-mutable">mutable</i>,
   the user agent should allow the user to activate the element.</p>
@@ -28520,7 +28524,10 @@
 
   <p>The <code>input</code> element represents either an image from
   which a user can select a coordinate and submit the form, or
-  alternatively a button from which the user can submit the form.</p>
+  alternatively a button from which the user can submit the form. The
+  element is a <span title="concept-button">button</span>,
+  specifically a <span title="concept-submit-button">submit
+  button</span>.</p>
 
   <hr>
 
@@ -28730,7 +28737,8 @@
   activated, resets the form. If the element has a <code
   title="attr-input-value">value</code> attribute, the button's label
   must be the value of that attribute; otherwise, it must be an
-  implementation-defined string that means "Reset" or some such.</p>
+  implementation-defined string that means "Reset" or some such. The
+  element is a <span title="concept-button">button</span>.</p>
 
   <p>If the element is <i title="concept-input-mutable">mutable</i>,
   the user agent should allow the user to activate the element.</p>
@@ -28797,7 +28805,8 @@
   default behavior. If the element has a <code
   title="attr-input-value">value</code> attribute, the button's label
   must be the value of that attribute; otherwise, it must be the empty
-  string.</p>
+  string. The element is a <span
+  title="concept-button">button</span>.</p>
 
   <p>If the element is <i title="concept-input-mutable">mutable</i>,
   the user agent should allow the user to activate the element. The
@@ -29598,6 +29607,8 @@
   then the user agent should allow the user to activate the
   button.</p>
 
+  <p>The element is a <span title="concept-button">button</span>.</p>
+
   <p>The <dfn title="attr-button-type"><code>type</code></dfn>
   attribute controls the behavior of the button when it is activated.
   It is an <span>enumerated attribute</span>. The following table
@@ -29630,6 +29641,11 @@
   title="attr-button-type-submit-state">Submit Button</span>
   state.</p>
 
+  <p>If the <code title="attr-button-type">type</code> attribute is in
+  the <span title="attr-button-type-submit-state">Submit Button</span>
+  state, the element is specifically a <span
+  title="concept-submit-button">submit button</span>.</p>
+
   <p>If the element is not <span
   title="concept-fe-disabled">disabled</span>, the <span>activation
   behavior</span> of the <code>button</code> element is to run the
@@ -31288,6 +31304,35 @@
 
   <h4>Form submission</h4>
 
+  <h5>Implicit submission</h5>
+
+  <p>User agents may establish a <span
+  title="concept-button">button</span> in each form as being the
+  form's <dfn>default button</dfn>. This should be the first <span
+  title="concept-submit-button">submit button</span> in <span>tree
+  order</span> whose <span>form owner</span> is that <code>form</code>
+  element, but user agents may pick another button if another would be
+  more appropriate for the platform. If the platform supports letting
+  the user submit a form implicitly (for example, on some platforms
+  hitting the "enter" key while a text field is focused implicitly
+  submits the form), then doing so must cause the form's <span>default
+  button</span>'s <span>activation behavior</span>, if any, to be
+  run.</p>
+
+  <p class="note">Consequently, if the <span>default button</span> is
+  <span title="concept-fe-disabled">disabled</span>, the form is not
+  submitted when such an implicit submission mechanism is used. (A
+  button has no <span>activation behavior</span> when disabled.)</p>
+
+  <p>If the form has no <span title="concept-submit-button">submit
+  button</span>, then the implicit submission mechanism must just
+  <span title="concept-form-submit">submit</span> the
+  <code>form</code> element from the <code>form</code> element
+  itself.</p>
+
+
+  <h5>Form submission algorithm</h5>
+
   <p>When a form <var title="">form</var> is <dfn
   title="concept-form-submit">submitted</dfn> from an element <var
   title="">submitter</var> (typically a button), the user agent must




More information about the Commit-Watchers mailing list