Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improve spec compliance of window.close
- Loading branch information
Showing
12 changed files
with
123 additions
and
39 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
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
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
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
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
22 changes: 22 additions & 0 deletions
22
...tml/browsers/browsing-the-web/unloading-documents/prompt-and-unload-script-closeable.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,22 @@ | ||
<!doctype html> | ||
<title>beforeunload and unload events fire after window.close() in script-closeable browsing context</title> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<div id="log"></div> | ||
<script> | ||
beforeunload_fired = false; | ||
var t = async_test(); | ||
|
||
onload = t.step_func(function() { | ||
window.close(); | ||
}); | ||
|
||
onbeforeunload = t.step_func(function() { | ||
beforeunload_fired = true; | ||
}); | ||
|
||
onunload = t.step_func(function() { | ||
assert_true(beforeunload_fired); | ||
t.done() | ||
}); | ||
</script> |
10 changes: 10 additions & 0 deletions
10
...browsers/browsing-the-web/unloading-documents/prompt-and-unload-script-uncloseable-1.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,10 @@ | ||
<!doctype html> | ||
script-uncloseable-1 | ||
<script> | ||
onbeforeunload = function() { | ||
parent.beforeunload_fired = true; | ||
}; | ||
onunload = function() { | ||
parent.unload_fired = true; | ||
}; | ||
</script> |
24 changes: 24 additions & 0 deletions
24
...l/browsers/browsing-the-web/unloading-documents/prompt-and-unload-script-uncloseable.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,24 @@ | ||
<!doctype html> | ||
<title>beforeunload and unload events do not fire after window.close() in script-uncloseable browsing context</title> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<div id="log"></div> | ||
<script> | ||
var beforeunload_fired = false; | ||
var unload_fired = false; | ||
var t = async_test(); | ||
|
||
onload = t.step_func(function() { | ||
var iframe = document.getElementsByTagName("iframe")[0] | ||
iframe.onload = t.step_func(function() { | ||
iframe.contentWindow.close() | ||
t.step_timeout(function() { | ||
assert_false(beforeunload_fired); | ||
assert_false(unload_fired); | ||
t.done(); | ||
}, 1000); | ||
}); | ||
iframe.src = "prompt-and-unload-script-uncloseable-1.html"; | ||
}); | ||
</script> | ||
<iframe></iframe> |