Skip to content

Commit

Permalink
[giow] (2) Define what happens when the type= of an <input> changes.
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.whatwg.org/webapps@5376 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Aug 27, 2010
1 parent b109fdb commit bda43cc
Show file tree
Hide file tree
Showing 3 changed files with 143 additions and 24 deletions.
47 changes: 39 additions & 8 deletions complete.html
Expand Up @@ -38559,12 +38559,8 @@ <h4 id=the-input-element><span class=secno>4.10.7 </span>The <dfn><code>input</c

</table><div class=impl>

<p>When an <code><a href=#the-input-element>input</a></code> element's <code title=attr-input-type><a href=#attr-input-type>type</a></code> attribute changes state, and
when the element is first created, the element's rendering and
behavior must change to the new state's accordingly and the
<dfn id=value-sanitization-algorithm>value sanitization algorithm</dfn>, if one is defined for the
<code title=attr-input-type><a href=#attr-input-type>type</a></code> attribute's new state,
must be invoked.</p>
<p>Some states of the <code title=attr-input-type><a href=#attr-input-type>type</a></code>
attribute define a <dfn id=value-sanitization-algorithm>value sanitization algorithm</dfn>.</p>

<p>Each <code><a href=#the-input-element>input</a></code> element has a <a href=#concept-fe-value title=concept-fe-value>value</a>, which is exposed by the <code title=dom-input-value><a href=#dom-input-value>value</a></code> IDL attribute. Some states
define an <dfn id=concept-input-value-string-number title=concept-input-value-string-number>algorithm
Expand Down Expand Up @@ -38592,7 +38588,7 @@ <h4 id=the-input-element><span class=secno>4.10.7 </span>The <dfn><code>input</c
content attribute gives the default <a href=#concept-fe-value title=concept-fe-value>value</a> of the <code><a href=#the-input-element>input</a></code>
element. <span class=impl>When the <code title=attr-input-value><a href=#attr-input-value>value</a></code> content attribute is added,
set, or removed, if the control's <a href=#concept-input-value-dirty-flag title=concept-input-value-dirty-flag>dirty value flag</a> is
true, the user agent must set the <a href=#concept-fe-value title=concept-fe-value>value</a> of the element to the value of
false, the user agent must set the <a href=#concept-fe-value title=concept-fe-value>value</a> of the element to the value of
the <code title=attr-input-value><a href=#attr-input-value>value</a></code> content attribute,
if there is one, or the empty string otherwise, and then run the
current <a href=#value-sanitization-algorithm>value sanitization algorithm</a>, if one is
Expand Down Expand Up @@ -38658,9 +38654,44 @@ <h4 id=the-input-element><span class=secno>4.10.7 </span>The <dfn><code>input</c
<a href=#concept-fe-checked title=concept-fe-checked>checkedness</a>, and <a href=#concept-input-checked-dirty-flag title=concept-input-checked-dirty-flag>dirty checkedness
flag</a> must be propagated to the clone when it is created.</p>

<hr><p>When an <code><a href=#the-input-element>input</a></code> element is first created, the
element's rendering and behavior must be set to the rendering and
behavior defined for the <code title=attr-input-type><a href=#attr-input-type>type</a></code>
attribute's state, and the <a href=#value-sanitization-algorithm>value sanitization
algorithm</a>, if one is defined for the <code title=attr-input-type><a href=#attr-input-type>type</a></code> attribute's state, must be
invoked.</p>

</div>

<p>The <code title=attr-fae-form><a href=#attr-fae-form>form</a></code> attribute is used to
<div class=impl id=input-type-change>

<p>When an <code><a href=#the-input-element>input</a></code> element's <code title=attr-input-type><a href=#attr-input-type>type</a></code> attribute changes state, the
user agent must run the following steps:</p>

