Skip to content

Commit

Permalink
<a>, <area>, and <link> must have an active document check (#5758)
Browse files Browse the repository at this point in the history
  • Loading branch information
annevk authored and ayg committed Aug 20, 2017
1 parent 05d5d1d commit 64bfe4e
Showing 1 changed file with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
["a",
"area",
"link"].forEach(type => {
async_test(t => {
const frame = document.createElement("iframe"),
link = document.createElement(type);
t.add_cleanup(() => frame.remove());
frame.onload = t.step_func(() => {
// See https://github.com/whatwg/html/issues/490
if(frame.contentWindow.location.href === "about:blank")
return;
link.click(); // must be ignored because document is not active
t.step_timeout(() => {
assert_equals(frame.contentWindow.location.pathname, "/common/blank.html");
t.done();
}, 500);
});
document.body.appendChild(frame);
frame.contentDocument.body.appendChild(link);
link.href = "/";
frame.src = "/common/blank.html";
}, "<" + type + "> in navigated away <iframe>'s document cannot follow hyperlinks");
});

0 comments on commit 64bfe4e

Please sign in to comment.