<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>12606</bug_id>
          
          <creation_ts>2011-05-05 12:29:37 +0000</creation_ts>
          <short_desc>Form submission should convert all line breaks to CR LF pairs in field names and values</short_desc>
          <delta_ts>2011-09-06 07:23:25 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>HTML WG</product>
          <component>LC1 HTML5 spec</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows XP</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Hallvord R. M. Steen">hsteen</reporter>
          <assigned_to name="Ian &apos;Hixie&apos; Hickson">ian</assigned_to>
          <cc>annevk</cc>
    
    <cc>brunoaiss</cc>
    
    <cc>ian</cc>
    
    <cc>james</cc>
    
    <cc>mike</cc>
    
    <cc>public-html-admin</cc>
    
    <cc>public-html-wg-issue-tracking</cc>
    
    <cc>shadow2531</cc>
          
          <qa_contact name="HTML WG Bugzilla archive list">public-html-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>48082</commentid>
    <comment_count>0</comment_count>
      <attachid>985</attachid>
    <who name="Hallvord R. M. Steen">hsteen</who>
    <bug_when>2011-05-05 12:29:37 +0000</bug_when>
    <thetext>Created attachment 985
demo with fields set to CR and LF, reports .value and on submit you&apos;ll see the encoded result in the URL field

Browsers tend to normalize stray CR and LF characters to CRLF when submitting a form. The algorithm on http://www.whatwg.org/specs/web-apps/current-work/multipage/association-of-controls-and-forms.html#application/x-www-form-urlencoded-encoding-algorithm doesn&apos;t seem to special-case CR and LF at all, I believe this is required.

This applies to both textarea and input type=hidden.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>49967</commentid>
    <comment_count>1</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-06-21 06:14:51 +0000</bug_when>
    <thetext>Is the test case online anywhere for easy testing?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>50013</commentid>
    <comment_count>2</comment_count>
    <who name="Hallvord R. M. Steen">hsteen</who>
    <bug_when>2011-06-21 09:08:05 +0000</bug_when>
    <thetext>I&apos;ve put a copy on http://hallvord.com/temp/W3-12606.htm - you&apos;ll still need to look at the address bar to see what was actually sent though.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>54100</commentid>
    <comment_count>3</comment_count>
    <who name="Michael[tm] Smith">mike</who>
    <bug_when>2011-08-04 05:36:04 +0000</bug_when>
    <thetext>mass-move component to LC1</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>54615</commentid>
    <comment_count>4</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-08-10 19:18:57 +0000</bug_when>
    <thetext>For textarea this is already required, search for &quot;The element&apos;s value is defined to be the element&apos;s raw value with the following transformation applied&quot;.

Do we really want to be fiddling with JavaScript-assigned values in &lt;input type=hidden&gt;?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>55067</commentid>
    <comment_count>5</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2011-08-15 10:20:02 +0000</bug_when>
    <thetext>(If this applies to text/plain that format can be reliably decoded in theory.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>55082</commentid>
    <comment_count>6</comment_count>
    <who name="Hallvord R. M. Steen">hsteen</who>
    <bug_when>2011-08-15 13:36:44 +0000</bug_when>
    <thetext>(In reply to comment #4)
&gt; Do we really want to be fiddling with JavaScript-assigned values in &lt;input
&gt; type=hidden&gt;?

Since a vast majority of existing UAs do, I believe we should.

(Tested IE, Firefox and Chrome - all normalize JS-assigned values. Only Opera differs, it has not caused us problems that I&apos;m aware of but we intend to change anyway.)

Additionally, Firefox and Chrome normalize form element names with CRs or LFs in them. Haven&apos;t checked if this happens during parsing or submit.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>55629</commentid>
    <comment_count>7</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-08-22 23:08:01 +0000</bug_when>
    <thetext>Please file a separate bugs for the names if you want that looked at. Note that the parser _definitely_ fiddles with CR and LF, so please make sure to create everything in the DOM, not via the parser, when testing this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>55634</commentid>
    <comment_count>8</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-08-22 23:55:38 +0000</bug_when>
    <thetext>Actually nevermind. This seems to affect all names and values in a form, and it does seem to happen at submission. Also it doesn&apos;t seem limited to the  x-www-form-urlencoded type.

http://software.hixie.ch/utilities/js/live-dom-viewer/saved/1117</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>56364</commentid>
    <comment_count>9</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-09-06 07:23:01 +0000</bug_when>
    <thetext>EDITOR&apos;S RESPONSE: This is an Editor&apos;s Response to your comment. If you are satisfied with this response, please change the state of this bug to CLOSED. If you have additional information and would like the editor to reconsider, please reopen this bug. If you would like to escalate the issue to the full HTML Working Group, please add the TrackerRequest keyword to this bug, and suggest title and text for the tracker issue; or you may create a tracker issue yourself, if you are able to do so. For more details, see this document:
   http://dev.w3.org/html5/decision-policy/decision-policy.html

Status: Accepted
Change Description: see diff given below
Rationale: Made it apply all the time.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>56366</commentid>
    <comment_count>10</comment_count>
    <who name="">contributor</who>
    <bug_when>2011-09-06 07:23:25 +0000</bug_when>
    <thetext>Checked in as WHATWG revision r6542.
Check-in comment: Match reality: form submission normalises newlines.
http://html5.org/tools/web-apps-tracker?from=6541&amp;to=6542</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>985</attachid>
            <date>2011-05-05 12:29:37 +0000</date>
            <delta_ts>2011-05-05 12:29:37 +0000</delta_ts>
            <desc>demo with fields set to CR and LF, reports .value and on submit you&apos;ll see the encoded result in the URL field</desc>
            <filename>CORE-20160-tangential.htm</filename>
            <type>text/html</type>
            <size>1092</size>
            <attacher name="Hallvord R. M. Steen">hsteen</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWw+DQo8aHRtbD48aGVhZD4NCgk8dGl0bGU+IENSIGFuZCBMRiBjaGFyYWN0
ZXJzIGFzIGhpZGRlbiBpbnB1dCB2YWx1ZSBzdHJpbmdzIDwvdGl0bGU+DQo8L2hlYWQ+DQo8Ym9k
eT4NCg0KCTxwPkZBSUxFRCAoVGhpcyBUQyByZXF1aXJlcyBKYXZhU2NyaXB0IGVuYWJsZWQpPC9w
Pg0KCTxmb3JtIGFjdGlvbj0iIiBuYW1lPSJmb3JtMSI+DQoJCTxpbnB1dCB0eXBlPSJoaWRkZW4i
IG5hbWU9ImxmIj4NCgkJPGlucHV0IHR5cGU9ImhpZGRlbiIgbmFtZT0iY3IiPg0KCQk8dGV4dGFy
ZWEgbmFtZT0ibGYyIj48L3RleHRhcmVhPg0KCQk8dGV4dGFyZWEgbmFtZT0iY3IyIj48L3RleHRh
cmVhPg0KCQk8aW5wdXQgdHlwZT0ic3VibWl0Ij4NCgk8L2Zvcm0+DQoNCgk8c2NyaXB0IHR5cGU9
InRleHQvamF2YXNjcmlwdCI+DQoJDQoJZnVuY3Rpb24gdGVzdCgpew0KCQl2YXIgbG9nPWRvY3Vt
ZW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