<ol><!-- http://software.hixie.ch/utilities/js/live-dom-viewer/saved/602 --><li><p>If the previous state of the element's <code title=attr-input-type><a href=#attr-input-type>type</a></code> attribute put the <code title=dom-input-value><a href=#dom-input-value>value</a></code> IDL attribute in the <i title=dom-input-value-value><a href=#dom-input-value-value>value</a></i> mode, and the element's
<a href=#concept-fe-value title=concept-fe-value>value</a> is not the empty
string, and the new state of the element's <code title=attr-input-type><a href=#attr-input-type>type</a></code> attribute puts the <code title=dom-input-value><a href=#dom-input-value>value</a></code> IDL attribute in either the <i title=dom-input-value-default><a href=#dom-input-value-default>default</a></i> mode or the <i title=dom-input-value-default-on><a href=#dom-input-value-default-on>default/on</a></i> mode, then set
the element's <code title=attr-input-value><a href=#attr-input-value>value</a></code> content
attribute to the element's <a href=#concept-fe-value title=concept-fe-value>value</a>.</li>

<li><p>Otherwise, if the previous state of the element's <code title=attr-input-type><a href=#attr-input-type>type</a></code> attribute put the <code title=dom-input-value><a href=#dom-input-value>value</a></code> IDL attribute in any mode
other than the <i title=dom-input-value-value><a href=#dom-input-value-value>value</a></i> mode, and
the new state of the element's <code title=attr-input-type><a href=#attr-input-type>type</a></code> attribute puts the <code title=dom-input-value><a href=#dom-input-value>value</a></code> IDL attribute in the <i title=dom-input-value-value><a href=#dom-input-value-value>value</a></i> mode, then set the <a href=#concept-fe-value title=concept-fe-value>value</a> of the element to the value
of the <code title=attr-input-value><a href=#attr-input-value>value</a></code> content
attribute, if there is one, or the empty string otherwise, and
then set the control's <a href=#concept-input-value-dirty-flag title=concept-input-value-dirty-flag>dirty value flag</a> to
false.</li>

<li><p>Update the element's rendering and behavior to the new
state's.</li>

<li><p>Invoke the <a href=#value-sanitization-algorithm>value sanitization algorithm</a>, if one
is defined for the <code title=attr-input-type><a href=#attr-input-type>type</a></code>
attribute's new state.</li>

</ol></div>

<hr><p>The <code title=attr-fae-form><a href=#attr-fae-form>form</a></code> attribute is used to
explicitly associate the <code><a href=#the-input-element>input</a></code> element with its
<a href=#form-owner>form owner</a>. The <code title=attr-fe-name><a href=#attr-fe-name>name</a></code>
attribute represents the element's name. The <code title=attr-fe-disabled><a href=#attr-fe-disabled>disabled</a></code> attribute is used to make
Expand Down
47 changes: 39 additions & 8 deletions index
Expand Up @@ -38484,12 +38484,8 @@ interface <dfn id=htmlformelement>HTMLFormElement</dfn> : <a href=#htmlelement>H

</table><div class=impl>

<p>When an <code><a href=#the-input-element>input</a></code> element's <code title=attr-input-type><a href=#attr-input-type>type</a></code> attribute changes state, and
when the element is first created, the element's rendering and
behavior must change to the new state's accordingly and the
<dfn id=value-sanitization-algorithm>value sanitization algorithm</dfn>, if one is defined for the
<code title=attr-input-type><a href=#attr-input-type>type</a></code> attribute's new state,
must be invoked.</p>
<p>Some states of the <code title=attr-input-type><a href=#attr-input-type>type</a></code>
attribute define a <dfn id=value-sanitization-algorithm>value sanitization algorithm</dfn>.</p>

<p>Each <code><a href=#the-input-element>input</a></code> element has a <a href=#concept-fe-value title=concept-fe-value>value</a>, which is exposed by the <code title=dom-input-value><a href=#dom-input-value>value</a></code> IDL attribute. Some states
define an <dfn id=concept-input-value-string-number title=concept-input-value-string-number>algorithm
Expand Down Expand Up @@ -38517,7 +38513,7 @@ interface <dfn id=htmlformelement>HTMLFormElement</dfn> : <a href=#htmlelement>H
content attribute gives the default <a href=#concept-fe-value title=concept-fe-value>value</a> of the <code><a href=#the-input-element>input</a></code>
element. <span class=impl>When the <code title=attr-input-value><a href=#attr-input-value>value</a></code> content attribute is added,
set, or removed, if the control's <a href=#concept-input-value-dirty-flag title=concept-input-value-dirty-flag>dirty value flag</a> is
true, the user agent must set the <a href=#concept-fe-value title=concept-fe-value>value</a> of the element to the value of
false, the user agent must set the <a href=#concept-fe-value title=concept-fe-value>value</a> of the element to the value of
the <code title=attr-input-value><a href=#attr-input-value>value</a></code> content attribute,
if there is one, or the empty string otherwise, and then run the
current <a href=#value-sanitization-algorithm>value sanitization algorithm</a>, if one is
Expand Down Expand Up @@ -38583,9 +38579,44 @@ interface <dfn id=htmlformelement>HTMLFormElement</dfn> : <a href=#htmlelement>H
<a href=#concept-fe-checked title=concept-fe-checked>checkedness</a>, and <a href=#concept-input-checked-dirty-flag title=concept-input-checked-dirty-flag>dirty checkedness
flag</a> must be propagated to the clone when it is created.</p>

