HTML Standard Tracker

Diff (omit for latest revision)
Filter

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

File a bug

SVNBugCommentTime (UTC)
681513983[Gecko] [Internet Explorer] [Opera] [Webkit] compat changes for <textarea>.value and .textLength2011-11-03 17:06
Index: source
===================================================================
--- source	(revision 6814)
+++ source	(revision 6815)
@@ -56071,6 +56071,38 @@
 
   <div class="impl">
 
+  <p>For historical reasons, the element's value is normalised in
+  three different ways for three different purposes. The <span
+  title="concept-textarea-raw-value">raw value</span> is the value as
+  it was originally set. It is not normalized. The <span
+  title="concept-textarea-api-value">API value</span> is the value
+  used in the <code title="dom-textarea-value">value</code> IDL
+  attribute. It is normalized so that line breaks use U+000A LINE FEED
+  (LF) characters. Finally, there is the form submission <span
+  title="concept-fe-value">value</span>. It is normalized so that line
+  breaks use U+000D CARRIAGE RETURN U+000A LINE FEED (CRLF) character
+  pairs, and in addition, if necessary given the element's <code
+  title="attr-textarea-wrap">wrap</code> attribute, additional line
+  breaks are inserted to wrap the text at the given width.</p>
+
+  <p>The element's <dfn title="concept-textarea-api-value">API
+  value</dfn> 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 U+000D CARRIAGE RETURN U+000A LINE FEED (CRLF)
+   character pair from the <span
+   title="concept-textarea-raw-value">raw value</span> with a single
+   U+000A LINE FEED (CRLF) character.</p></li>
+
+   <li><p>Replace every remaining U+000D CARRIAGE RETURN character from
+   the <span title="concept-textarea-raw-value">raw value</span> with
+   a single U+000A LINE FEED (CRLF) character.</p></li>
+
+  </ol>
+
   <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
@@ -56228,7 +56260,7 @@
 
   <p>The <dfn title="dom-textarea-value"><code>value</code></dfn>
   attribute must, on getting, return the element's <span
-  title="concept-textarea-raw-value">raw value</span>; on setting, it
+  title="concept-textarea-api-value">API value</span>; on setting, it
   must set the element's <span title="concept-textarea-raw-value">raw
   value</span> to the new value, set the element's <span
   title="concept-textarea-dirty">dirty value flag</span> to true, and
@@ -56239,7 +56271,8 @@
   <p>The <dfn
   title="dom-textarea-textLength"><code>textLength</code></dfn> IDL
   attribute must return the <span>code-point length</span> of the
-  element's <span title="concept-fe-value">value</span>.</p>
+  element's <span title="concept-textarea-api-value">API
+  value</span>.</p>
 
   <p>The <code title="dom-cva-willValidate">willValidate</code>, <code
   title="dom-cva-validity">validity</code>, and <code

|