Skip to content

Commit

Permalink
Replacement: 008.html will be replaced by this test.
Browse files Browse the repository at this point in the history
  • Loading branch information
rwaldron committed Jan 19, 2018
1 parent 6c17335 commit 083c1ee
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<!doctype html>
<iframe id="test" name="test"></iframe>
<form target="test" action="javascript:parent.verifyNavigation(false);1;"><!-- 'javascript: url' ending with a "1;" is intentional --></form>
<a target="test" onclick="document.forms[0].submit();" href="call-verify-navigation.html">Test</a>
<script>
window.verifyNavigation = parent.verifyNavigation;
window.onload = function() {
document.querySelector("a").click();
};
</script>
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<!doctype html>
<link rel="help" href="https://html.spec.whatwg.org/multipage/browsing-the-web.html#navigating-across-documents">
<link rel="help" href="https://html.spec.whatwg.org/multipage/links.html#following-hyperlinks">
<link rel="help" href="https://html.spec.whatwg.org/multipage/browsing-the-web.html#javascript-protocol">
<link rel="help" href="https://html.spec.whatwg.org/multipage/text-level-semantics.html#the-a-element">
<link rel="help" href="https://html.spec.whatwg.org/multipage/webappapis.html#the-event-handler-processing-algorithm">
<link rel="help" href="https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#concept-form-submit">
<link rel="help" href="https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#submit-get-action">
<link rel="help" href="https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#plan-to-navigate">
<link rel="help" href="https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#planned-navigation">
<link rel="help" href="https://html.spec.whatwg.org/multipage/iframe-embed-object.html#the-iframe-element:about:blank">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<iframe src=""></iframe>
<script>
const runner = location.href.slice(location.href.lastIndexOf("/") + 1, location.href.length)
.replace(".html", "-runner.html");

async_test(function(test) {

window.verifyNavigation = test.step_func_done(function(signal) {
assert_equals(signal, true, "The navigation via 'javascript: url' code was not canceled by the default href navigation. This might occur if the 'javascript:url' code is not evaluated async, and/or the default href navigation does not cancel the navigation via 'javascript: url'.");
});

document.querySelector("iframe").src = runner;

}, `A navigation via 'javascript: url' code (in ${runner}) must be evaluated async; to pass this test, that navigation must be aborted by the default href navigation (of the clicked link) before that evaluation can complete.`);
</script>

0 comments on commit 083c1ee

Please sign in to comment.