blob: 3d2386c93aef85ed9069b351b4de89d4d2e833f3 [file] [log] [blame]
ddkilzer@apple.coma6df9992009-03-24 21:40:24 +00001<html>
2<head>
mark.lam@apple.com93720da2013-09-07 23:31:07 +00003<script src="../../resources/js-test-pre.js"></script>
ddkilzer@apple.coma6df9992009-03-24 21:40:24 +00004<script>
rniwa@webkit.orgea3cf922012-06-22 06:52:33 +00005if (window.testRunner) {
6 testRunner.dumpAsText();
7 testRunner.waitUntilDone();
ddkilzer@apple.coma6df9992009-03-24 21:40:24 +00008}
9
10var iframeHasLoadedFirstPage = false;
11
12function runTest()
13{
14 if (!iframeHasLoadedFirstPage) {
15 iframeHasLoadedFirstPage = true;
16
17 shouldBe("document.getElementById('theFrame').contentDocument.baseURI", "'about:blank'");
18 var iframe = document.getElementById('theFrame');
19 iframe.src = "javascript:document.location.replace('./resources/iframe-no-src-set-location-pass.html')";
20 } else {
21 shouldBe("document.getElementById('theFrame').contentDocument.body.innerHTML", "'PASS\\n'");
22
23 isSuccessfullyParsed();
24
rniwa@webkit.orgea3cf922012-06-22 06:52:33 +000025 if (window.testRunner) {
26 testRunner.notifyDone();
ddkilzer@apple.coma6df9992009-03-24 21:40:24 +000027 }
28 }
29}
30
31</script>
32</head>
33<body>
ddkilzer@apple.coma6df9992009-03-24 21:40:24 +000034<script>
35description("This tests that an iframe with no src attribute uses the parent document's URL as a base when resolving non-fully-qualified URLs set by JavaScript.");
ddkilzer@apple.coma6df9992009-03-24 21:40:24 +000036</script>
37<iframe id="theFrame" onload="runTest()"></iframe>
38</body>
39</html>