This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
Created attachment 985 [details] demo with fields set to CR and LF, reports .value and on submit you'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't seem to special-case CR and LF at all, I believe this is required. This applies to both textarea and input type=hidden.
Is the test case online anywhere for easy testing?
I've put a copy on http://hallvord.com/temp/W3-12606.htm - you'll still need to look at the address bar to see what was actually sent though.
mass-move component to LC1
For textarea this is already required, search for "The element's value is defined to be the element's raw value with the following transformation applied". Do we really want to be fiddling with JavaScript-assigned values in <input type=hidden>?
(If this applies to text/plain that format can be reliably decoded in theory.)
(In reply to comment #4) > Do we really want to be fiddling with JavaScript-assigned values in <input > type=hidden>? 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'm aware of but we intend to change anyway.) Additionally, Firefox and Chrome normalize form element names with CRs or LFs in them. Haven't checked if this happens during parsing or submit.
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.
Actually nevermind. This seems to affect all names and values in a form, and it does seem to happen at submission. Also it doesn't seem limited to the x-www-form-urlencoded type. http://software.hixie.ch/utilities/js/live-dom-viewer/saved/1117
EDITOR'S RESPONSE: This is an Editor'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.
Checked in as WHATWG revision r6542. Check-in comment: Match reality: form submission normalises newlines. http://html5.org/tools/web-apps-tracker?from=6541&to=6542