зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1475123 [wpt PR 11929] - [html] Add tests for document.open() after window.stop(), a=testonly
Automatic update from web-platform-tests[html] Add tests for document.open() after window.stop() (#11929) -- wpt-commits: e462f618e3765749ca8b0101987759d37d746d32 wpt-pr: 11929
This commit is contained in:
Родитель
d82e5983eb
Коммит
98e02e7ea4
|
@ -286735,6 +286735,16 @@
|
|||
{}
|
||||
]
|
||||
],
|
||||
"html/webappapis/dynamic-markup-insertion/opening-the-input-stream/resources/aborted-parser-async-frame.html": [
|
||||
[
|
||||
{}
|
||||
]
|
||||
],
|
||||
"html/webappapis/dynamic-markup-insertion/opening-the-input-stream/resources/aborted-parser-frame.html": [
|
||||
[
|
||||
{}
|
||||
]
|
||||
],
|
||||
"html/webappapis/dynamic-markup-insertion/opening-the-input-stream/resources/encoding-frame.html": [
|
||||
[
|
||||
{}
|
||||
|
@ -351749,6 +351759,12 @@
|
|||
{}
|
||||
]
|
||||
],
|
||||
"html/webappapis/dynamic-markup-insertion/opening-the-input-stream/aborted-parser.window.js": [
|
||||
[
|
||||
"/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/aborted-parser.window.html",
|
||||
{}
|
||||
]
|
||||
],
|
||||
"html/webappapis/dynamic-markup-insertion/opening-the-input-stream/document.open-01.xhtml": [
|
||||
[
|
||||
"/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/document.open-01.xhtml",
|
||||
|
@ -590156,6 +590172,10 @@
|
|||
"ea3ff6e58680da8c3f08e7f26ebc738d82703801",
|
||||
"testharness"
|
||||
],
|
||||
"html/webappapis/dynamic-markup-insertion/opening-the-input-stream/aborted-parser.window.js": [
|
||||
"0ef6dab1d5e2364a0a75513469e339c20b14c674",
|
||||
"testharness"
|
||||
],
|
||||
"html/webappapis/dynamic-markup-insertion/opening-the-input-stream/document.open-01.xhtml": [
|
||||
"cb059c7c17320c0e63e9453d3a0486a8a94b060a",
|
||||
"testharness"
|
||||
|
@ -590192,6 +590212,14 @@
|
|||
"b4cdd98c6eb9a3946b49a6876c62c7e35501f413",
|
||||
"testharness"
|
||||
],
|
||||
"html/webappapis/dynamic-markup-insertion/opening-the-input-stream/resources/aborted-parser-async-frame.html": [
|
||||
"38be68cf85bbe4cef461963768fe1390733d67db",
|
||||
"support"
|
||||
],
|
||||
"html/webappapis/dynamic-markup-insertion/opening-the-input-stream/resources/aborted-parser-frame.html": [
|
||||
"4cb26a783d232652a580e511e439b8bfaac04dfe",
|
||||
"support"
|
||||
],
|
||||
"html/webappapis/dynamic-markup-insertion/opening-the-input-stream/resources/encoding-frame.html": [
|
||||
"1d8ae9f75fe05343c1858caad637c9f7602c9f28",
|
||||
"support"
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
// document.open() bails out early if there is an **active parser** with
|
||||
// non-zero script nesting level. window.stop() aborts the current parser and
|
||||
// makes it no longer active, and should allow document.open() to work.
|
||||
// For more details, see https://bugzilla.mozilla.org/show_bug.cgi?id=1475000.
|
||||
|
||||
window.handlers = {};
|
||||
|
||||
async_test(t => {
|
||||
const frame = document.body.appendChild(document.createElement("iframe"));
|
||||
frame.src = "resources/aborted-parser-frame.html";
|
||||
window.handlers.afterOpen = t.step_func_done(() => {
|
||||
const openCalled = frame.contentDocument.childNodes.length === 0;
|
||||
frame.remove();
|
||||
assert_true(openCalled, "child document should be empty");
|
||||
});
|
||||
}, "document.open() after parser is aborted");
|
||||
|
||||
// Note: This test should pass even if window.close() is not there, as
|
||||
// document.open() is not executed synchronously in an inline script.
|
||||
async_test(t => {
|
||||
const frame = document.body.appendChild(document.createElement("iframe"));
|
||||
frame.src = "resources/aborted-parser-async-frame.html";
|
||||
window.handlers.afterOpenAsync = t.step_func_done(() => {
|
||||
const openCalled = frame.contentDocument.childNodes.length === 0;
|
||||
frame.remove();
|
||||
assert_true(openCalled, "child document should be empty");
|
||||
});
|
||||
}, "async document.open() after parser is aborted");
|
|
@ -0,0 +1,9 @@
|
|||
<!doctype html>
|
||||
<p>Text</p>
|
||||
<script>
|
||||
window.stop();
|
||||
parent.step_timeout(() => {
|
||||
document.open();
|
||||
parent.handlers.afterOpenAsync();
|
||||
}, 10);
|
||||
</script>
|
|
@ -0,0 +1,7 @@
|
|||
<!doctype html>
|
||||
<p>Text</p>
|
||||
<script>
|
||||
window.stop();
|
||||
document.open();
|
||||
parent.handlers.afterOpen();
|
||||
</script>
|
Загрузка…
Ссылка в новой задаче