Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3268 from w3c/sync_dda62d1be9ecc35d3f1ee028e8b476…
…4580f3549d Merge pull request #3268 from sync_dda62d1be9ecc35d3f1ee028e8b4764580f3549d
- Loading branch information
Showing
2 changed files
with
31 additions
and
0 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
html/browsers/browsing-the-web/navigating-across-documents/empty_fragment.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<!doctype html> | ||
<meta charset="utf-8"> | ||
<title>Navigating to the same URL with an empty fragment aborts the navigation</title> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<iframe src="empty_fragment_iframe.html"></iframe> | ||
<script> | ||
// If the navigation were not aborted, we would expect multiple load events | ||
// as the page continually reloads itself. | ||
async_test(function(t) { | ||
var count = 0; | ||
var iframe = document.querySelector('iframe'); | ||
iframe.onload = t.step_func(function() { | ||
count++; | ||
}); | ||
window.child_succeeded = t.step_func_done(function() { | ||
assert_equals(count, 1); | ||
}); | ||
}); | ||
</script> |
11 changes: 11 additions & 0 deletions
11
html/browsers/browsing-the-web/navigating-across-documents/empty_fragment_iframe.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<script> | ||
var timeout; | ||
onload = function() { | ||
location.hash = ""; | ||
timeout = setTimeout(function() { parent.child_succeeded() }, 2000); | ||
}; | ||
|
||
onbeforeunload = function() { | ||
clearTimeout(timeout); | ||
} | ||
</script> |