HTML Standard Tracker

Filter

File a bug

SVNBugCommentTime (UTC)
2379[Gecko] [Internet Explorer] [Opera] [Webkit] Define 'button' and 'default button' and define implicit form submission.2008-10-29 08:46
@@ -25225,24 +25225,25 @@ function AddCloud(data, x, y) { ... }</pre>
    and <code title="dom-fieldset-elements"><var
    title="">fieldset</var>.elements</code> APIs.</dd>
 
    <dt><dfn title="category-label">Labelable</dfn></dt>
 
    <dd>Denotes elements that can be associated with <code>label</code>
    elements.</dd>
 
   </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>
 
   <dl class="element">
    <dt>Categories</dt>
    <dd><span>Flow content</span>.</dd>
    <dt>Contexts in which this element may be used:</dt>
    <dd>Where <span>flow content</span> is expected.</dd>
    <dt>Content model:</dt>
@@ -28441,21 +28442,24 @@ function AddCloud(data, x, y) { ... }</pre>
 
   <p>When an <code>input</code> element's <code
   title="attr-input-type">type</code> attribute is in the <span
   title="attr-input-type-submit">Submit Button</span> state, the rules
   in this section apply.</p>
 
   <p>The <code>input</code> element represents a button that, when
   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>
 
   <p>The element's <span>activation behavior</span>, if the element
   has a <span>form owner</span>, is to <span
   title="concept-form-submit">submit</span> the <span>form
   owner</span> from the <code>input</code> element; otherwise, it is
   to do nothing.</p>
 
@@ -28513,21 +28517,24 @@ function AddCloud(data, x, y) { ... }</pre>
 
   <h6><dfn title="attr-input-type-image">Image Button</dfn> state</h6>
 
   <p>When an <code>input</code> element's <code
   title="attr-input-type">type</code> attribute is in the <span
   title="attr-input-type-image">Image Button</span> state, the rules
   in this section apply.</p>
 
   <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>
 
   <p>The image is given by the <dfn
   title="attr-input-src"><code>src</code></dfn> attribute. The <code
   title="attr-input-src">src</code> attribute must be present, and
   must contain a <span>valid URL</span> referencing a non-interactive,
   optionally animated, image resource that is neither paged nor
   scripted.</p>
 
@@ -28723,21 +28730,22 @@ function AddCloud(data, x, y) { ... }</pre>
 
   <p>When an <code>input</code> element's <code
   title="attr-input-type">type</code> attribute is in the <span
   title="attr-input-type-reset">Reset Button</span> state, the rules
   in this section apply.</p>
 
   <p>The <code>input</code> element represents a button that, when
   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>
 
   <p>The element's <span>activation behavior</span>, if the element
   has a <span>form owner</span>, is to <span
   title="concept-form-reset">reset</span> the <span>form owner</span>;
   otherwise, it is to do nothing.</p>
 
   <p><strong>Constraint validation:</strong> The element is
@@ -28790,21 +28798,22 @@ function AddCloud(data, x, y) { ... }</pre>
 
   <p>When an <code>input</code> element's <code
   title="attr-input-type">type</code> attribute is in the <span
   title="attr-input-type-button">Button</span> state, the rules in
   this section apply.</p>
 
   <p>The <code>input</code> element represents a button with no
   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
   element's <span>activation behavior</span> is to do nothing.</p>
 
   <p><strong>Constraint validation:</strong> The element is
   <span>barred from constraint validation</span>.</p>
 
   <p>The <code title="dom-input-value">value</code> DOM attribute
   applies to this element and is in mode <span
@@ -29591,20 +29600,22 @@ You cannot complete this form until the field is correct.</samp></pre>
   readonly attribute <span>NodeList</span> <span title="dom-lfe-labels">labels</span>;
 };</pre>
    </dd> 
   </dl>
 
   <p>The <code>button</code> element represents a button. If the
   element is not <span title="concept-fe-disabled">disabled</span>,
   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
   lists the keywords and states for the attribute &mdash; the keywords
   in the left column map to the states in the cell in the second
   column on the same row as the keyword.</p>
 
   <table>
    <thead>
     <tr>
@@ -29623,20 +29634,25 @@ You cannot complete this form until the field is correct.</samp></pre>
     <tr>
      <td><dfn title="attr-button-type-button"><code>button</code></dfn>
      <td><span title="attr-button-type-button-state">Button</span>
      <td>Does nothing.
   </table>
 
   <p>The <i>missing value default</i> is the <span
   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
   steps defined in the following list for the current state of the
   element's <code title="attr-button-type">type</code> attribute.</p>
 
   <dl>
 
    <dt> <dfn title="attr-button-type-submit-state">Submit Button</dfn> </dt>
 
@@ -31281,20 +31297,49 @@ interface <dfn>HTMLOptionElement</dfn> : <span>HTMLElement</span> {
   tools that do not implement these features. The constraint
   validation features are only intended to improve the user
   experience, not to provide any kind of security mechanism.</p>
 
 
 
 
 
   <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
   run the following steps:</p>
 
   <ol>
 
    <li id="sandboxSubmitBlocked"><p>If <var title="">form</var> is in
    a <code>Document</code> that has no associated <span>browsing
    context</span> or whose <span>browsing context</span> has its

|