HTML Standard Tracker

Filter

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
@@ -23879,20 +23879,49 @@ function AddCloud(data, x, y) { ... }</pre>
   <p>User agents may remove <span title="empty data cell">empty data
   cells</span> when analyzing data in a <span
   title="concept-table">table</span>.</p>
 
 
 
 
 
   <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">
    <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>
    <dd><span>Flow content</span>, but with no <code>form</code> element descendants.</dd>
    <dt>Element-specific attributes:</dt>
@@ -23924,27 +23953,27 @@ function AddCloud(data, x, y) { ... }</pre>
   void <span title="dom-form-dispatchFormInput">dispatchFormInput</span>();
   void <span title="dom-form-dispatchFormChange">dispatchFormChange</span>();
 };</pre>
    </dd> 
   </dl>
 
   <p class="big-issue">...</p>
 
   <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
   by the collection">represented</span> by the <code
   title="dom-form-elements">elements</code> collection.</p>
 
   <!-- XXX7 and XXX8: in IE these are called item and namedItem, but
   they have deep magic involved to resolve name clashes with form
   controls of those names. In other browsers, they are anonymous. -->
 
@@ -23960,20 +23989,21 @@ function AddCloud(data, x, y) { ... }</pre>
   method of the <code title="dom-form-elements">elements</code>
   collection if it was invoked with the same arguments.</p>
 
 
   <h4>The <dfn><code>fieldset</code></dfn> element</h4>
 
   <dl class="element">
    <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>
    <dd><span>Flow content</span>.</dd>
    <dt>Element-specific attributes:</dt>
    <dd><code title="attr-fieldset-disabled">disabled</code></dd>
    <dd><code title="attr-fae-form">form</code></dd>
    <dt>DOM interface:</dt>
    <dd>
 <pre class="idl">interface <dfn>HTMLFieldSetElement</dfn> : <span>HTMLElement</span> {
@@ -23988,28 +24018,37 @@ function AddCloud(data, x, y) { ... }</pre>
   readonly attribute <span>ValidityState</span> <span title="dom-fieldset-validity">validity</span>;
   readonly attribute DOMString <span title="dom-fieldset-validationMessage">validationMessage</span>;
   boolean <span title="dom-fieldset-checkValidatity">checkValidity</span>();
   void <span title="dom-fieldset-setCustomValidity">setCustomValidity</span>(in DOMString error);
 };</pre>
    </dd> 
   </dl>
 
   <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">
    <dt>Categories</dt>
    <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>
    <dd>Empty.</dd>
    <dt>Element-specific attributes:</dt>
    <dd><code title="attr-input-accept">accept</code></dd>
    <dd><code title="attr-input-action">action</code></dd>
    <dd><code title="attr-input-alt">alt</code></dd>
    <dd><code title="attr-input-autocomplete">autocomplete</code></dd>
    <dd><code title="attr-input-autofocus">autofocus</code></dd>
@@ -24089,20 +24128,22 @@ function AddCloud(data, x, y) { ... }</pre>
   <p class="big-issue">...</p>
 
 
   <h4>The <dfn><code>button</code></dfn> element</h4>
 
   <dl class="element">
    <dt>Categories</dt>
    <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>
    <dd><span>Phrasing content</span>.</dd>
    <dt>Element-specific attributes:</dt>
    <dd><code title="attr-button-action">action</code></dd>
    <dd><code title="attr-button-autofocus">autofocus</code></dd>
    <dd><code title="attr-button-disabled">disabled</code></dd>
    <dd><code title="attr-button-enctype">enctype</code></dd>
    <dd><code title="attr-fae-form">form</code></dd>
@@ -24166,20 +24207,22 @@ function AddCloud(data, x, y) { ... }</pre>
   <p class="big-issue">...</p>
 
 
   <h4>The <dfn><code>select</code></dfn> element</h4>
 
   <dl class="element">
    <dt>Categories</dt>
    <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>
    <dd>Zero or more <code>option</code> or <code>optgroup</code> elements.</dd>
    <dt>Element-specific attributes:</dt>
    <dd><code title="attr-select-autofocus">autofocus</code></dd>
    <dd><code title="attr-select-disabled">disabled</code></dd>
    <dd><code title="attr-fae-form">form</code></dd>
    <dd><code title="attr-select-multiple">multiple</code></dd>
    <dd><code title="attr-select-name">name</code></dd>
@@ -24317,20 +24360,22 @@ interface <dfn>HTMLOptionElement</dfn> : <span>HTMLElement</span> {
   </p>
 
 
   <h4>The <dfn><code>textarea</code></dfn> element</h4>
 
   <dl class="element">
    <dt>Categories</dt>
    <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>
    <dd>Text.</dd>
    <dt>Element-specific attributes:</dt>
    <dd><code title="attr-textarea-accept">accept</code></dd>
    <dd><code title="attr-textarea-autofocus">autofocus</code></dd>
    <dd><code title="attr-textarea-cols">cols</code></dd>
    <dd><code title="attr-textarea-disabled">disabled</code></dd>
    <dd><code title="attr-fae-form">form</code></dd>
@@ -24381,20 +24426,21 @@ interface <dfn>HTMLOptionElement</dfn> : <span>HTMLElement</span> {
 
   <p class="big-issue">...</p>
 
 
   <h4>The <dfn><code>output</code></dfn> element</h4>
 
   <dl class="element">
    <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>
    <dd><span>Phrasing content</span>.</dd>
    <dt>Element-specific attributes:</dt>
    <dd><code title="attr-output-for">for</code></dd>
    <dd><code title="attr-fae-form">form</code></dd>
    <dd><code title="attr-output-name">name</code></dd>
    <dt>DOM interface:</dt>
    <dd>
@@ -24416,23 +24462,25 @@ interface <dfn>HTMLOptionElement</dfn> : <span>HTMLElement</span> {
    </dd> 
   </dl>
 
   <p class="big-issue">...</p>
 
 
   <h4>Association of controls and forms</h4>
 
   <!-- 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
   below), but may have a <dfn
   title="attr-fae-form"><code>form</code></dfn> attribute specified to
   override this.</p>
 
   <p>If a <span>form-associated element</span> has a <code
   title="attr-fae-form">form</code> attribute specified, then its
   value must be the ID of a <code>form</code> element in the element's
@@ -24509,39 +24557,58 @@ interface <dfn>HTMLOptionElement</dfn> : <span>HTMLElement</span> {
 
   <p><span title="form-associated element">Form-associated
   elements</span> have a <dfn
   title="dom-fae-form"><code>form</code></dfn> DOM attribute, which,
   on getting, must return the element's <span>form owner</span>, or
   null if there isn't one.</p>
 
 
   <h4>Processing models</h4>
 
-  <h5>Constraint checking</h5>
+  <h5>Constraint validation</h5>
 
   <p class="big-issue">...</p>
 
   <h5>Form submission</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
    <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>
 
 
 
   <h3>Scripting</h3>
 
   <p>Scripts allow authors to add interactivity to their documents.</p>
 

|