HTML Standard Tracker

Diff (omit for latest revision)
Filter

Short URL: http://html5.org/r/2161

File a bug

SVNBugCommentTime (UTC)
2161WF2: Categorise form elements; redefine form.elements; define fieldset.elements; add more steps to form submission (still a work in progress)2008-09-10 10:43
Index: source
===================================================================
--- source	(revision 2160)
+++ source	(revision 2161)
@@ -23886,6 +23886,35 @@
 
   <h3 id="forms">Forms</h3>
 
+  <p>Forms allow unscripted client-server interaction: given a form, a
+  user can provide data, submit it to the server, and have the server
+  act on it accordingly (e.g. returning the results of a search or
+  calculation). The elements used in forms can also be used for user
+  interaction with no associated submission mechanism, in conjunction
+  with scripts.</p>
+
+  <p>Mostly for historical reasons, elements in this section fall into
+  several overlapping (but subtly different) categories in addition to
+  the usual ones like <span>flow content</span>, <span>phrasing
+  content</span>, and <span>interactive content</span>.</p>
+
+  <p>A number of the elements are <dfn title="form-associated
+  element">form-associated elements</dfn>, which means they can have a
+  <span>form owner</span> and, to expose this, have a <code
+  title="attr-fae-form">form</code> content attribute with a matching
+  <code title="dom-fae-form">form</code> DOM attribute.</p>
+
+  <p>The controls that end up being submitted back to the server are
+  in the <dfn title="category-field">field</dfn> category.</p>
+
+  <p>The controls that are exposed to the <code
+  title="dom-form-elements"><var title="">form</var>.elements</code>
+  and <code title="dom-fieldset-elements"><var
+  title="">fieldset</var>.elements</code> APIs are in the <dfn
+  title="category-listed-form-element">listed form element</dfn>
+  category.</p>
+
+
   <h4>The <dfn><code>form</code></dfn> element</h4>
 
   <dl class="element">
@@ -23931,13 +23960,13 @@
 
   <p>The <dfn title="dom-form-elements"><code>elements</code></dfn>
   DOM attribute must return an <code>HTMLFormControlsCollection</code>
-  rooted at the <code>Document</code> node, whose filter matches
-  <code>input</code>, <code>output</code>, <code>select</code>,
-  <code>textarea</code>, <code>button</code>, and
-  <code>fieldset</code> elements whose <span>form owner</span> is the
-  <code>form</code> element, with the exception of <code>input</code>
-  elements whose <code title="attr-input-type">type</code> attribute
-  is in the <span>Image Button</span> state.</p>
+  rooted at the <code>Document</code> node, whose filter matches <span
+  title="category-listed-form-element">listed form elements</span>
+  whose <span>form owner</span> is the <code>form</code> element, with
+  the exception of <code>input</code> elements whose <code
+  title="attr-input-type">type</code> attribute is in the <span>Image
+  Button</span> state, which must, for historical reasons, be excluded
+  from this particular collection.</p>
 
   <p>The <dfn title="dom-form-length"><code>length</code></dfn> DOM
   attribute must return the number of nodes <span title="represented
@@ -23967,6 +23996,7 @@
    <dt>Categories</dt>
    <dd><span>Flow content</span>.</dd>
    <dd><span>Form-associated element</span>.</dd>
+   <dd><span title="category-listed-form-element">Listed form element</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>
@@ -23995,7 +24025,14 @@
 
   <p class="big-issue">...</p>
 
+  <p>The <dfn
+  title="dom-fieldset-elements"><code>elements</code></dfn> DOM
+  attribute must return an <code>HTMLFormControlsCollection</code>
+  rooted at the <code>Document</code> node, whose filter matches <span
+  title="category-listed-form-element">listed form elements</span>
+  that are descendants of the <code>fieldset</code> element.</p>
 
+
   <h4>The <dfn><code>input</code></dfn> element</h4>
 
   <dl class="element">
@@ -24003,6 +24040,8 @@
    <dd><span>Phrasing content</span>.</dd>
    <dd><span>Interactive content</span>.</dd>
    <dd><span>Form-associated element</span>.</dd>
