| <script src="../../resources/js-test.js"></script> |
| description("Tests that javascript URL execute in the right context when set as href on an anchor with a target frame."); |
| function didRunJSURLInContext(_contextName) |
| contextName = _contextName; |
| // Since the anchor has target="testFrame", the javascript URL should execute in the context of the testFrame, not the top frame. |
| shouldBeEqualToString("contextName", "testFrame"); |
| window.name = "topWindow"; |
| document.getElementById("testAnchor").click(); |
| <iframe id="testFrame" name="testFrame"></iframe> |
| <a id="testAnchor" target="testFrame" href="javascript:top.didRunJSURLInContext(window.name);" style="display:none">Click me</a> |