Skip to content

Commit

Permalink
Bug 1511569 [wpt PR 14316] - Test document.URL of <iframe src="javasc…
Browse files Browse the repository at this point in the history
…ript:...">, a=testonly

Automatic update from web-platform-tests
Test document.URL of <iframe src="javascript:...">

The document.URL should be about:blank.

Follows whatwg/html#4205.
--

wpt-commits: ed74c4f67f0529a7439f7b656ef0a35049873b9e
wpt-pr: 14316
  • Loading branch information
jyasskin authored and jgraham committed Feb 7, 2019
1 parent 2c425f2 commit 2a4b81c
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
ifr1:{url:"about:blank", sameDom: true},
ifr2:{url:"about:blank", sameDom: true},
ifr3:{url: location.href.replace(/\/[^\/]*$/, '/'), sameDom: true },
ifr4:{url:"about:blank", sameDom: true}
ifr4:{url:"about:blank", sameDom: true},
ifr5:{url:"about:blank", sameDom: true}
}

var js_url = 'javascript:"<html><script>var sameDom = false; try{var cn = top.document.body.className;sameDom = true;}catch(e){}; parent.postMessage( {url: document.URL, name: name, sameDom: sameDom}, \'*\')<\/script><body><p>JS-generated document</p></body></<html>";'
Expand Down Expand Up @@ -46,8 +47,15 @@
results[frame.name] = 'Exception on setting!';
}
};

// An iframe with an initial src of a javascript: URL should also have a
// document URL of about:blank.
var ifr = document.createElement('iframe');
ifr.name = 'ifr5';
ifr.src = js_url;
document.body.appendChild(ifr);
}

</script>
</body>
</html>
</html>

0 comments on commit 2a4b81c

Please sign in to comment.