+   <dd><span title="category-field">Field</span>.</dd>
+   <dd><span title="category-listed-form-element">Listed form element</span>.</dd>
    <dt>Contexts in which this element may be used:</dt>
    <dd>Where <span>phrasing content</span> is expected.</dd>
    <dt>Content model:</dt>
@@ -24096,6 +24135,8 @@
    <dd><span>Phrasing content</span>.</dd>
    <dd><span>Interactive content</span>.</dd>
    <dd><span>Form-associated element</span>.</dd>
+   <dd><span title="category-field">Field</span>.</dd>
+   <dd><span title="category-listed-form-element">Listed form element</span>.</dd>
    <dt>Contexts in which this element may be used:</dt>
    <dd>Where <span>phrasing content</span> is expected.</dd>
    <dt>Content model:</dt>
@@ -24173,6 +24214,8 @@
    <dd><span>Phrasing content</span>.</dd>
    <dd><span>Interactive content</span>.</dd>
    <dd><span>Form-associated element</span>.</dd>
+   <dd><span title="category-field">Field</span>.</dd>
+   <dd><span title="category-listed-form-element">Listed form element</span>.</dd>
    <dt>Contexts in which this element may be used:</dt>
    <dd>Where <span>phrasing content</span> is expected.</dd>
    <dt>Content model:</dt>
@@ -24324,6 +24367,8 @@
    <dd><span>Phrasing content</span>.</dd>
    <dd><span>Interactive content</span>.</dd>
    <dd><span>Form-associated element</span>.</dd>
+   <dd><span title="category-field">Field</span>.</dd>
+   <dd><span title="category-listed-form-element">Listed form element</span>.</dd>
    <dt>Contexts in which this element may be used:</dt>
    <dd>Where <span>phrasing content</span> is expected.</dd>
    <dt>Content model:</dt>
@@ -24388,6 +24433,7 @@
    <dt>Categories</dt>
    <dd><span>Phrasing content</span>.</dd>
    <dd><span>Form-associated element</span>.</dd>
+   <dd><span title="category-listed-form-element">Listed form element</span>.</dd>
    <dt>Contexts in which this element may be used:</dt>
    <dd>Where <span>phrasing content</span> is expected.</dd>
    <dt>Content model:</dt>
@@ -24423,9 +24469,11 @@
 
   <!-- XXX consider xreffing the 'ID' term in this section -->
 
-  <p>A <dfn>form-associated element</dfn> is one that can have a
-  relationship with a <code>form</code> element, which is called the
-  element's <dfn>form owner</dfn>.</p>
+  <p>A <span>form-associated element</span> can have a relationship
+  with a <code>form</code> element, which is called the element's
+  <dfn>form owner</dfn>. If a <span>form-associated element</span> is
+  not associated with a <code>form</code> element, its <span>form
+  owner</span> is said to be null.</p>
 
   <p>A <span>form-associated element</span> is, by default, associated
   with its nearest ancestor <code>form</code> element (as described
@@ -24516,7 +24564,7 @@
 
   <h4>Processing models</h4>
 
-  <h5>Constraint checking</h5>
+  <h5>Constraint validation</h5>
 
   <p class="big-issue">...</p>
 
@@ -24535,6 +24583,25 @@
    <span>sandboxed forms browsing context flag</span> set, then abort
    these steps without doing anything.</p></li>
 
+   <li><p>If the <var title="">submitter</var> is anything but a
+   <code>form</code> element, then <span>validate the
+   constraints</span> of <var title="">form</var> and examine the
+   result: if the result is negative (the constraint validation
+   concluded that there were invalid fields and informed the user of
+   this) then abort these steps.</p></li>
+
+   <li><p>If the <var title="">submitter</var> is anything but a
+   <code>form</code> element, then <span>fire a simple event</span>
+   that bubbles<!--XXX-->, named <code
+   title="event-submit">submit</code>, at <var title="">form</var>. If
+   the event's default action is prevented (i.e. if the event is
+   canceled) then abort these steps. Otherwise, continue (effectively
+   the default action is to perform the submission).</p></li>
+
+   <li><p>Let <var title="">controls</var> be a list of all the <span
+   title="category-field">fields</span> whose <span>form owner</span>
+   is <var title="">form</var>.</p></li>
+
    <li><p class="big-issue">...</p></li>
 
   </ol>

|