hixie: Define what happens when the type= of an <input> changes. (whatwg r5376)

hixie: Define what happens when the type= of an <input> changes. (whatwg
r5376)

http://dev.w3.org/cvsweb/html5/spec/Overview.html?r1=1.4290&r2=1.4291&f=h
http://html5.org/tools/web-apps-tracker?from=5375&to=5376

===================================================================
RCS file: /sources/public/html5/spec/Overview.html,v
retrieving revision 1.4290
retrieving revision 1.4291
diff -u -d -r1.4290 -r1.4291
--- Overview.html 27 Aug 2010 21:10:09 -0000 1.4290
+++ Overview.html 27 Aug 2010 21:50:55 -0000 1.4291
@@ -28499,12 +28499,8 @@
 
   </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
@@ -28530,7 +28526,7 @@
   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
@@ -28590,7 +28586,40 @@
   <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>
 
-  </div><p>The <code title="attr-fae-form"><a href="#attr-fae-form">form</a></code> attribute is used to
+  <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><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

Received on Friday, 27 August 2010 21:51:50 UTC