<hr><p>When an <code><a href=#the-input-element>input</a></code> element is first created, the
element's rendering and behavior must be set to the rendering and
behavior defined for the <code title=attr-input-type><a href=#attr-input-type>type</a></code>
attribute's state, and the <a href=#value-sanitization-algorithm>value sanitization
algorithm</a>, if one is defined for the <code title=attr-input-type><a href=#attr-input-type>type</a></code> attribute's state, must be
invoked.</p>

</div>

<p>The <code title=attr-fae-form><a href=#attr-fae-form>form</a></code> attribute is used to
<div class=impl id=input-type-change>

<p>When an <code><a href=#the-input-element>input</a></code> element's <code title=attr-input-type><a href=#attr-input-type>type</a></code> attribute changes state, the
user agent must run the following steps:</p>

<ol><!-- http://software.hixie.ch/utilities/js/live-dom-viewer/saved/602 --><li><p>If the previous state of the element's <code title=attr-input-type><a href=#attr-input-type>type</a></code> attribute put the <code title=dom-input-value><a href=#dom-input-value>value</a></code> IDL attribute in the <i title=dom-input-value-value><a href=#dom-input-value-value>value</a></i> mode, and the element's
<a href=#concept-fe-value title=concept-fe-value>value</a> is not the empty
string, and the new state of the element's <code title=attr-input-type><a href=#attr-input-type>type</a></code> attribute puts the <code title=dom-input-value><a href=#dom-input-value>value</a></code> IDL attribute in either the <i title=dom-input-value-default><a href=#dom-input-value-default>default</a></i> mode or the <i title=dom-input-value-default-on><a href=#dom-input-value-default-on>default/on</a></i> mode, then set
the element's <code title=attr-input-value><a href=#attr-input-value>value</a></code> content
attribute to the element's <a href=#concept-fe-value title=concept-fe-value>value</a>.</li>

<li><p>Otherwise, if the previous state of the element's <code title=attr-input-type><a href=#attr-input-type>type</a></code> attribute put the <code title=dom-input-value><a href=#dom-input-value>value</a></code> IDL attribute in any mode
other than the <i title=dom-input-value-value><a href=#dom-input-value-value>value</a></i> mode, and
the new state of the element's <code title=attr-input-type><a href=#attr-input-type>type</a></code> attribute puts the <code title=dom-input-value><a href=#dom-input-value>value</a></code> IDL attribute in the <i title=dom-input-value-value><a href=#dom-input-value-value>value</a></i> mode, then set the <a href=#concept-fe-value title=concept-fe-value>value</a> of the element to the value
of the <code title=attr-input-value><a href=#attr-input-value>value</a></code> content
attribute, if there is one, or the empty string otherwise, and
then set the control's <a href=#concept-input-value-dirty-flag title=concept-input-value-dirty-flag>dirty value flag</a> to
false.</li>

<li><p>Update the element's rendering and behavior to the new
state's.</li>

<li><p>Invoke the <a href=#value-sanitization-algorithm>value sanitization algorithm</a>, if one
is defined for the <code title=attr-input-type><a href=#attr-input-type>type</a></code>
attribute's new state.</li>

</ol></div>

