forked from servo/servo
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensure that a navigation to the same URL is aborted. Fixes servo#10952.
- Loading branch information
Showing
4 changed files
with
52 additions
and
14 deletions.
There are no files selected for viewing
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
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
20 changes: 20 additions & 0 deletions
20
...form-tests/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
...sts/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> |