OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <script src="/js-test-resources/js-test-pre.js"></script> | 2 <script src="/js-test-resources/js-test-pre.js"></script> |
3 <script> | 3 <script> |
4 | |
5 description('Tests that cloned documents do not share the underlying domain'); | 4 description('Tests that cloned documents do not share the underlying domain'); |
| 5 if (window.internals) |
| 6 window.internals.settings.setTreatIPAddressAsDomain(true); |
6 | 7 |
7 var doc = document.cloneNode(true); | 8 var doc = document.cloneNode(true); |
8 var doc2 = doc.cloneNode(true); | |
9 shouldBeEqualToString('document.domain', '127.0.0.1'); | 9 shouldBeEqualToString('document.domain', '127.0.0.1'); |
10 shouldBeEqualToString('doc.domain', '127.0.0.1'); | 10 shouldBeEqualToString('doc.domain', '127.0.0.1'); |
11 shouldBeEqualToString('doc2.domain', '127.0.0.1'); | |
12 | |
13 doc.domain = '0.0.1'; | |
14 shouldBeEqualToString('document.domain', '127.0.0.1'); | |
15 shouldBeEqualToString('doc.domain', '0.0.1'); | |
16 shouldBeEqualToString('doc2.domain', '127.0.0.1'); | |
17 | 11 |
18 document.domain = '0.1'; | 12 document.domain = '0.1'; |
19 shouldBeEqualToString('document.domain', '0.1'); | 13 shouldBeEqualToString('document.domain', '0.1'); |
20 shouldBeEqualToString('doc.domain', '0.0.1'); | 14 shouldBeEqualToString('doc.domain', '127.0.0.1'); |
21 shouldBeEqualToString('doc2.domain', '127.0.0.1'); | |
22 | |
23 doc2.domain = '1'; | |
24 shouldBeEqualToString('document.domain', '0.1'); | |
25 shouldBeEqualToString('doc.domain', '0.0.1'); | |
26 shouldBeEqualToString('doc2.domain', '1'); | |
27 | |
28 </script> | 15 </script> |
29 <script src="/js-test-resources/js-test-post.js"></script> | 16 <script src="/js-test-resources/js-test-post.js"></script> |
30 </html> | 17 </html> |
OLD | NEW |