HTML Standard Tracker

Diff (omit for latest revision)
Filter

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

File a bug

SVNBugCommentTime (UTC)
2310WF2: <textarea wrap=''> and related fallout.2008-10-09 20:32
Index: source
===================================================================
--- source	(revision 2309)
+++ source	(revision 2310)
@@ -30126,18 +30126,13 @@
   <!-- XXX add selectionStart and company -->
 
   <p>The <code>textarea</code> element represents a multiline plain
-  text edit control for the element's <span
-  title="concept-fe-value">value</span>. The contents of the control
-  represent the control's default value.</p>
+  text edit control for the element's <dfn
+  title="concept-textarea-raw-value">raw value</dfn>. The contents of
+  the control represent the control's default value.</p>
 
-  <p><em>Whenever</em> the element's <span
-  title="concept-fe-value">value</span> is set or changed, for
-  whatever reason, every occurance of a U+000D CARRIAGE RETURN (CR)
-  character not followed by a U+000A LINE FEED (LF) character, and
-  every occurance of a U+000A LINE FEED (LF) character not proceeded
-  by a U+000D CARRIAGE RETURN (CR) character, must be replaced the
-  two-character string consisting of a U+000D CARRIAGE RETURN - U+000A
-  LINE FEED (CRLF) character pair.</p>
+  <p>The <span title="concept-textarea-raw-value">raw value</span> of
+  a <code>textarea</code> control must be initially the empty
+  string.</p>
 
   <p>The <dfn
   title="attr-textarea-readonly"><code>readonly</code></dfn> attribute
@@ -30157,26 +30152,27 @@
 
   <p>When a <code>textarea</code> is <span
   title="concept-textarea-mutable">mutable</span>, its <span
-  title="concept-fe-value">value</span> should be editable by the
-  user.</p>
+  title="concept-textarea-raw-value">raw value</span> should be
+  editable by the user.</p>
 
   <p>A <code>textarea</code> element has a <dfn
   title="concept-textarea-dirty">dirty value flag</dfn>, which must be
   initially set to false, and 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>
+  title="concept-textarea-raw-value">raw value</span>.</p>
 
   <p>When the <code>textarea</code> element's <code>textContent</code>
   DOM attribute changes value, if the element's <span
   title="concept-textarea-dirty">dirty value flag</span> is false,
-  then the element's <span title="concept-fe-value">value</span> must
-  be set to the value of the element's <code>textContent</code> DOM
-  attribute.</p>
+  then the element's <span title="concept-textarea-raw-value">raw
+  value</span> must be set to the value of the element's
+  <code>textContent</code> DOM attribute.</p>
 
   <p>The <span title="concept-form-reset-control">reset
   algorithm</span> for <code>textarea</code> elements is to set the
-  element's <span title="concept-fe-value">value</span> to the value
-  of the element's <code>textContent</code> DOM attribute.</p>
+  element's <span title="concept-textarea-raw-value">value</span> to
+  the value of the element's <code>textContent</code> DOM
+  attribute.</p>
 
   <p>The <dfn title="attr-textarea-cols"><code>cols</code></dfn>
   attribute specifies the expected maximum number of characters per
@@ -30184,22 +30180,78 @@
   is specified, its value must be a <span>valid non-negative
   integer</span> greater than zero. If applying the <span>rules for
   parsing non-negative integers</span> to the attribute's value
-  results in a number greater than zero, then the user agent may use
-  that number as a hint to the user as to how many characters the
-  server prefers per line (e.g. for visual user agents by making the
-  width of the control be that many characters).</p>
+  results in a number greater than zero, then the element's <dfn
+  title="attr-textarea-cols-value">character width</dfn> is that value;
+  otherwise, it is 20.</p>
 
+  <p>The user agent may use the <code>textarea</code> element's <span
+  title="attr-textarea-cols-value">character width</span> as a hint to
+  the user as to how many characters the server prefers per line
+  (e.g. for visual user agents by making the width of the control be
+  that many characters). In visual renderings, the user agent should
+  wrap the user's input in the rendering so that each line is no wider
+  than this number of characters.</p>
+
   <p>The <dfn title="attr-textarea-rows"><code>rows</code></dfn>
   attribute specifies the number of lines to show. If the <code
   title="attr-textarea-rows">rows</code> attribute is specified, its
   value must be a <span>valid non-negative integer</span> greater than
   zero. If applying the <span>rules for parsing non-negative
   integers</span> to the attribute's value results in a number greater
-  than zero, then visual user agents should set the height of the
-  control to the specified number of lines.</p>
+  than zero, then the element's <dfn
+  title="attr-textarea-rows-value">character height</dfn> is that
+  value; otherwise, it is 2.</p>
 
-  <p class="XXX"> ... <dfn title="attr-textarea-wrap"><code>wrap</code></dfn>
+  <p>Visual user agents should set the height of the control to the
+  number of lines given by <span
+  title="attr-textarea-rows-value">character height</span>.</p>
 
+  <p>The <dfn title="attr-textarea-wrap"><code>wrap</code></dfn>
+  attribute is an <span>enumerated attribute</span> with two keywords
+  and states: the <dfn
+  title="attr-textarea-wrap-soft"><code>soft</code></dfn> keyword
+  which maps to the <dfn
+  title="attr-textarea-wrap-soft-state">Soft</dfn> state, and the the
+  <dfn title="attr-textarea-wrap-hard"><code>hard</code></dfn> keyword
+  which maps to the <dfn
+  title="attr-textarea-wrap-hard-state">Hard</dfn> state. The
+  <i>missing value default</i> is the <span
+  title="attr-textarea-wrap-soft-state">Soft</span> state.</p>
+
+  <p>If the element's <code title="attr-textarea-wrap">wrap</code>
+  attribute is in the <span
+  title="attr-textarea-wrap-hard-state">Hard</span> state, the <code
+  title="attr-textarea-cols">cols</code> attribute must be
+  specified.</p>
+
+  <p>The element's <span title="concept-fe-value">value</span> is
+  defined to be the element's <span
+  title="concept-textarea-raw-value">raw value</span> with the
+  following transformation applied:</p>
+
+  <ol>
+
+   <li><p>Replace every occurance of a U+000D CARRIAGE RETURN (CR)
+   character not followed by a U+000A LINE FEED (LF) character, and
+   every occurance of a U+000A LINE FEED (LF) character not proceeded
+   by a U+000D CARRIAGE RETURN (CR) character, by a two-character
+   string consisting of a U+000D CARRIAGE RETURN - U+000A LINE FEED
+   (CRLF) character pair.</p></li>
+
+   <li><p>If the element's <code
+   title="attr-textarea-wrap">wrap</code> attribute is in the <span
+   title="attr-textarea-wrap-hard-state">Hard</span> state, insert
+   U+000D CARRIAGE RETURN - U+000A LINE FEED (CRLF) character pairs
+   into the string using a UA-defined algorithm so that each line so
+   that each line has no more than <span
+   title="attr-textarea-cols-value">character width</span>
+   characters. The the purposes of this requirement, lines are
+   delimited by the start of the string, the end of the string, and
+   U+000D CARRIAGE RETURN - U+000A LINE FEED (CRLF) character
+   pairs.</p></li>
+
+  </ol>
+
   <p class="XXX"> ... <dfn title="attr-textarea-maxlength"><code>maxlength</code></dfn>
 
   <p class="XXX"> ... <dfn title="attr-textarea-required"><code>required</code></dfn>

|