diff --git a/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/tentative/README.md b/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/tentative/README.md new file mode 100644 index 00000000000000..02d2e94a0dff2f --- /dev/null +++ b/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/tentative/README.md @@ -0,0 +1,13 @@ +# Overlapping navigation and traversal tests + +While developing [app history](https://wicg.github.io/app-history/), @domenic +noticed that cancelation of navigations and history traversals is not very +well-defined in the spec. + +On the spec side, this will probably be fixed as part of, or after, the +[session history rewrite](https://github.com/whatwg/html/pull/6315). + +In the meantime, this directory contains tests which try to match most browsers, +or picks one of the potential behaviors. + + discusses these results. diff --git a/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/tentative/cross-document-nav-cross-document-nav.html b/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/tentative/cross-document-nav-cross-document-nav.html new file mode 100644 index 00000000000000..8061649207c075 --- /dev/null +++ b/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/tentative/cross-document-nav-cross-document-nav.html @@ -0,0 +1,30 @@ + + +Cross-document navigation after a cross-document navigation + + + + + + + diff --git a/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/tentative/cross-document-nav-cross-document-traversal.html b/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/tentative/cross-document-nav-cross-document-traversal.html new file mode 100644 index 00000000000000..eed07f4c77bc7c --- /dev/null +++ b/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/tentative/cross-document-nav-cross-document-traversal.html @@ -0,0 +1,38 @@ + + +Cross-document traversal during cross-document navigation + + + + + + + diff --git a/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/tentative/cross-document-nav-same-document-nav.html b/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/tentative/cross-document-nav-same-document-nav.html new file mode 100644 index 00000000000000..1b2aeaecfcc6f2 --- /dev/null +++ b/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/tentative/cross-document-nav-same-document-nav.html @@ -0,0 +1,44 @@ + + +Cross-document navigation after a same-document navigation + + + + + + + diff --git a/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/tentative/cross-document-nav-same-document-traversal.html b/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/tentative/cross-document-nav-same-document-traversal.html new file mode 100644 index 00000000000000..fac6624091ab01 --- /dev/null +++ b/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/tentative/cross-document-nav-same-document-traversal.html @@ -0,0 +1,36 @@ + + +Same-document traversal during cross-document navigation + + + + + + + diff --git a/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/tentative/cross-document-nav-stop.html b/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/tentative/cross-document-nav-stop.html new file mode 100644 index 00000000000000..1d4f84483331bd --- /dev/null +++ b/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/tentative/cross-document-nav-stop.html @@ -0,0 +1,21 @@ + + +Stop during cross-document navigations + + + + + diff --git a/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/tentative/cross-document-traversal-cross-document-nav.html b/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/tentative/cross-document-traversal-cross-document-nav.html new file mode 100644 index 00000000000000..ebff54e6937e3a --- /dev/null +++ b/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/tentative/cross-document-traversal-cross-document-nav.html @@ -0,0 +1,78 @@ + + +Cross-document navigations during cross-document traversals + + + + + + + + diff --git a/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/tentative/cross-document-traversal-cross-document-traversal.html b/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/tentative/cross-document-traversal-cross-document-traversal.html new file mode 100644 index 00000000000000..510b4d74d70cf2 --- /dev/null +++ b/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/tentative/cross-document-traversal-cross-document-traversal.html @@ -0,0 +1,169 @@ + + +Cross-document traversals during cross-document traversals + + + + + + + diff --git a/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/tentative/cross-document-traversal-same-document-nav.html b/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/tentative/cross-document-traversal-same-document-nav.html new file mode 100644 index 00000000000000..5d3850ff4e2459 --- /dev/null +++ b/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/tentative/cross-document-traversal-same-document-nav.html @@ -0,0 +1,69 @@ + + +Same-document navigations during cross-document traversals + + + + + + + diff --git a/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/tentative/cross-document-traversal-same-document-traversal.html b/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/tentative/cross-document-traversal-same-document-traversal.html new file mode 100644 index 00000000000000..e92e9475fa897d --- /dev/null +++ b/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/tentative/cross-document-traversal-same-document-traversal.html @@ -0,0 +1,108 @@ + + +Same-document traversals during cross-document traversals + + + + + + + diff --git a/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/tentative/cross-document-traversal-stop.html b/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/tentative/cross-document-traversal-stop.html new file mode 100644 index 00000000000000..49d97e72a65c87 --- /dev/null +++ b/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/tentative/cross-document-traversal-stop.html @@ -0,0 +1,40 @@ + + +Stop during cross-document traversals + + + + + + + diff --git a/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/tentative/resources/helpers.mjs b/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/tentative/resources/helpers.mjs new file mode 100644 index 00000000000000..4e889b98eadf60 --- /dev/null +++ b/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/tentative/resources/helpers.mjs @@ -0,0 +1,33 @@ +export function createIframe(t) { + return new Promise((resolve, reject) => { + const iframe = document.createElement("iframe"); + iframe.onload = () => resolve(iframe); + iframe.onerror = () => reject(new Error("Could not load iframe")); + iframe.src = "/common/blank.html"; + +// t.add_cleanup(() => iframe.remove()); + document.body.append(iframe); + }); +} + +export function delay(t, ms) { + return new Promise(resolve => t.step_timeout(resolve, ms)); +} + +export function waitForLoad(obj) { + return new Promise(resolve => { + obj.addEventListener("load", resolve, { once: true }); + }); +} + +export function waitForHashchange(obj) { + return new Promise(resolve => { + obj.addEventListener("hashchange", resolve, { once: true }); + }); +} + +export function waitForPopstate(obj) { + return new Promise(resolve => { + obj.addEventListener("popstate", resolve, { once: true }); + }); +} diff --git a/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/tentative/resources/slow.py b/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/tentative/resources/slow.py new file mode 100644 index 00000000000000..5ee32a60baea5e --- /dev/null +++ b/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/tentative/resources/slow.py @@ -0,0 +1,7 @@ +# Like /common/slow.py except with text/html content-type so that it won't +# trigger strange parts of the