| <!DOCTYPE html> |
| <body> |
| <div onclick="console.log('clicked')">DOM wrappers should not leak across world boundaries via onevent attributes</div> |
| <script> |
| testRunner.dumpAsText(); |
| document.onload = document; |
| testRunner.evaluateScriptInIsolatedWorld(1, |
| 'if (document.onload === null) {' + |
| ' console.log("PASS: Main world object not visible in isolated world");' + |
| '} else {' + |
| ' console.log("FAIL: Main world object visible in isolated world!");' + |
| '}' + |
| 'document.onload = document;' + |
| 'if (document.onload === document) {' + |
| ' console.log("PASS: Got back isolated world wrapper");' + |
| '} else {' + |
| ' console.log("FAIL! Got back:");' + |
| ' console.log(document.onload);' + |
| '}' + |
| 'if (document.querySelector("div").onclick === null) {' + |
| ' console.log("PASS: Declarative onclick handler did not leak to the isolated world");' + |
| '} else {' + |
| ' console.log("FAIL: onclick handler leaked to isolated world");' + |
| '}' |
| ); |
| if (document.onload === document) { |
| console.log("PASS: Got back main world wrapper"); |
| } else { |
| console.log("FAIL! Got back:"); |
| console.log(document.onload); |
| } |
| </script> |
| </body> |