| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <body> | 3 <body> |
| 4 <script> | 4 <script> |
| 5 function init() | 5 function init() |
| 6 { | 6 { |
| 7 var script = document.createElement("script"); | 7 var script = document.createElement("script"); |
| 8 script.src = "does-not-exist.js"; | 8 script.src = "does-not-exist.js"; |
| 9 script.onerror = function () { window.top.done(); }; | 9 script.onerror = function () { window.top.done(); }; |
| 10 document.body.appendChild(script); | 10 document.body.appendChild(script); |
| 11 var contextDoc = window.top.document.implementation.createDocument("", null)
; | 11 // otherDoc's contextDocument is document. |
| 12 contextDoc.adoptNode(document.documentElement); | 12 var otherDoc = document.implementation.createDocument("", "a", null); |
| 13 var divElement = otherDoc.createElement("div"); |
| 14 divElement.appendChild(script); |
| 15 document.body.appendChild(script); |
| 13 } | 16 } |
| 14 | 17 |
| 15 init(); | 18 init(); |
| 16 </script> | 19 </script> |
| 17 </body> | 20 </body> |
| 18 </html> | 21 </html> |
| OLD | NEW |