Skip to content
Permalink
Browse files

[] (0) Define when reset event fires.

Fixing http://www.w3.org/Bugs/Public/show_bug.cgi?id=7699

git-svn-id: http://svn.whatwg.org/webapps@4037 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information...
Hixie committed Sep 29, 2009
1 parent e220590 commit 8dfb98f7899c725ac85e558870be5f1d639ea29e
Showing with 44 additions and 16 deletions.
  1. +19 −8 index
  2. +25 −8 source
27 index
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>

<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>

<p>If the <dfn id=dom-form-checkvalidity title=dom-form-checkValidity><code>checkValidity()</code></dfn>
</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

<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
33 source
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>
<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>

0 comments on commit 8dfb98f

Please sign in to comment.
You can’t perform that action at this time.