| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <script src="resources/recv.js"></script> | 4 <script src="resources/recv.js"></script> |
| 5 <script> | 5 <script> |
| 6 if (window.testRunner) { | 6 if (window.testRunner) { |
| 7 testRunner.dumpAsText(); | 7 testRunner.dumpAsText(); |
| 8 testRunner.waitUntilDone(); | 8 testRunner.waitUntilDone(); |
| 9 } | 9 } |
| 10 | 10 |
| 11 if (window.internals) |
| 12 internals.settings.setTreatIPAddressAsDomain(true); |
| 13 |
| 11 addEventListener("message", recv, false); | 14 addEventListener("message", recv, false); |
| 12 | 15 |
| 13 function test() { | 16 function test() { |
| 14 var iframe = document.getElementById('child'); | 17 var iframe = document.getElementById('child'); |
| 15 var win = iframe.contentWindow; | 18 var win = iframe.contentWindow; |
| 16 win.postMessage('Message from parent', '*'); | 19 win.postMessage('Message from parent', '*'); |
| 17 | 20 |
| 18 win.postMessage('done', '*'); | 21 win.postMessage('done', '*'); |
| 19 } | 22 } |
| 20 | 23 |
| 21 document.domain = "0.0.1"; | 24 document.domain = "0.0.1"; |
| 22 </script> | 25 </script> |
| 23 <body> | 26 <body> |
| 24 <div>window.location.href = <script>document.write(window.location.href);</scrip
t></div> | 27 <div>window.location.href = <script>document.write(window.location.href);</scrip
t></div> |
| 25 <div>document.domain = <script>document.write(document.domain);</script></div> | 28 <div>document.domain = <script>document.write(document.domain);</script></div> |
| 26 <div><iframe src="http://localhost:8000/security/postMessage/resources/post-mess
age-listener.html" id="child" width="800" height="300" | 29 <div><iframe src="http://localhost:8000/security/postMessage/resources/post-mess
age-listener.html" id="child" width="800" height="300" |
| 27 style="border: 1px solid black;" onload="test()"> | 30 style="border: 1px solid black;" onload="test()"> |
| 28 </iframe></div> | 31 </iframe></div> |
| 29 <div id="result">waiting...</div> | 32 <div id="result">waiting...</div> |
| 30 </body> | 33 </body> |
| 31 </html> | 34 </html> |
| OLD | NEW |