Update web-platform-tests to revision 8a2ceb5f18911302b7a5c1cd2791f4ab50ad4326

This commit is contained in:
Josh Matthews 2017-10-12 09:25:50 -04:00
parent 462c272380
commit 1f531f66ea
5377 changed files with 174916 additions and 84369 deletions

View file

@ -0,0 +1,50 @@
["a",
"area"].forEach(type => {
const followed = type === "a" ? true : false;
async_test(t => {
const target = document.createElement("iframe"),
link = document.createElement(type);
t.add_cleanup(() => target.remove());
target.name = "certifiedrandom" + type;
link.target = "certifiedrandom" + type;
link.href = "/";
document.body.appendChild(target);
target.onload = t.step_func(() => {
if(target.contentWindow.location.href === "about:blank")
return;
if(followed) {
assert_equals(target.contentWindow.location.pathname, "/");
t.done();
} else {
assert_unreached();
}
});
link.click();
t.step_timeout(() => {
if(followed) {
assert_unreached();
} else {
t.done();
}
}, 500);
}, "<" + type + "> that is not connected should " + (followed ? "" : "not ") + "be followed");
async_test(t => {
const target = document.createElement("iframe"),
doc = document.implementation.createDocument("", ""),
link = doc.createElementNS("http://www.w3.org/1999/xhtml", type);
t.add_cleanup(() => target.remove());
target.name = "certifiedrandom2" + type;
link.target = "certifiedrandom2" + type;
link.href = "/";
document.body.appendChild(target);
target.onload = t.step_func(() => {
if(target.contentWindow.location.href === "about:blank")
return;
assert_unreached();
});
link.click();
t.step_timeout(() => t.done(), 500);
}, "<" + type + "> that is from an inactive document should not be followed");
});

View file

@ -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");
});