| <!DOCTYPE html> |
| <html> |
| <head> |
| <script> |
| if (window.testRunner) { |
| testRunner.dumpAsText(); |
| testRunner.waitUntilDone(); |
| } |
| </script> |
| </head> |
| <body> |
| <p>Adding 'viewsource' to a frame after a document has loaded should not |
| block JavaScript URL execution in the already-loaded document.</p> |
| <iframe srcdoc=" |
| <script> |
| window.onload = function() { |
| window.parent.document.querySelector('iframe').setAttribute('viewsource', ''); |
| |
| document.querySelector('a').click(); |
| |
| alert(calledFunction ? 'PASS: Function called.' : 'FAIL: Function not called.'); |
| |
| if (window.testRunner) |
| testRunner.notifyDone(); |
| }; |
| |
| var calledFunction = false; |
| function pass() { |
| calledFunction = true; |
| } |
| </script> |
| <a href='javascript:pass();'>Yay!</a>"></iframe> |
| </body> |
| </html> |