Skip to content

Commit

Permalink
Merge 5747f8b into 0cd0b21
Browse files Browse the repository at this point in the history
  • Loading branch information
annevk authored May 2, 2017
2 parents 0cd0b21 + 5747f8b commit 3ea8c23
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions html/semantics/forms/form-submission-0/submission-checks.window.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
async_test(t => {
const frame = document.createElement("frame"),
form = document.createElement("form");
t.add_cleanup(() => frame.remove());
form.action = "/common/blank.html";
form.target = "doesnotmattertwobits";
frame.name = "doesnotmattertwobits";
document.body.appendChild(frame);
frame.onload = t.step_func(() => {
if(frame.contentWindow.location.href === "about:blank")
return;
assert_unreached();
});
form.submit();
t.step_timeout(() => t.done(), 500);
}, "<form> not connected to a document cannot navigate");

async_test(t => {
const frame = document.createElement("frame"),
form = document.createElement("form");
t.add_cleanup(() => frame.remove());
form.action = "/";
document.body.appendChild(frame);
frame.contentDocument.body.appendChild(form);
frame.onload = t.step_func(() => {
if(frame.contentWindow.location.href === "about:blank")
return;
form.submit();
t.step_timeout(() => {
assert_equals(frame.contentWindow.location.pathname, "/common/blank.html");
t.done();
}, 500)
});
frame.src = "/common/blank.html";
}, "<form> in a navigated document cannot navigate");

0 comments on commit 3ea8c23

Please sign in to comment.