[html5] r4037 - [] (0) Define when reset event fires. Fixing http://www.w3.org/Bugs/Public/show_ [...]

whatwg at whatwg.org whatwg at whatwg.org
Tue Sep 29 01:40:56 PDT 2009


Author: ianh
Date: 2009-09-29 01:40:55 -0700 (Tue, 29 Sep 2009)
New Revision: 4037

Modified:
   index
   source
Log:
[] (0) Define when reset event fires.
Fixing http://www.w3.org/Bugs/Public/show_bug.cgi?id=7699

Modified: index
===================================================================
--- index	2009-09-29 08:19:55 UTC (rev 4036)
+++ index	2009-09-29 08:40:55 UTC (rev 4037)
@@ -30744,10 +30744,21 @@
   element from the <code><a href=#the-form-element>form</a></code> element itself, with the <var title="">scripted-submit</var> flag set.</p>
 
   <p>The <dfn id=dom-form-reset title=dom-form-reset><code>reset()</code></dfn>
-  method, when invoked, must <a href=#concept-form-reset title=concept-form-reset>reset</a> the <code><a href=#the-form-element>form</a></code>
-  element.</p>
+  method, when invoked, must run the following steps:</p>
 
-  <p>If the <dfn id=dom-form-checkvalidity title=dom-form-checkValidity><code>checkValidity()</code></dfn>
+  <ol><li><p>If the <code><a href=#the-form-element>form</a></code> element is marked as <i><a href=#locked-for-reset>locked for
+   reset</a></i>, then abort these steps.</li>
+
+   <li><p>Mark the <code><a href=#the-form-element>form</a></code> element as <dfn id=locked-for-reset>locked for
+   reset</dfn>.</li>
+
+   <li><p><a href=#concept-form-reset title=concept-form-reset>Reset</a> the
+   <code><a href=#the-form-element>form</a></code> element.</li>
+
+   <li><p>Unmark the <code><a href=#the-form-element>form</a></code> element as <i><a href=#locked-for-reset>locked for
+   reset</a></i>.</li>
+
+  </ol><p>If the <dfn id=dom-form-checkvalidity title=dom-form-checkValidity><code>checkValidity()</code></dfn>
   method is invoked, the user agent must <a href=#statically-validate-the-constraints>statically validate the
   constraints</a> of the <code><a href=#the-form-element>form</a></code> element, and return true
   if the constraint validation return a <i>positive</i> result, and
@@ -39382,11 +39393,11 @@
 
   <h4 id=resetting-a-form><span class=secno>4.10.18 </span>Resetting a form</h4>
 
-  <p>When a form <var title="">form</var> is <dfn id=concept-form-reset title=concept-form-reset>reset</dfn>, the user agent must invoke
-  the <a href=#concept-form-reset-control title=concept-form-reset-control>reset algorithm</a>
-  of each <a href=#category-reset title=category-reset>resettable</a> elements
-  whose <a href=#form-owner>form owner</a> is <var title="">form</var>, and must
-  then <a href=#broadcast-formchange-events>broadcast <code title=event-formchange>formchange</code> events</a> from <var title="">form</var>.</p>
+  <p>When a form <var title="">form</var> is <dfn id=concept-form-reset title=concept-form-reset>reset</dfn>, the user agent must
+  <a href=#fire-a-simple-event>fire a simple event</a> called <code title=event-reset>reset</code>, that is cancelable, at <var title="">form</var>, and then, if that event is not canceled, must
+  invoke the <a href=#concept-form-reset-control title=concept-form-reset-control>reset
+  algorithm</a> of each <a href=#category-reset title=category-reset>resettable</a> elements whose <a href=#form-owner>form
+  owner</a> is <var title="">form</var>, and <a href=#broadcast-formchange-events>broadcast <code title=event-formchange>formchange</code> events</a> from <var title="">form</var>.</p>
 
   <p>Each <a href=#category-reset title=category-reset>resettable</a> element
   defines its own <dfn id=concept-form-reset-control title=concept-form-reset-control>reset

Modified: source
===================================================================
--- source	2009-09-29 08:19:55 UTC (rev 4036)
+++ source	2009-09-29 08:40:55 UTC (rev 4037)
@@ -34134,10 +34134,24 @@
   title="">scripted-submit</var> flag set.</p>
 
   <p>The <dfn title="dom-form-reset"><code>reset()</code></dfn>
-  method, when invoked, must <span
-  title="concept-form-reset">reset</span> the <code>form</code>
-  element.</p>
+  method, when invoked, must run the following steps:</p>
 
+  <ol>
+
+   <li><p>If the <code>form</code> element is marked as <i>locked for
+   reset</i>, then abort these steps.</p></li>
+
+   <li><p>Mark the <code>form</code> element as <dfn>locked for
+   reset</dfn>.</p></li>
+
+   <li><p><span title="concept-form-reset">Reset</span> the
+   <code>form</code> element.</p></li>
+
+   <li><p>Unmark the <code>form</code> element as <i>locked for
+   reset</i>.</p></li>
+
+  </ol>
+
   <p>If the <dfn
   title="dom-form-checkValidity"><code>checkValidity()</code></dfn>
   method is invoked, the user agent must <span>statically validate the
@@ -44212,11 +44226,14 @@
   <h4>Resetting a form</h4>
 
   <p>When a form <var title="">form</var> is <dfn
-  title="concept-form-reset">reset</dfn>, the user agent must invoke
-  the <span title="concept-form-reset-control">reset algorithm</span>
-  of each <span title="category-reset">resettable</span> elements
-  whose <span>form owner</span> is <var title="">form</var>, and must
-  then <span>broadcast <code
+  title="concept-form-reset">reset</dfn>, the user agent must
+  <span>fire a simple event</span> called <code
+  title="event-reset">reset</code>, that is cancelable, at <var
+  title="">form</var>, and then, if that event is not canceled, must
+  invoke the <span title="concept-form-reset-control">reset
+  algorithm</span> of each <span
+  title="category-reset">resettable</span> elements whose <span>form
+  owner</span> is <var title="">form</var>, and <span>broadcast <code
   title="event-formchange">formchange</code> events</span> from <var
   title="">form</var>.</p>
 




More information about the Commit-Watchers mailing list