gecko-dev/dom/base/test/test_bug1384661.html

50 строки
1.3 KiB
HTML

<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=1384661
-->
<head>
<meta charset="utf-8">
<title>Test for Bug 1384661</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript">
/** Test for Bug 1384661 **/
SimpleTest.waitForExplicitFinish();
function runTest() {
for (var p in document) {
typeof(document[p]);
}
// Overwrite document
var doc = document.implementation.createDocument(null, 'xml', null);
doc.load("");
var str = new XMLSerializer().serializeToString(doc);
document.write(str);
// Check if childNodes of overwritten document is changed accordingly
is(document.childNodes.length, 0,
"childNodes.length of overwritten document should be 0");
is(document.childNodes[0], undefined,
"childNodes[0] of overwritten document should be undefined");
SimpleTest.finish();
}
</script>
</head>
<body onload="runTest()">
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1384661">Mozilla Bug 1384661</a>
<p id="display"></p>
<div id="content" style="display: none">
</div>
<pre id="test">
</pre>
</body>
</html>