<hr><p>The <code title=attr-fae-form><a href=#attr-fae-form>form</a></code> attribute is used to
explicitly associate the <code><a href=#the-input-element>input</a></code> element with its
<a href=#form-owner>form owner</a>. The <code title=attr-fe-name><a href=#attr-fe-name>name</a></code>
attribute represents the element's name. The <code title=attr-fe-disabled><a href=#attr-fe-disabled>disabled</a></code> attribute is used to make
Expand Down
73 changes: 65 additions & 8 deletions source
Expand Up @@ -42862,13 +42862,8 @@ interface <dfn>HTMLFormElement</dfn> : <span>HTMLElement</span> {

<div class="impl">

<p>When an <code>input</code> element's <code
title="attr-input-type">type</code> attribute changes state, and
when the element is first created, the element's rendering and
behavior must change to the new state's accordingly and the
<dfn>value sanitization algorithm</dfn>, if one is defined for the
<code title="attr-input-type">type</code> attribute's new state,
must be invoked.</p>
<p>Some states of the <code title="attr-input-type">type</code>
attribute define a <dfn>value sanitization algorithm</dfn>.</p>

<p>Each <code>input</code> element has a <span
title="concept-fe-value">value</span>, which is exposed by the <code
Expand Down Expand Up @@ -42905,7 +42900,7 @@ interface <dfn>HTMLFormElement</dfn> : <span>HTMLElement</span> {
title="attr-input-value">value</code> content attribute is added,
set, or removed, if the control's <span
title="concept-input-value-dirty-flag">dirty value flag</span> is
true, the user agent must set the <span
false, the user agent must set the <span
title="concept-fe-value">value</span> of the element to the value of
the <code title="attr-input-value">value</code> content attribute,
if there is one, or the empty string otherwise, and then run the
Expand Down Expand Up @@ -42999,8 +42994,70 @@ interface <dfn>HTMLFormElement</dfn> : <span>HTMLElement</span> {
title="concept-input-checked-dirty-flag">dirty checkedness
flag</span> must be propagated to the clone when it is created.</p>

<hr>

<p>When an <code>input</code> element is first created, the
element's rendering and behavior must be set to the rendering and
behavior defined for the <code title="attr-input-type">type</code>
attribute's state, and the <span>value sanitization
algorithm</span>, if one is defined for the <code
title="attr-input-type">type</code> attribute's state, must be
invoked.</p>

</div>

<div id="input-type-change" class="impl">

<p>When an <code>input</code> element's <code
title="attr-input-type">type</code> attribute changes state, the
user agent must run the following steps:</p>

<ol>

<!-- http://software.hixie.ch/utilities/js/live-dom-viewer/saved/602 -->

<li><p>If the previous state of the element's <code
title="attr-input-type">type</code> attribute put the <code
title="dom-input-value">value</code> IDL attribute in the <i
title="dom-input-value-value">value</i> mode, and the element's
<span title="concept-fe-value">value</span> is not the empty
string, and the new state of the element's <code
title="attr-input-type">type</code> attribute puts the <code
title="dom-input-value">value</code> IDL attribute in either the <i
title="dom-input-value-default">default</i> mode or the <i
title="dom-input-value-default-on">default/on</i> mode, then set
the element's <code title="attr-input-value">value</code> content
attribute to the element's <span
title="concept-fe-value">value</span>.</p></li>

<li><p>Otherwise, if the previous state of the element's <code
title="attr-input-type">type</code> attribute put the <code
title="dom-input-value">value</code> IDL attribute in any mode
other than the <i title="dom-input-value-value">value</i> mode, and
the new state of the element's <code
title="attr-input-type">type</code> attribute puts the <code
title="dom-input-value">value</code> IDL attribute in the <i
title="dom-input-value-value">value</i> mode, then set the <span
title="concept-fe-value">value</span> of the element to the value
of the <code title="attr-input-value">value</code> content
attribute, if there is one, or the empty string otherwise, and
then set the control's <span
title="concept-input-value-dirty-flag">dirty value flag</span> to
false.</p></li>

<li><p>Update the element's rendering and behavior to the new
state's.</p></li>

<li><p>Invoke the <span>value sanitization algorithm</span>, if one
is defined for the <code title="attr-input-type">type</code>
attribute's new state.</p></li>

</ol>

</div>

<hr>

<p>The <code title="attr-fae-form">form</code> attribute is used to
explicitly associate the <code>input</code> element with its
<span>form owner</span>. The <code title="attr-fe-name">name</code>
Expand Down

0 comments on commit bda43cc

Please sign in to comment.