- From: ziyunfei <notifications@github.com>
- Date: Wed, 11 May 2016 22:02:51 -0700
- To: whatwg/url <url@noreply.github.com>
- Cc:
- Message-ID: <whatwg/url/issues/18/218660942@github.com>
@annevk Both Firefox and Chrome escape \r and \n to "%0D%0A" when form submitting, should this spec align with them? screenshot: ![](http://img.alicdn.com/tps/i1/TB12UBcJVXXXXcMXXXXdoWgTFXX-1180-1468.png) test script: ``` for (let i = 0; i < 128; i++) { let iframe = document.createElement("iframe") iframe.src = navigator.vendor === "Google Inc." ? "/" : "data:text/html,bar" iframe.onload = function() { iframe.contentDocument.body.innerHTML = ` <form id=form> <textarea id=textarea name=name></textarea> </form> ` let char = String.fromCodePoint(i) iframe.contentWindow.textarea.value = char iframe.onload = function() { let htmlFormEncoded = iframe.contentWindow.location.href.split("name=")[1] let paramsObject = new URLSearchParams() paramsObject.set("", char) let URLSearchParamsSerialized = paramsObject.toString().slice(1) if (htmlFormEncoded !== URLSearchParamsSerialized) { console.error(`${URLSearchParamsSerialized} vs ${htmlFormEncoded}`) } } iframe.contentWindow.form.submit() } document.body.appendChild(iframe) } --- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/whatwg/url/issues/18#issuecomment-218660942
Received on Thursday, 12 May 2016 05:03:25 UTC