Skip to content

Commit

Permalink
[] (0) Define when reset event fires.
Browse files Browse the repository at this point in the history
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 8dfb98f
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 16 deletions.
27 changes: 19 additions & 8 deletions index
Original file line number Diff line number Diff line change
Expand Up @@ -30744,10 +30744,21 @@ interface <dfn id=htmlformelement>HTMLFormElement</dfn> : <a href=#htmlelement>H
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
Expand Down Expand Up @@ -39382,11 +39393,11 @@ fur

<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
Expand Down
33 changes: 25 additions & 8 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -34134,9 +34134,23 @@ interface <dfn>HTMLFormElement</dfn> : <span>HTMLElement</span> {
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>
Expand Down Expand Up @@ -44212,11 +44226,14 @@ fur
<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>

Expand Down

0 comments on commit 8dfb98f

Please sign in to comment.