Auto merge of #10953 - KiChjang:text-plain-encoding, r=jdm

Implement text/plain form encoding

Fixes #3649.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10953)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2016-05-11 19:43:37 -07:00
commit 641b374f0b
3 changed files with 67 additions and 7 deletions

View file

@ -18,6 +18,13 @@ var simple_tests = [
submitelement: "",
submitaction: function(doc) { doc.getElementById("testform").submit(); }
},
{
name: "form submission from form should navigate to url with text/plain",
input: "<textarea name=qux>baz</textarea>",
enctype: "text/plain",
submitelement: "",
submitaction: function(doc) { doc.getElementById("testform").submit(); }
},
{
name: "form submission from button should navigate to url with x-www-form-urlencoded",
input: "<input name=foo value=bara>",
@ -32,6 +39,13 @@ var simple_tests = [
submitelement: "<button id=buttonsubmit type=\"submit\">Submit</button>",
submitaction: function(doc) { doc.getElementById("buttonsubmit").click(); }
},
{
name: "form submission from button should navigate to url with text/plain",
input: "<textarea name=qux>baz</textarea>",
enctype: "text/plain",
submitelement: "<button id=buttonsubmit type=\"submit\">Submit</button>",
submitaction: function(doc) { doc.getElementById("buttonsubmit").click(); }
},
{
name: "form submission from input should navigate to url with x-www-form-urlencoded",
input: "<input name=foo value=bara>",
@ -46,6 +60,13 @@ var simple_tests = [
submitelement: "<input id=inputsubmit type=\"submit\">Submit</input>",
submitaction: function(doc) { doc.getElementById("inputsubmit").click(); }
},
{
name: "form submission from input should navigate to url with text/plain",
input: "<input name=qux value=baz>",
enctype: "text/plain",
submitelement: "<input id=inputsubmit type=\"submit\">Submit</input>",
submitaction: function(doc) { doc.getElementById("inputsubmit").click(); }
}
];
simple_tests.forEach(function(test_obj) {
test_obj.test = async_test(test_obj.name);