Last active
December 30, 2015 16:29
-
-
Save sideshowbarker/7855058 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE HTML> | |
<meta charset="utf-8"> | |
<title>Pathological case for resolution of base URIs with javascript: in iframes (javascript:location.assign)</title> | |
<script src="/resources/testharness.js"></script> | |
<script src="/resources/testharnessreport.js"></script> | |
<div id=log></div> | |
<base href="/html/browsers/browsing-the-web/navigating-across-documents/javascript-protocol"> | |
<body onload="frames[0].location = 'javascript:location.assign("test.txt")'"> | |
<iframe onload="frameLoaded()" | |
src="/html/browsers/browsing-the-web/navigating-across-documents/javascript-protocol/inner-address/inner.html"></iframe> | |
<script> | |
var t = async_test("base URIs with javascript: in iframes (javascript:location.assign)") | |
, expectedPathname = "/html/browsers/browsing-the-web/navigating-across-documents/javascript-protocol/inner-address/test.txt" | |
, pathname | |
, count = 0; | |
function frameLoaded() { | |
count++; | |
if (count > 1) { | |
t.step(function () { | |
pathname = document.querySelector("iframe").contentWindow.location.pathname; | |
assert_equals(pathname, expectedPathname); | |
} | |
); | |
t.done(); | |
} | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment