Backed out changeset 2450366cf7ca (bug 1891629) for causing win msix mochitest failures
[gecko.git] / dom / base / test / test_serializer_noscript.html
blob156440e03a907b364841e87d46c0124b6080ac79
1 <!DOCTYPE HTML>
2 <html>
3 <head>
4 <title>Test for document.blockParsing</title>
5 <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
6 <link rel="stylesheet" href="chrome://mochikit/content/tests/SimpleTest/test.css">
7 </head>
8 <body onload=runTest();>
9 <script>
10 SimpleTest.waitForExplicitFinish();
12 function checkDoc(aDoc, aScriptState) {
13 const root = aDoc.documentElement;
14 let enc = Cu.createDocumentEncoder("text/html");
15 enc.init(
16 aDoc,
17 "text/html",
18 Ci.nsIDocumentEncoder.OutputEncodeBasicEntities |
19 Ci.nsIDocumentEncoder.OutputLFLineBreak |
20 Ci.nsIDocumentEncoder.OutputBodyOnly |
21 Ci.nsIDocumentEncoder.OutputRaw
24 let str = enc.encodeToString();
26 is(str, "<body><noscript>&lt;/noscript&gt;<img></noscript>\n</body>", "Serialization matches expectation with scripting " + aScriptState);
29 function runTest() {
30 const doc = new DOMParser().parseFromString("<body><noscript>&lt;/noscript&gt;<img></noscript>\n", "text/html");
31 checkDoc(doc, "disabled");
32 checkDoc(document.getElementsByTagName("iframe")[0].contentDocument, "enabled");
33 SimpleTest.finish();
35 </script>
36 <iframe src="file_serializer_noscript.html"></iframe>
37 </body>
38 </html>