HTML Standard Tracker

Diff (omit for latest revision)
Filter

Short URL: http://html5.org/r/2204

File a bug

SVNBugCommentTime (UTC)
2204WF2: Begin defining value='' for <input type=text>2008-09-17 10:23
Index: source
===================================================================
--- source	(revision 2203)
+++ source	(revision 2204)
@@ -24473,9 +24473,8 @@
   title="attr-input-required">required</code>, <code
   title="attr-input-size">size</code>, <code
   title="attr-input-src">src</code>, <code
-  title="attr-input-step">step</code>, <code
-  title="attr-fs-target">target</code>, and <code
-  title="attr-input-value">value</code> attributes apply to an
+  title="attr-input-step">step</code>, and <code
+  title="attr-fs-target">target</code> attributes apply to an
   <code>input</code> element depends on the state of its <code
   title="attr-input-type">type</code> attribute. Similarly, the <code
   title="dom-input-checked">checked</code>, <code
@@ -24488,8 +24487,33 @@
   and <code title="dom-input-stepDown">stepDown()</code> methods, are
   specific to certain states.</p>
 
-  <hr>
+  <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 <dfn>control
+  initialization</dfn> algorithm defined for the <code
+  title="attr-input-type">type</code> attribute's state at the time
+  must be invoked and the element's rendering and behaviour must
+  change accordingly.</p>
 
+  <p>Each <code>input</code> element has a <span
+  title="concept-fe-value">value</span>.</p>
+
+  <p>Each <code>input</code> element has a boolean <dfn>dirty
+  flag</dfn>, which must be initially set to false when the element is
+  created, and which must be set to true whenever the user interacts
+  with the control in a way that changes the <span
+  title="concept-fe-value">value</span>.</p>
+
+  <p>The <dfn title="attr-input-value"><code>value</code></dfn>
+  content attribute gives the default <span
+  title="concept-fe-value">value</span> of the <code>input</code>
+  element. When the <code title="attr-input-value">value</code>
+  content attribute is added, set, or removed, and when the element is
+  first created, after invoking the <span>control
+  initialization</span> algorithm, the <dfn>default value change</dfn>
+  algorithm defined for the <code title="attr-input-type">type</code>
+  attribute's state at the time must be invoked.</p>
+
   <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>
@@ -24547,6 +24571,36 @@
   or has an invalid value, it is in the <span
   title="attr-input-type-text">Text</span> state.</p>
 
+  <p>When an <code>input</code> element's <code
+  title="attr-input-type">type</code> attribute is in the <span
+  title="attr-input-type-text">Text</span> state, it represents a text
+  edit control for a single line of plain text.</p>
+
+  <p><strong>The <span title="attr-input-type-text">Text</span>
+  state's <span>control initialization</span> algorithm is as
+  follows:</strong> Run the <span>line feed stripper</span>
+  algorithm.</p>
+
+  <p><strong>The <span title="attr-input-type-text">Text</span>
+  state's <span>default value change</span> algorithm is as
+  follows:</strong> If the <code>input</code> element is not
+  <span>dirty</span> 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
+  and run the <span>line feed stripper</span> algorithm.</p>
+
+  <p>The <dfn>line feed stripper</dfn> algorithm consists of removing
+  any U+000A LINE FEED (LF) characters from <span
+  title="concept-fe-value">value</span>.</p>
+
+  <p>User agents must not allow users to insert U+000A LINE FEED (LF)
+  characters into the <span title="concept-fe-value">value</span> of
+  an <code>input</code> element whose <code
+  title="attr-input-type">type</code> attribute is in the <span
+  title="attr-input-type-text">Text</span> state.</p>
+
+  <!-- XXX allow users to edit, when not disabled or readonly -->
+
   <p class="big-issue">...</p>
 
   <p>When an <code>input</code> element's <code

|