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 () { console.log('PASS'); }; | 9 script.onerror = function () { window.top.done(); }; |
10 document.body.appendChild(script); | 10 document.body.appendChild(script); |
11 window.top.document.adoptNode(document.documentElement); | 11 var contextDoc = window.top.document.implementation.createDocument("", null)
; |
12 | 12 contextDoc.adoptNode(document.documentElement); |
13 window.top.done(); | |
14 } | 13 } |
15 | 14 |
16 init(); | 15 init(); |
17 </script> | 16 </script> |
18 </body> | 17 </body> |
19 </html> | 18 </html> |
OLD | NEW |