blob: c10e70aa38d30a008fb4f5016bd6054991149ccf [file] [log] [blame]
Philip Jägenstedtc053f402014-01-22 17:02:181<!doctype html>
Anne van Kesteren775e5102017-03-31 11:41:052<title>XMLHttpRequest: send() - Document with serialization errors</title>
3<script src="/resources/testharness.js"></script>
4<script src="/resources/testharnessreport.js"></script>
5<div id="log"></div>
6<script>
7function serialize(input, output) {
8 async_test(t => {
9 const client = new XMLHttpRequest
10 client.open("POST", "resources/content.py")
11 client.send(input)
12 client.onload = t.step_func_done(() => {
13 assert_equals(client.responseText, output)
14 })
15 }, "Serializing documents through XMLHttpRequest: '" + output + "'")
16}
17
18var doc = document.implementation.createDocument(null, null, null)
19serialize(doc, "")
20doc.appendChild(doc.createElement("test:test"))
21serialize(doc, "<test:test/>")
22doc.childNodes[0].setAttribute("test:test", "gee")
23serialize(doc, "<test:test test:test=\"gee\"/>")
24doc.childNodes[0].setAttribute("x", "\uD800")
25serialize(doc, "<test:test test:test=\"gee\" x=\"\uFFFD\"/>")
26</script>