Skip to content

Commit

Permalink
Bug 1486839 [wpt PR 12724] - HTML: document.open() and history entry …
Browse files Browse the repository at this point in the history
…creation, a=testonly

Automatic update from web-platform-testsHTML: document.open() and history entry creation (#12724)

The 010.html test has been removed for a multitude of reasons:

- It does not seem to work as intended in any browser. (I.e., no browser
  passes the test.)
- The concept it allegedly tests (salvageability) is no longer in the
  specification for document.open().

For whatwg/html#3946.
--

wpt-commits: f23bb9e37fdf694021519b0e7ce2c282fa026ea5
wpt-pr: 12724
  • Loading branch information
TimothyGu authored and moz-wptsync-bot committed Sep 5, 2018
1 parent 61e0f9e commit 0ac5747
Show file tree
Hide file tree
Showing 7 changed files with 70 additions and 58 deletions.
49 changes: 20 additions & 29 deletions testing/web-platform/meta/MANIFEST.json
Expand Up @@ -289124,16 +289124,6 @@
{}
]
],
"html/webappapis/dynamic-markup-insertion/opening-the-input-stream/010-1.html": [
[
{}
]
],
"html/webappapis/dynamic-markup-insertion/opening-the-input-stream/010-2.html": [
[
{}
]
],
"html/webappapis/dynamic-markup-insertion/opening-the-input-stream/011-1.html": [
[
{}
Expand Down Expand Up @@ -289224,6 +289214,11 @@
{}
]
],
"html/webappapis/dynamic-markup-insertion/opening-the-input-stream/resources/history-frame.html": [
[
{}
]
],
"html/webappapis/dynamic-markup-insertion/opening-the-input-stream/resources/set-document-domain.html": [
[
{}
Expand Down Expand Up @@ -365785,12 +365780,6 @@
{}
]
],
"html/webappapis/dynamic-markup-insertion/opening-the-input-stream/010.html": [
[
"/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/010.html",
{}
]
],
"html/webappapis/dynamic-markup-insertion/opening-the-input-stream/011.html": [
[
"/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/011.html",
Expand Down Expand Up @@ -365917,6 +365906,12 @@
{}
]
],
"html/webappapis/dynamic-markup-insertion/opening-the-input-stream/history.window.js": [
[
"/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/history.window.html",
{}
]
],
"html/webappapis/dynamic-markup-insertion/opening-the-input-stream/ignore-opens-during-unload.window.js": [
[
"/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/ignore-opens-during-unload.window.html",
Expand Down Expand Up @@ -608324,18 +608319,6 @@
"1dcb92615d085b28d3c9d2a22d744be849158d18",
"testharness"
],
"html/webappapis/dynamic-markup-insertion/opening-the-input-stream/010-1.html": [
"317e13691d4a94e5861bbb85d7367591d7d1c624",
"support"
],
"html/webappapis/dynamic-markup-insertion/opening-the-input-stream/010-2.html": [
"ea537fcd6018fab07cb58132a2523d82cb8783de",
"support"
],
"html/webappapis/dynamic-markup-insertion/opening-the-input-stream/010.html": [
"d83d24f2414b7f08229662694a7fd475560e2858",
"testharness"
],
"html/webappapis/dynamic-markup-insertion/opening-the-input-stream/011-1.html": [
"37973fd52ec8c3b8091683e4726058ad2513c053",
"support"
Expand Down Expand Up @@ -608448,6 +608431,10 @@
"7fb172a141cf93330d6ec718d200e5845cd32f39",
"testharness"
],
"html/webappapis/dynamic-markup-insertion/opening-the-input-stream/history.window.js": [
"0134da24f07bb4d653703d2d3d0c3575a32e8f34",
"testharness"
],
"html/webappapis/dynamic-markup-insertion/opening-the-input-stream/ignore-opens-during-unload.window.js": [
"43506a22a46da53885a2b5a0888095bc52b460ca",
"testharness"
Expand Down Expand Up @@ -608520,6 +608507,10 @@
"0fe189914c3727f8071c4eaaa6cc740aeb7aab93",
"support"
],
"html/webappapis/dynamic-markup-insertion/opening-the-input-stream/resources/history-frame.html": [
"2404105b09a7724cf8cc5e2cf6d7bf7a8fb6f39b",
"support"
],
"html/webappapis/dynamic-markup-insertion/opening-the-input-stream/resources/set-document-domain.html": [
"a92a7ae39f8351f97cd865dca5ebe8d4260aa229",
"support"
Expand Down Expand Up @@ -610441,7 +610432,7 @@
"support"
],
"lint.whitelist": [
"8c6bb2d8fbd78a1acb41120f3cc7299b4cb4e248",
"92bb4b5bcc96e4ff84ce077c391ce7efa3952ee4",
"support"
],
"longtask-timing/META.yml": [
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

@@ -0,0 +1,29 @@
// Historically, document.open() created an entry in the session history so
// that the original page could be seen by going back. Test that this behavior
// no longer occurs.
//
// This test uses window.open() for variety, as most other tests in this
// directory use document.open(). An <iframe> would probably work also. We can
// always add an <iframe>-based test later if it is deemed necessary.

const t = async_test("document.open should not add an entry to the session history");

const frameURL = new URL("resources/history-frame.html", document.URL).href;

let origLength;
window.onFrameLoaded = t.step_func(() => {
window.onFrameLoaded = t.unreached_func("onFrameLoaded should only be called once");
assert_equals(win.document.URL, frameURL);
assert_true(win.document.body.textContent.includes("Old"));
origLength = win.history.length;
});
window.onDocumentOpen = t.step_func_done(() => {
window.onDocumentOpen = t.unreached_func("onDocumentOpen should only be called once");
assert_equals(win.document.URL, frameURL);
assert_true(win.document.body.textContent.includes("New"));
assert_not_equals(origLength, undefined);
assert_equals(win.history.length, origLength);
});

const win = window.open(frameURL);
t.add_cleanup(() => win.close());
@@ -0,0 +1,20 @@
<script>
function queueTest() {
// The timeout is necessary to avoid the parser still being active when
// `document.open()` is called and becoming a no-op.
//
// We also cannot use setTimeout(..., 0), as the parser is terminated in a
// task with DOM manipulation task source while the timeout is run in a task
// on the timer task source. The order is therefore not guaranteed. Let's
// play it safer and use some actual timeout.
setTimeout(() => {
document.open();
document.write("<p>New content</p>");
document.close();
opener.onDocumentOpen();
}, 200);
}
</script>
<body onload="opener.onFrameLoaded(); queueTest();">
<p>Old content</p>
</body>
1 change: 1 addition & 0 deletions testing/web-platform/tests/lint.whitelist
Expand Up @@ -162,6 +162,7 @@ SET TIMEOUT: html/semantics/embedded-content/the-iframe-element/*
SET TIMEOUT: html/semantics/embedded-content/the-img-element/*
SET TIMEOUT: html/semantics/scripting-1/the-script-element/*
SET TIMEOUT: html/webappapis/dynamic-markup-insertion/opening-the-input-stream/0*
SET TIMEOUT: html/webappapis/dynamic-markup-insertion/opening-the-input-stream/resources/history-frame.html
SET TIMEOUT: html/webappapis/dynamic-markup-insertion/opening-the-input-stream/tasks.window.js
SET TIMEOUT: html/webappapis/scripting/event-loops/*
SET TIMEOUT: html/webappapis/scripting/events/event-handler-processing-algorithm-error/*
Expand Down

0 comments on commit 0ac5747

Please sign in to comment.