OLD | NEW |
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <script src="../js/resources/js-test-pre.js"></script> | 4 <script src="../js/resources/js-test-pre.js"></script> |
5 </head> | 5 </head> |
6 <body> | 6 <body> |
7 <script> | 7 <script> |
8 description("Tests setting document.body"); | 8 description("Tests setting document.body"); |
9 | 9 |
10 iframe1 = document.createElement('iframe'); | 10 iframe1 = document.createElement('iframe'); |
11 document.body.appendChild(iframe1); | 11 document.body.appendChild(iframe1); |
12 document1 = iframe1.contentDocument.implementation.createHTMLDocument("document"
); | 12 document1 = iframe1.contentDocument.implementation.createHTMLDocument("document"
); |
13 | 13 |
14 shouldThrow("document1.body = iframe1", "'Error: HierarchyRequestError: DOM Exce
ption 3'"); | 14 shouldThrow("document1.body = iframe1", "'HierarchyRequestError: A Node was inse
rted somewhere it doesn\\'t belong.'"); |
15 shouldBe("iframe1.parentNode", "document.body"); | 15 shouldBe("iframe1.parentNode", "document.body"); |
16 | 16 |
17 shouldThrow("document1.body = document1.createElement('iframe')", "'Error: Hiera
rchyRequestError: DOM Exception 3'"); | 17 shouldThrow("document1.body = document1.createElement('iframe')", "'HierarchyReq
uestError: A Node was inserted somewhere it doesn\\'t belong.'"); |
18 | 18 |
19 document1.body = document.body; | 19 document1.body = document.body; |
20 shouldBeTrue("document1.body != document.body"); | 20 shouldBeTrue("document1.body != document.body"); |
21 | 21 |
22 body1 = document1.createElement('body'); | 22 body1 = document1.createElement('body'); |
23 document1.body = body1; | 23 document1.body = body1; |
24 shouldBe("document1.body", "body1") | 24 shouldBe("document1.body", "body1") |
25 </script> | 25 </script> |
26 <script src="../js/resources/js-test-post.js"></script> | 26 <script src="../js/resources/js-test-post.js"></script> |
27 </body> | 27 </body> |
28 </html> | 28 </html> |
OLD | NEW |