blob: 5151ab612c4525bfafba8a148f0da2fd6b3c08c1 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script src="../../resources/js-test-pre.js"></script>
</head>
<body>
<script>
description("Tests setting document.body");
iframe1 = document.createElement('iframe');
document.body.appendChild(iframe1);
document1 = iframe1.contentDocument.implementation.createHTMLDocument("document");
shouldThrow("document1.body = iframe1", "'Error: HierarchyRequestError: DOM Exception 3'");
shouldBe("iframe1.parentNode", "document.body");
shouldThrow("document1.body = document1.createElement('iframe')", "'Error: HierarchyRequestError: DOM Exception 3'");
document1.body = document.body;
shouldBeTrue("document1.body != document.body");
body1 = document1.createElement('body');
document1.body = body1;
shouldBe("document1.body", "body1")
</script>
<script src="../../resources/js-test-post.js"></script>
</body>
</html>