4 https://bugzilla.mozilla.org/show_bug.cgi?id=417384
7 <title>Test for Bug
417384</title>
8 <script type=
"text/javascript" src=
"/MochiKit/MochiKit.js"></script>
9 <script type=
"text/javascript" src=
"/tests/SimpleTest/SimpleTest.js"></script>
10 <link rel=
"stylesheet" type=
"text/css" href=
"/tests/SimpleTest/test.css" />
13 <a target=
"_blank" href=
"https://bugzilla.mozilla.org/show_bug.cgi?id=417384">Mozilla Bug
417384</a>
15 <div id=
"content" style=
"display: none">
19 <script class=
"testbody" type=
"text/javascript">
21 /** Test for Bug
417384 **/
23 var expectedSerialization =
"about:blank document";
24 function testSerializer() {
25 netscape.security.PrivilegeManager.enablePrivilege(
"UniversalXPConnect");
27 var doc = document.getElementById('test_iframe').contentDocument;
28 doc.body.textContent = expectedSerialization;
29 var head1 = doc.createElement(
"head");
30 doc.body.appendChild(head1);
31 var span = doc.createElement(
"span");
32 head1.appendChild(span);
33 span.appendChild(doc.createTextNode(
"before inner head\n"));
34 span.appendChild(doc.createElement(
"head"));
35 span.appendChild(doc.createTextNode(
"\nafter inner head"));
38 Components.classes[
"@mozilla.org/layout/documentEncoder;1?type=text/html"]
39 .createInstance(Components.interfaces.nsIDocumentEncoder);
40 encoder.init(doc,
"text/plain",
0);
41 encoder.setCharset(
"UTF-8");
42 var out = encoder.encodeToString();
43 ok(out == expectedSerialization,
"Wrong serialization!");
46 SimpleTest.waitForExplicitFinish();
47 addLoadEvent(testSerializer);
48 addLoadEvent(SimpleTest.finish);
52 <iframe id=
"test_iframe" src=
"about:blank"></iframe>