From 36d22d82aa202bb199967e9512281e9a53db42c9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 21:33:14 +0200 Subject: Adding upstream version 115.7.0esr. Signed-off-by: Daniel Baumann --- .../navigating-across-documents/003-1.html | 7 + .../navigating-across-documents/003-2.html | 9 ++ .../navigating-across-documents/003-3.html | 4 + .../navigating-across-documents/003.html | 22 +++ .../navigating-across-documents/004-1.html | 7 + .../navigating-across-documents/004-2.html | 9 ++ .../navigating-across-documents/004-3.html | 4 + .../navigating-across-documents/004.html | 22 +++ .../navigating-across-documents/005.html | 16 ++ .../navigating-across-documents/006.html | 17 ++ .../navigating-across-documents/007.html | 16 ++ .../navigating-across-documents/008.html | 17 ++ .../navigating-across-documents/009.html | 22 +++ .../navigating-across-documents/010.html | 17 ++ .../navigating-across-documents/011.html | 21 +++ .../navigating-across-documents/012.html | 20 +++ .../navigating-across-documents/013.html | 20 +++ .../navigating-across-documents/014.html | 21 +++ .../navigating-across-documents/015.html | 20 +++ .../abort-document-load-1.html | 32 ++++ .../abort-document-load-2.html | 32 ++++ .../abort-document-load.html | 30 ++++ .../about-srcdoc-navigation-blocked.window.js | 45 ++++++ .../anchor-fragment-form-submit-longfragment.html | 29 ++++ .../anchor-fragment-form-submit-withpath.html | 35 ++++ .../anchor-fragment-form-submit.html | 29 ++++ .../anchor-jsurl-form-submit.html | 29 ++++ .../child-navigates-parent-cross-origin.window.js | 90 +++++++++++ .../child-navigates-parent-same-origin.window.js | 24 +++ ...gation-with-user-activation-in-parent.window.js | 8 + ...op-navigation-without-user-activation.window.js | 8 + .../empty-iframe-load-event.html | 39 +++++ .../empty_fragment.html | 20 +++ .../empty_fragment_iframe.html | 11 ++ .../failure-check-sequence.https.html | 76 +++++++++ .../initial-empty-document/iframe-nosrc.html | 178 +++++++++++++++++++++ .../iframe-src-204-fragment.html | 144 +++++++++++++++++ .../iframe-src-204-pushState-replaceState.html | 66 ++++++++ .../initial-empty-document/iframe-src-204.html | 178 +++++++++++++++++++++ ...iframe-src-aboutblank-navigate-immediately.html | 124 ++++++++++++++ .../iframe-src-aboutblank-wait-for-load.html | 134 ++++++++++++++++ .../initial-content-replacement.html | 86 ++++++++++ .../load-event-iframe-element.html | 64 ++++++++ .../load-pageshow-events-iframe-contentWindow.html | 44 +++++ .../load-pageshow-events-window-open.html | 35 ++++ .../resources/code-injector.html | 8 + .../initial-empty-document/resources/helpers.js | 121 ++++++++++++++ .../window-open-204-fragment.html | 63 ++++++++ .../window-open-204-pushState-replaceState.html | 61 +++++++ .../initial-empty-document/window-open-204.html | 81 ++++++++++ .../window-open-aboutblank.html | 81 ++++++++++ .../window-open-history-length.html | 31 ++++ .../initial-empty-document/window-open-nourl.html | 78 +++++++++ ...pt-url-abort-return-value-string.tentative.html | 28 ++++ ...url-abort-return-value-undefined.tentative.html | 25 +++ .../support/iframe-and-links.html | 18 +++ .../support/set-child-loaded.html | 5 + .../javascript-url-global-scope.html | 16 ++ .../javascript-url-load-as-html.xhtml | 37 +++++ .../javascript-url-no-beforeunload.window.js | 80 +++++++++ .../javascript-url-query-fragment-components.html | 28 ++++ .../javascript-url-referrer.window.js | 38 +++++ ...vascript-url-return-value-handling-dynamic.html | 58 +++++++ .../javascript-url-return-value-handling.html | 36 +++++ .../javascript-url-security-check-failure.sub.html | 56 +++++++ ...cript-url-security-check-multi-globals.sub.html | 66 ++++++++ ...-url-security-check-same-origin-domain.sub.html | 26 +++ .../javascript-url-task-queuing.html | 58 +++++++ .../context-for-location-assign.html | 27 ++++ .../context-for-location-href.html | 27 ++++ .../multiple-globals/context-for-location.html | 27 ++++ .../multiple-globals/context-for-window-open.html | 28 ++++ .../multiple-globals/entry/entry.html | 4 + .../multiple-globals/entry/target.html | 2 + .../multiple-globals/incumbent/empty.html | 0 .../multiple-globals/incumbent/target.html | 2 + .../multiple-globals/relevant/empty.html | 0 .../multiple-globals/relevant/target.html | 2 + .../multiple-globals/resources/context-helper.js | 34 ++++ .../multiple-globals/resources/target.js | 11 ++ ...-to-same-url-with-fragment-fire-load-event.html | 31 ++++ ...ss-origin-iframe-to-same-url-with-fragment.html | 27 ++++ .../navigate-cross-origin-iframe-to-same-url.html | 22 +++ .../navigate-to-unparseable-url.html | 58 +++++++ .../navigation-unload-cross-origin.sub.window.js | 15 ++ .../navigation-unload-data-url.window.js | 15 ++ .../navigation-unload-form-submit-1.html | 23 +++ .../navigation-unload-form-submit-2.html | 7 + .../navigation-unload-form-submit.html | 24 +++ .../navigation-unload-javascript-url.window.js | 15 ++ .../navigation-unload-same-origin-fragment-1.html | 9 ++ .../navigation-unload-same-origin-fragment-2.html | 9 ++ .../navigation-unload-same-origin-fragment.html | 29 ++++ .../navigation-unload-same-origin.window.js | 15 ++ .../plugin-document.historical.html | 22 +++ .../redirect-to-about.window.js | 34 ++++ .../redirect-to-data.html | 75 +++++++++ .../redirect-to-unparseable-url.html | 71 ++++++++ .../navigating-across-documents/refresh/README.md | 1 + .../refresh/navigate.window.js | 23 +++ .../refresh/resources/multiple.asis | 6 + .../refresh/resources/refresh.py | 4 + .../refresh/resources/refreshed.txt | 1 + .../refresh/subresource.any.js | 6 + .../replace-before-load/a-click-during-load.html | 32 ++++ .../a-click-during-pageshow.html | 32 ++++ .../replace-before-load/a-click.html | 30 ++++ .../a-user-click-during-load.html | 36 +++++ .../a-user-click-during-pageshow.html | 36 +++++ .../replace-before-load/a-user-click.html | 34 ++++ .../form-requestsubmit-during-load.html | 41 +++++ .../form-requestsubmit-during-pageshow.html | 41 +++++ .../replace-before-load/form-requestsubmit.html | 39 +++++ .../form-submit-button-click-during-load.html | 45 ++++++ .../form-submit-button-click-during-pageshow.html | 45 ++++++ .../form-submit-button-click.html | 43 +++++ .../form-submit-cross-frame-crossorigin.sub.html | 42 +++++ .../form-submit-cross-frame.html | 40 +++++ .../form-submit-during-load.html | 41 +++++ .../form-submit-during-pageshow.html | 41 +++++ .../form-submit-popup-crossorigin.sub.html | 39 +++++ .../replace-before-load/form-submit-popup.html | 37 +++++ .../replace-before-load/form-submit.html | 39 +++++ .../history-pushstate-during-load.html | 28 ++++ .../history-pushstate-during-pageshow.html | 29 ++++ .../replace-before-load/history-pushstate.html | 22 +++ .../iframe-src-during-load.html | 31 ++++ .../iframe-src-during-pageshow.html | 31 ++++ .../replace-before-load/iframe-src.html | 39 +++++ .../location-assign-during-load.html | 31 ++++ .../location-assign-during-pageshow.html | 31 ++++ .../location-assign-user-click.html | 34 ++++ .../replace-before-load/location-assign.html | 25 +++ .../location-setter-during-load.html | 76 +++++++++ .../location-setter-during-pageshow.html | 77 +++++++++ .../location-setter-user-click.html | 82 ++++++++++ .../location-setter-user-mouseup.html | 89 +++++++++++ .../replace-before-load/location-setter.html | 58 +++++++ .../resources/code-injector.html | 9 ++ .../replace-before-load/resources/helpers.js | 89 +++++++++++ .../resources/message-opener.html | 8 + .../resources/slow-code-injector.html | 16 ++ ...w-message-source-with-history-and-location.html | 16 ++ .../window-open-popup-during-load.html | 67 ++++++++ .../window-open-popup-during-pageshow.html | 67 ++++++++ .../replace-before-load/window-open-popup.html | 49 ++++++ .../window-open-self-during-load.html | 29 ++++ .../window-open-self-during-pageshow.html | 29 ++++ .../replace-before-load/window-open-self.html | 23 +++ .../resources/blank.html | 1 + .../child-navigates-parent-cross-origin-inner.html | 20 +++ .../child-navigates-parent-destination.html | 4 + .../child-navigates-parent-location-initial.html | 3 + .../child-navigates-parent-location-inner.html | 5 + .../child-navigates-parent-submit-initial.html | 3 + .../child-navigates-parent-submit-inner.html | 6 + .../resources/click.html | 4 + .../resources/document-domain-set-to-site.sub.html | 7 + .../resources/form.html | 5 + .../resources/href.html | 5 + .../resources/message-opener.html | 8 + .../resources/message-parent.html | 3 + .../resources/multi-globals-subframe-1.sub.html | 10 ++ .../resources/multi-globals-subframe-2.sub.html | 8 + .../resources/no-cache-single-redirect.py | 21 +++ .../page-that-post-message-to-opener.html | 6 + .../resources/page-with-top-navigating-iframe.html | 24 +++ .../portable-document-format-sample-valid.pdf | Bin 0 -> 58927 bytes ...rtable-document-format-sample-valid.pdf.headers | 1 + .../resources/redirect.py | 4 + .../resources/top-navigating-page.html | 15 ++ .../resources/wait-for-messages.js | 15 ++ .../resources/xhtml-and-non-utf-8.xhtml | 9 ++ ...vigate-child-function-parent-then-fragment.html | 36 +++++ .../source/navigate-child-function-parent.html | 18 +++ .../source/navigate-child-function-src.html | 18 +++ .../source/navigate-child-function.html | 19 +++ .../source/navigate-child-src-about-blank.html | 20 +++ .../source/support/dummy.html | 3 + .../source/support/location-set.html | 8 + .../source/support/set-parent-src.html | 8 + .../top-level-data-url.window.js | 20 +++ 182 files changed, 5841 insertions(+) create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/003-1.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/003-2.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/003-3.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/003.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/004-1.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/004-2.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/004-3.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/004.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/005.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/006.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/007.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/008.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/009.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/010.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/011.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/012.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/013.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/014.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/015.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/abort-document-load-1.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/abort-document-load-2.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/abort-document-load.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/about-srcdoc-navigation-blocked.window.js create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/anchor-fragment-form-submit-longfragment.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/anchor-fragment-form-submit-withpath.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/anchor-fragment-form-submit.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/anchor-jsurl-form-submit.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/child-navigates-parent-cross-origin.window.js create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/child-navigates-parent-same-origin.window.js create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/cross-origin-top-navigation-with-user-activation-in-parent.window.js create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/cross-origin-top-navigation-without-user-activation.window.js create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/empty-iframe-load-event.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/empty_fragment.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/empty_fragment_iframe.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/failure-check-sequence.https.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/iframe-nosrc.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/iframe-src-204-fragment.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/iframe-src-204-pushState-replaceState.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/iframe-src-204.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/iframe-src-aboutblank-navigate-immediately.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/iframe-src-aboutblank-wait-for-load.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/initial-content-replacement.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/load-event-iframe-element.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/load-pageshow-events-iframe-contentWindow.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/load-pageshow-events-window-open.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/resources/code-injector.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/resources/helpers.js create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/window-open-204-fragment.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/window-open-204-pushState-replaceState.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/window-open-204.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/window-open-aboutblank.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/window-open-history-length.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/window-open-nourl.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/javascript-url-abort/javascript-url-abort-return-value-string.tentative.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/javascript-url-abort/javascript-url-abort-return-value-undefined.tentative.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/javascript-url-abort/support/iframe-and-links.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/javascript-url-abort/support/set-child-loaded.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/javascript-url-global-scope.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/javascript-url-load-as-html.xhtml create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/javascript-url-no-beforeunload.window.js create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/javascript-url-query-fragment-components.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/javascript-url-referrer.window.js create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/javascript-url-return-value-handling-dynamic.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/javascript-url-return-value-handling.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/javascript-url-security-check-failure.sub.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/javascript-url-security-check-multi-globals.sub.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/javascript-url-security-check-same-origin-domain.sub.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/javascript-url-task-queuing.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/multiple-globals/context-for-location-assign.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/multiple-globals/context-for-location-href.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/multiple-globals/context-for-location.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/multiple-globals/context-for-window-open.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/multiple-globals/entry/entry.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/multiple-globals/entry/target.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/multiple-globals/incumbent/empty.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/multiple-globals/incumbent/target.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/multiple-globals/relevant/empty.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/multiple-globals/relevant/target.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/multiple-globals/resources/context-helper.js create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/multiple-globals/resources/target.js create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/navigate-cross-origin-iframe-to-same-url-with-fragment-fire-load-event.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/navigate-cross-origin-iframe-to-same-url-with-fragment.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/navigate-cross-origin-iframe-to-same-url.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/navigate-to-unparseable-url.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/navigation-unload-cross-origin.sub.window.js create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/navigation-unload-data-url.window.js create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/navigation-unload-form-submit-1.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/navigation-unload-form-submit-2.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/navigation-unload-form-submit.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/navigation-unload-javascript-url.window.js create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/navigation-unload-same-origin-fragment-1.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/navigation-unload-same-origin-fragment-2.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/navigation-unload-same-origin-fragment.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/navigation-unload-same-origin.window.js create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/plugin-document.historical.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/redirect-to-about.window.js create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/redirect-to-data.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/redirect-to-unparseable-url.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/refresh/README.md create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/refresh/navigate.window.js create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/refresh/resources/multiple.asis create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/refresh/resources/refresh.py create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/refresh/resources/refreshed.txt create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/refresh/subresource.any.js create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/a-click-during-load.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/a-click-during-pageshow.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/a-click.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/a-user-click-during-load.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/a-user-click-during-pageshow.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/a-user-click.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/form-requestsubmit-during-load.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/form-requestsubmit-during-pageshow.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/form-requestsubmit.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/form-submit-button-click-during-load.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/form-submit-button-click-during-pageshow.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/form-submit-button-click.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/form-submit-cross-frame-crossorigin.sub.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/form-submit-cross-frame.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/form-submit-during-load.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/form-submit-during-pageshow.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/form-submit-popup-crossorigin.sub.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/form-submit-popup.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/form-submit.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/history-pushstate-during-load.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/history-pushstate-during-pageshow.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/history-pushstate.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/iframe-src-during-load.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/iframe-src-during-pageshow.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/iframe-src.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/location-assign-during-load.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/location-assign-during-pageshow.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/location-assign-user-click.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/location-assign.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/location-setter-during-load.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/location-setter-during-pageshow.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/location-setter-user-click.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/location-setter-user-mouseup.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/location-setter.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/resources/code-injector.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/resources/helpers.js create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/resources/message-opener.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/resources/slow-code-injector.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/resources/slow-message-source-with-history-and-location.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/window-open-popup-during-load.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/window-open-popup-during-pageshow.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/window-open-popup.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/window-open-self-during-load.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/window-open-self-during-pageshow.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/window-open-self.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/resources/blank.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/resources/child-navigates-parent-cross-origin-inner.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/resources/child-navigates-parent-destination.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/resources/child-navigates-parent-location-initial.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/resources/child-navigates-parent-location-inner.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/resources/child-navigates-parent-submit-initial.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/resources/child-navigates-parent-submit-inner.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/resources/click.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/resources/document-domain-set-to-site.sub.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/resources/form.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/resources/href.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/resources/message-opener.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/resources/message-parent.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/resources/multi-globals-subframe-1.sub.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/resources/multi-globals-subframe-2.sub.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/resources/no-cache-single-redirect.py create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/resources/page-that-post-message-to-opener.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/resources/page-with-top-navigating-iframe.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/resources/portable-document-format-sample-valid.pdf create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/resources/portable-document-format-sample-valid.pdf.headers create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/resources/redirect.py create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/resources/top-navigating-page.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/resources/wait-for-messages.js create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/resources/xhtml-and-non-utf-8.xhtml create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/source/navigate-child-function-parent-then-fragment.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/source/navigate-child-function-parent.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/source/navigate-child-function-src.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/source/navigate-child-function.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/source/navigate-child-src-about-blank.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/source/support/dummy.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/source/support/location-set.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/source/support/set-parent-src.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/top-level-data-url.window.js (limited to 'testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents') diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/003-1.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/003-1.html new file mode 100644 index 0000000000..4d2229eb51 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/003-1.html @@ -0,0 +1,7 @@ + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/003-2.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/003-2.html new file mode 100644 index 0000000000..827a069479 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/003-2.html @@ -0,0 +1,9 @@ + +003-2 + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/003-3.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/003-3.html new file mode 100644 index 0000000000..8b26c896fd --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/003-3.html @@ -0,0 +1,4 @@ + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/003.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/003.html new file mode 100644 index 0000000000..f437150960 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/003.html @@ -0,0 +1,22 @@ + +Navigation from unload whilst traversing history + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/004-1.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/004-1.html new file mode 100644 index 0000000000..02f916fd9c --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/004-1.html @@ -0,0 +1,7 @@ + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/004-2.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/004-2.html new file mode 100644 index 0000000000..f2ef83ee1a --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/004-2.html @@ -0,0 +1,9 @@ + +003-2 + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/004-3.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/004-3.html new file mode 100644 index 0000000000..c98711ae98 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/004-3.html @@ -0,0 +1,4 @@ + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/004.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/004.html new file mode 100644 index 0000000000..dddde4918b --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/004.html @@ -0,0 +1,22 @@ + +Navigation from unload whilst traversing cross-origin history + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/005.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/005.html new file mode 100644 index 0000000000..a87e6e9b3d --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/005.html @@ -0,0 +1,16 @@ + +Link with onclick navigation and href navigation + + +
+ +Test + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/006.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/006.html new file mode 100644 index 0000000000..17b3123faa --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/006.html @@ -0,0 +1,17 @@ + +Link with onclick form submit and href navigation + + +
+ +
+Test + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/007.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/007.html new file mode 100644 index 0000000000..dbb23ee644 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/007.html @@ -0,0 +1,16 @@ + +Link with onclick javascript url and href navigation + + +
+ +Test + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/008.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/008.html new file mode 100644 index 0000000000..3201d0679d --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/008.html @@ -0,0 +1,17 @@ + +Link with onclick form submit to javascript url and href navigation + + +
+ +
+Test + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/009.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/009.html new file mode 100644 index 0000000000..d963bed2bf --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/009.html @@ -0,0 +1,22 @@ + +Link with onclick form submit to javascript url with document.write and href navigation + + +
+ +
+Test + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/010.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/010.html new file mode 100644 index 0000000000..606ad82f48 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/010.html @@ -0,0 +1,17 @@ + +Link with onclick form submit to javascript url with delayed document.write and href navigation + + +
+ +
+Test + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/011.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/011.html new file mode 100644 index 0000000000..4d54267968 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/011.html @@ -0,0 +1,21 @@ + +Link with onclick navigation to javascript url with document.write and href navigation + + +
+ +Test + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/012.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/012.html new file mode 100644 index 0000000000..3795975d70 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/012.html @@ -0,0 +1,20 @@ + +Link with onclick navigation to javascript url with delayed document.write and href navigation + + +
+ + +Test + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/013.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/013.html new file mode 100644 index 0000000000..36a4521843 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/013.html @@ -0,0 +1,20 @@ + +Link with onclick navigation to javascript url with delayed document.write and href navigation + + +
+ +Test + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/014.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/014.html new file mode 100644 index 0000000000..b27ca992bd --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/014.html @@ -0,0 +1,21 @@ + + Link with javascript onclick form submission script order + + +
+ +
+Test + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/015.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/015.html new file mode 100644 index 0000000000..696aaec2c8 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/015.html @@ -0,0 +1,20 @@ + + Link with javascript onclick and href script order + + +
+ +Test + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/abort-document-load-1.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/abort-document-load-1.html new file mode 100644 index 0000000000..50a9a50fa0 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/abort-document-load-1.html @@ -0,0 +1,32 @@ + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/abort-document-load-2.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/abort-document-load-2.html new file mode 100644 index 0000000000..966b93c51a --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/abort-document-load-2.html @@ -0,0 +1,32 @@ + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/abort-document-load.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/abort-document-load.html new file mode 100644 index 0000000000..4a4c3df4e7 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/abort-document-load.html @@ -0,0 +1,30 @@ + +Aborting a Document load + + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/about-srcdoc-navigation-blocked.window.js b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/about-srcdoc-navigation-blocked.window.js new file mode 100644 index 0000000000..659f7321c0 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/about-srcdoc-navigation-blocked.window.js @@ -0,0 +1,45 @@ +// META: title=Navigation to about:srcdoc, not via srcdoc="", must be blocked +// META: script=../resources/helpers.js + +promise_test(async t => { + const iframe = await addSrcdocIframe(); + + iframe.contentWindow.location = "/common/blank.html"; + await waitForIframeLoad(iframe); + + iframe.contentWindow.location = "about:srcdoc"; + + // Fetching "about:srcdoc" should result in a network error, and navigating + // to a network error should produce an opaque-origin page. In particular, + // since the error page should end up being cross-origin to the parent + // frame, `contentDocument` should return `null`. + // + // If instead this results in a message because we re-loaded a srcdoc document + // from the contents of the srcdoc="" attribute, immediately fail. + await Promise.race([ + t.step_wait(() => iframe.contentDocument === null), + failOnMessage(iframe.contentWindow) + ]); +}, "Navigations to about:srcdoc via window.location must be blocked"); + +promise_test(async t => { + const iframe = await addSrcdocIframe(); + iframe.contentWindow.name = "test_frame"; + + iframe.contentWindow.location = "/common/blank.html"; + await waitForIframeLoad(iframe); + + window.open("about:srcdoc", "test_frame"); + + // Fetching "about:srcdoc" should result in a network error, and navigating + // to a network error should produce an opaque-origin page. In particular, + // since the error page should end up being cross-origin to the parent + // frame, `contentDocument` should return `null`. + // + // If instead this results in a message because we re-loaded a srcdoc document + // from the contents of the srcdoc="" attribute, immediately fail. + await Promise.race([ + t.step_wait(() => iframe.contentDocument === null), + failOnMessage(iframe.contentWindow) + ]); +}, "Navigations to about:srcdoc via window.open() must be blocked"); diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/anchor-fragment-form-submit-longfragment.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/anchor-fragment-form-submit-longfragment.html new file mode 100644 index 0000000000..8b9802f589 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/anchor-fragment-form-submit-longfragment.html @@ -0,0 +1,29 @@ + + + + +Anchor element with onclick form submission and href to fragment + + + + + + +
+Test + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/anchor-fragment-form-submit-withpath.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/anchor-fragment-form-submit-withpath.html new file mode 100644 index 0000000000..823174181e --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/anchor-fragment-form-submit-withpath.html @@ -0,0 +1,35 @@ + + + + +Anchor element with onclick form submission and href to fragment + + + + + + +
+Test + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/anchor-fragment-form-submit.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/anchor-fragment-form-submit.html new file mode 100644 index 0000000000..e0c0e6f82d --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/anchor-fragment-form-submit.html @@ -0,0 +1,29 @@ + + + + +Anchor element with onclick form submission and href to fragment + + + + + + +
+Test + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/anchor-jsurl-form-submit.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/anchor-jsurl-form-submit.html new file mode 100644 index 0000000000..1bf5d3595a --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/anchor-jsurl-form-submit.html @@ -0,0 +1,29 @@ + + + + +Anchor element with onclick form submission and href to javascript: url + + + + + + +
+Test + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/child-navigates-parent-cross-origin.window.js b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/child-navigates-parent-cross-origin.window.js new file mode 100644 index 0000000000..c5bed0fd4c --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/child-navigates-parent-cross-origin.window.js @@ -0,0 +1,90 @@ +// META: script=/common/get-host-info.sub.js +// META: script=resources/wait-for-messages.js + +function testNavigationFails(params) { + return async (t) => { + // Start waiting for messages before inserting the child frame, to avoid any + // race conditions. Note that this would be racy if we executed tests + // concurrently, thankfully `promise_test` executes sequentially. See also: + // https://github.com/web-platform-tests/rfcs/pull/75 + const messagesPromise = waitForMessages(1); + + // Execute the test in an iframe, so that the document executing the test + // is not navigated away mid-test in case of failure. + const child = document.createElement("iframe"); + document.body.appendChild(child); + t.add_cleanup(() => { document.body.removeChild(child); }); + + const url = new URL( + "resources/child-navigates-parent-cross-origin-inner.html", + window.location); + + // Load the grandchild iframe from a different origin. + url.host = get_host_info().REMOTE_HOST; + + for (const key in params || {}) { + url.searchParams.set(key, params[key]); + } + + const grandchild = child.contentDocument.createElement("iframe"); + grandchild.src = url; + child.contentDocument.body.appendChild(grandchild); + + const messages = await messagesPromise; + assert_array_equals(messages, ["error: SecurityError"]); + } +} + +promise_test( + testNavigationFails(), + "Child document attempts to navigate cross-origin parent via location"); + +promise_test( + testNavigationFails({ "property": "hash" }), + "Child document attempts to navigate cross-origin parent via "+ + "location.hash"); + +promise_test( + testNavigationFails({ "property": "host" }), + "Child document attempts to navigate cross-origin parent via "+ + "location.host"); + +promise_test( + testNavigationFails({ "property": "hostname" }), + "Child document attempts to navigate cross-origin parent via "+ + "location.hostname"); + +promise_test( + testNavigationFails({ "property": "href" }), + "Child document attempts to navigate cross-origin parent via "+ + "location.href"); + +promise_test( + testNavigationFails({ "property": "pathname" }), + "Child document attempts to navigate cross-origin parent via "+ + "location.pathname"); + +promise_test( + testNavigationFails({ "property": "protocol" }), + "Child document attempts to navigate cross-origin parent via "+ + "location.protocol"); + +promise_test( + testNavigationFails({ "property": "reload" }), + "Child document attempts to navigate cross-origin parent via "+ + "location.reload()"); + +promise_test( + testNavigationFails({ "property": "replace" }), + "Child document attempts to navigate cross-origin parent via "+ + "location.replace()"); + +promise_test( + testNavigationFails({ "property": "search" }), + "Child document attempts to navigate cross-origin parent via "+ + "location.search"); + +promise_test( + testNavigationFails({ "property": "xxxNonExistent" }), + "Child document attempts to navigate cross-origin parent via non-standard "+ + "location property"); diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/child-navigates-parent-same-origin.window.js b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/child-navigates-parent-same-origin.window.js new file mode 100644 index 0000000000..a40c412029 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/child-navigates-parent-same-origin.window.js @@ -0,0 +1,24 @@ +// META: script=resources/wait-for-messages.js + +function testNavigation(url) { + return async (t) => { + // Start waiting for messages before inserting the child frame, to avoid any + // race conditions. + const messagesPromise = waitForMessages(3); + + const iframe = document.createElement("iframe"); + iframe.src = url; + document.body.appendChild(iframe); + + const messages = await messagesPromise; + assert_array_equals(messages, ["initial", "inner", "destination"]); + } +} + +promise_test( + testNavigation("resources/child-navigates-parent-location-initial.html"), + "Child document navigates same-origin parent via document.location"); + +promise_test( + testNavigation("resources/child-navigates-parent-submit-initial.html"), + "Child document navigates same-origin parent via form submission"); diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/cross-origin-top-navigation-with-user-activation-in-parent.window.js b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/cross-origin-top-navigation-with-user-activation-in-parent.window.js new file mode 100644 index 0000000000..42b4b208ee --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/cross-origin-top-navigation-with-user-activation-in-parent.window.js @@ -0,0 +1,8 @@ +async_test(t => { + addEventListener('message', t.step_func_done(e => { + assert_equals(e.data, 'Denied'); + })); + const w = open("resources/page-with-top-navigating-iframe.html?parent_user_gesture=true"); + t.add_cleanup(() => {w.close()}); + +}, "Cross-origin top navigation is blocked without user activation, even if the parent has user activation"); diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/cross-origin-top-navigation-without-user-activation.window.js b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/cross-origin-top-navigation-without-user-activation.window.js new file mode 100644 index 0000000000..57f0bce247 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/cross-origin-top-navigation-without-user-activation.window.js @@ -0,0 +1,8 @@ +async_test(t => { + addEventListener('message', t.step_func_done(e => { + assert_equals(e.data, 'Denied'); + })); + const w = open("resources/page-with-top-navigating-iframe.html"); + t.add_cleanup(() => {w.close()}); + +}, "Cross-origin top navigation is blocked without user activation"); diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/empty-iframe-load-event.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/empty-iframe-load-event.html new file mode 100644 index 0000000000..b9108f9937 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/empty-iframe-load-event.html @@ -0,0 +1,39 @@ + +load event for empty iframe in relation to the event loop + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/empty_fragment.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/empty_fragment.html new file mode 100644 index 0000000000..18a6f84c9f --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/empty_fragment.html @@ -0,0 +1,20 @@ + + +Navigating to the same URL with an empty fragment aborts the navigation + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/empty_fragment_iframe.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/empty_fragment_iframe.html new file mode 100644 index 0000000000..26b28a0d7d --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/empty_fragment_iframe.html @@ -0,0 +1,11 @@ + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/failure-check-sequence.https.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/failure-check-sequence.https.html new file mode 100644 index 0000000000..5d7aa2b9cb --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/failure-check-sequence.https.html @@ -0,0 +1,76 @@ + + + + +Sequence of the checks performed against a navigation response + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/iframe-nosrc.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/iframe-nosrc.html new file mode 100644 index 0000000000..b89d3bb54b --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/iframe-nosrc.html @@ -0,0 +1,178 @@ + + +Navigations on iframe without src attribute + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/iframe-src-204-fragment.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/iframe-src-204-fragment.html new file mode 100644 index 0000000000..2a472f6a6d --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/iframe-src-204-fragment.html @@ -0,0 +1,144 @@ + + +Fragment navigations on iframe with src set to URL that doesn't load a document (HTTP 204) + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/iframe-src-204-pushState-replaceState.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/iframe-src-204-pushState-replaceState.html new file mode 100644 index 0000000000..8a97fd36a4 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/iframe-src-204-pushState-replaceState.html @@ -0,0 +1,66 @@ + + +pushState/replaceState on iframe with src set to URL that doesn't load a document (HTTP 204) + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/iframe-src-204.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/iframe-src-204.html new file mode 100644 index 0000000000..f7bade68fb --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/iframe-src-204.html @@ -0,0 +1,178 @@ + + +Navigations on iframe with src set to URL that doesn't load a new document + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/iframe-src-aboutblank-navigate-immediately.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/iframe-src-aboutblank-navigate-immediately.html new file mode 100644 index 0000000000..a75257d91c --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/iframe-src-aboutblank-navigate-immediately.html @@ -0,0 +1,124 @@ + + +Navigations immediately after appending iframe with src='about:blank' + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/iframe-src-aboutblank-wait-for-load.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/iframe-src-aboutblank-wait-for-load.html new file mode 100644 index 0000000000..b7066ce521 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/iframe-src-aboutblank-wait-for-load.html @@ -0,0 +1,134 @@ + + +Navigations after iframe with src='about:blank' finished loading + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/initial-content-replacement.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/initial-content-replacement.html new file mode 100644 index 0000000000..44f890df6c --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/initial-content-replacement.html @@ -0,0 +1,86 @@ + + + + Content synchronously added to iframe/opened window's document after creation + won't get replaced asynchronously when staying on the initial empty document + + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/load-event-iframe-element.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/load-event-iframe-element.html new file mode 100644 index 0000000000..0d19770cc1 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/load-event-iframe-element.html @@ -0,0 +1,64 @@ + + +"load" event fires on the iframe element when loading the initial empty document + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/load-pageshow-events-iframe-contentWindow.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/load-pageshow-events-iframe-contentWindow.html new file mode 100644 index 0000000000..4aea4aac81 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/load-pageshow-events-iframe-contentWindow.html @@ -0,0 +1,44 @@ + + +"load" & "pageshow" events do not fire on contentWindow of iframe that stays on the initial empty document + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/load-pageshow-events-window-open.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/load-pageshow-events-window-open.html new file mode 100644 index 0000000000..9703502f7f --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/load-pageshow-events-window-open.html @@ -0,0 +1,35 @@ + + +"load" and "pageshow" events don't fire on window.open() that stays on the initial empty document + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/resources/code-injector.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/resources/code-injector.html new file mode 100644 index 0000000000..631b95f9ed --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/resources/code-injector.html @@ -0,0 +1,8 @@ + + +Subframe + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/resources/helpers.js b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/resources/helpers.js new file mode 100644 index 0000000000..8d9473a949 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/resources/helpers.js @@ -0,0 +1,121 @@ +// Returns a promise that asserts the "load" and "pageshow" events are not +// fired on |target|. +function assertNoLoadAndPageshowEvent(t, target) { + target.addEventListener("load", t.unreached_func("load should not be fired")); + target.addEventListener("pageshow", t.unreached_func("pageshow should not be fired")); + return new Promise(resolve => { + // Wait 50ms to ensure events fired after asynchronous navigations are + // also captured. + setTimeout(resolve, 50); + }); +} + +const url204 = "/common/blank.html?pipe=status(204)"; +const postMessageToOpenerOnLoad = ` + window.onload = () => { + window.opener.postMessage("loaded", "*") + } + `; + +// -- Start of helpers for iframe initial empty document tests. + +// Creates an iframe with an unset src and appends it to the document. +window.insertIframe = (t) => { + const iframe = document.createElement("iframe"); + t.add_cleanup(() => iframe.remove()); + document.body.append(iframe); + return iframe; +}; + +// Creates an iframe with src set to a URL that doesn't commit a new document +// (results in a HTTP 204 response) and appends it to the document. +window.insertIframeWith204Src = (t) => { + const iframe = document.createElement("iframe"); + iframe.src = url204; + t.add_cleanup(() => iframe.remove()); + document.body.append(iframe); + return iframe; +}; + +// Creates an iframe with src="about:blank" and appends it to the document. +window.insertIframeWithAboutBlankSrc = (t) => { + const iframe = document.createElement("iframe"); + t.add_cleanup(() => iframe.remove()); + iframe.src = "about:blank"; + document.body.append(iframe); + return iframe; +}; + +// Creates an iframe with src="about:blank", appends it to the document, and +// waits for the non-initial about:blank document finished loading. +window.insertIframeWithAboutBlankSrcWaitForLoad = async (t) => { + const iframe = insertIframeWithAboutBlankSrc(t); + const aboutBlankLoad = new Promise(resolve => { + // In some browsers, the non-initial about:blank navigation commits + // asynchronously, while in other browsers, it would commit synchronously. + // This means we can't wait for the "load" event as it might have already + // ran. Instead, just wait for 100ms before resolving, as the non-initial + // about:blank navigation will most likely take less than 100 ms to commit. + t.step_timeout(resolve, 100); + }); + await aboutBlankLoad; + return iframe; +}; + +// Waits for the "load" event for |urlRelativeToThisDocument| to run on +// |iframe|. +window.waitForLoad = (t, iframe, urlRelativeToThisDocument) => { + return new Promise(resolve => { + iframe.addEventListener("load", t.step_func(() => { + assert_equals(iframe.contentWindow.location.href, (new URL(urlRelativeToThisDocument, location.href)).href); + + // Wait a bit longer to ensure all history stuff has settled, e.g. the document is "completely loaded" + // (which happens from a queued task). + setTimeout(resolve, 0); + }), { once: true }); + }); +}; + +// -- End of helpers for iframe initial empty document tests. + +// -- Start of helpers for opened windows' initial empty document tests. + +// window.open() to a URL that doesn't load a new document (results in a HTTP +// 204 response). This should create a new window that stays on the initial +// empty document. +window.windowOpen204 = (t) => { + const openedWindow = window.open(url204); + t.add_cleanup(() => openedWindow.close()); + return openedWindow; +}; + +// window.open() (no URL set). This should create a new window that stays on +// the initial empty document as it won't trigger a non-initial about:blank +// navigation. +window.windowOpenNoURL = (t) => { + const openedWindow = window.open(); + t.add_cleanup(() => openedWindow.close()); + return openedWindow; +}; + +// window.open("about:blank"). This should create a new window that stays on +// the initial empty document as it won't trigger a non-initial about:blank +// navigation. +window.windowOpenAboutBlank = (t) => { + const openedWindow = window.open("about:blank"); + t.add_cleanup(() => openedWindow.close()); + return openedWindow; +}; + +// Waits for a postMessage with data set to |message| is received on the current +// window. +window.waitForMessage = (t, message) => { + return new Promise(resolve => { + window.addEventListener("message", t.step_func((event) => { + if (event.data == message) + resolve(); + })); + }); +}; + +// -- End of helpers for opened windows' initial empty document tests. diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/window-open-204-fragment.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/window-open-204-fragment.html new file mode 100644 index 0000000000..bb47cd3820 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/window-open-204-fragment.html @@ -0,0 +1,63 @@ + + +Fragment navigation on initial empty document created through window.open(url-with-204-response) + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/window-open-204-pushState-replaceState.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/window-open-204-pushState-replaceState.html new file mode 100644 index 0000000000..b5382b189f --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/window-open-204-pushState-replaceState.html @@ -0,0 +1,61 @@ + + +Fragment navigation on initial empty document created through window.open(url-with-204-response) + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/window-open-204.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/window-open-204.html new file mode 100644 index 0000000000..6461b3c8fc --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/window-open-204.html @@ -0,0 +1,81 @@ + + +Navigations on window.open() with URL that doesn't load a new document + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/window-open-aboutblank.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/window-open-aboutblank.html new file mode 100644 index 0000000000..f3033d6a21 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/window-open-aboutblank.html @@ -0,0 +1,81 @@ + + +Navigations on window.open(about:blank) after waiting for it to load + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/window-open-history-length.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/window-open-history-length.html new file mode 100644 index 0000000000..ab89bc4098 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/window-open-history-length.html @@ -0,0 +1,31 @@ + + +history.length value on window.open()-ed window + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/window-open-nourl.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/window-open-nourl.html new file mode 100644 index 0000000000..801f77ad48 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/window-open-nourl.html @@ -0,0 +1,78 @@ + + +Navigations on window.open() to URL that doesn't load a new document + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/javascript-url-abort/javascript-url-abort-return-value-string.tentative.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/javascript-url-abort/javascript-url-abort-return-value-string.tentative.html new file mode 100644 index 0000000000..f626a79ae6 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/javascript-url-abort/javascript-url-abort-return-value-string.tentative.html @@ -0,0 +1,28 @@ + +Aborting fetch for javascript:string navigation + + + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/javascript-url-abort/javascript-url-abort-return-value-undefined.tentative.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/javascript-url-abort/javascript-url-abort-return-value-undefined.tentative.html new file mode 100644 index 0000000000..80a0d27a7d --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/javascript-url-abort/javascript-url-abort-return-value-undefined.tentative.html @@ -0,0 +1,25 @@ + +Not aborting fetch for javascript:undefined navigation + + + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/javascript-url-abort/support/iframe-and-links.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/javascript-url-abort/support/iframe-and-links.html new file mode 100644 index 0000000000..545b0988ba --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/javascript-url-abort/support/iframe-and-links.html @@ -0,0 +1,18 @@ + + + + + + +slow link +javascript:string link +javascript:undefined link + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/javascript-url-abort/support/set-child-loaded.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/javascript-url-abort/support/set-child-loaded.html new file mode 100644 index 0000000000..a4b34ad6e9 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/javascript-url-abort/support/set-child-loaded.html @@ -0,0 +1,5 @@ + +set-child-loaded.html + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/javascript-url-global-scope.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/javascript-url-global-scope.html new file mode 100644 index 0000000000..d3dd38ebed --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/javascript-url-global-scope.html @@ -0,0 +1,16 @@ + + + + + +link + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/javascript-url-load-as-html.xhtml b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/javascript-url-load-as-html.xhtml new file mode 100644 index 0000000000..b23bef5917 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/javascript-url-load-as-html.xhtml @@ -0,0 +1,37 @@ + + + + + + + + javascript: URL navigation to a string must create a HTML document using the correct properties + + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/javascript-url-no-beforeunload.window.js b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/javascript-url-no-beforeunload.window.js new file mode 100644 index 0000000000..47e8f11797 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/javascript-url-no-beforeunload.window.js @@ -0,0 +1,80 @@ +// META: script=../resources/helpers.js + +for (const stringCompletion of [false, true]) { + const testNameSuffix = stringCompletion ? ": string completion" : ": undefined completion"; + + testNoBeforeunload( + { testRunnerWindow: "top", stringCompletion }, + async (t, urlToSet) => { + const iframe = await addIframe(); + iframe.contentWindow.location.href = urlToSet; + + return iframe.contentWindow; + }, + `Navigating an iframe via location.href to a javascript: URL must not fire beforeunload${testNameSuffix}` + ); + + testNoBeforeunload( + { testRunnerWindow: "top", stringCompletion }, + async (t, urlToSet) => { + const iframe = await addIframe(); + iframe.src = urlToSet; + + return iframe.contentWindow; + }, + `Navigating an iframe via src="" to a javascript: URL after insertion must not fire beforeunload${testNameSuffix}` + ); + + testNoBeforeunload( + { testRunnerWindow: "opener", stringCompletion }, + async (t, urlToSet) => { + const w = await openWindow("/common/blank.html", t); + w.location.href = urlToSet; + + return w; + }, + `Navigating an opened window via location.href to a javascript: URL must not fire beforeunload${testNameSuffix}` + ); + + + testNoBeforeunload( + { testRunnerWindow: "opener", stringCompletion }, + async (t, urlToSet) => { + const w = await openWindow("../resources/has-iframe.html", t); + w.frames[0].onbeforeunload = t.unreached_func("beforeunload must not fire on the iframe"); + w.location.href = urlToSet; + + return w; + }, + `Navigating an opened window with an iframe via location.href to a javascript: URL must not fire beforeunload on the iframe${testNameSuffix}` + ); +} + +function testNoBeforeunload({ testRunnerWindow, stringCompletion }, setupAndNavigateFunc, description) { + promise_test(async t => { + t.add_cleanup(() => { + delete window.resolveTestPromise; + }); + + const ranPromise = new Promise(resolve => { + window.resolveTestPromise = resolve; + }); + + const urlToSet = makeURL({ testRunnerWindow, stringCompletion }); + const w = await setupAndNavigateFunc(t, urlToSet); + w.onbeforeunload = t.unreached_func("beforeunload must not fire"); + + await ranPromise; + if (stringCompletion) { + await waitForMessage(w); + } + }, description); +} + +function makeURL({ testRunnerWindow, stringCompletion }) { + const completion = stringCompletion ? + `"a string";` : + `undefined;`; + + return `javascript:window.${testRunnerWindow}.resolveTestPromise();${completion};`; +} diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/javascript-url-query-fragment-components.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/javascript-url-query-fragment-components.html new file mode 100644 index 0000000000..eced9646e5 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/javascript-url-query-fragment-components.html @@ -0,0 +1,28 @@ + + javascript url with query and fragment components + + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/javascript-url-referrer.window.js b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/javascript-url-referrer.window.js new file mode 100644 index 0000000000..1f11429c9e --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/javascript-url-referrer.window.js @@ -0,0 +1,38 @@ +// META: script=../resources/helpers.js +// META: title=javascript: URL navigation to a string must create a document whose referrer is the navigation initiator + +const originalURL = location.href; + +const testCases = [ + ["unsafe-url", location.href], + ["origin", self.origin + "/"], + ["no-referrer", ""] +]; + +for (const [referrerPolicyForStartingWindowCreation, expectedReferrer] of testCases) { + promise_test(async (t) => { + const meta = document.createElement("meta"); + meta.name = "referrer"; + meta.content = referrerPolicyForStartingWindowCreation; + t.add_cleanup(() => meta.remove()); + document.head.append(meta); + + const w = await openWindow("/common/blank.html", t); + const originalReferrer = w.document.referrer; + assert_equals(originalReferrer, expectedReferrer, + "Sanity check: opened window's referrer is set correctly"); + + // Mess with the current document's URL so that the initiator URL is different. Then, if that + // shows up as the javascript: URL document's referrer, we know the navigation initiator's URL is + // being used as the referrer, which is incorrect. + history.replaceState(undefined, "", "/incorrect-referrer.html"); + t.add_cleanup(() => history.replaceState(undefined, "", originalURL)); + + w.location.href = `javascript:'a string'`; + + const referrer = await waitForMessage(w); + + assert_equals(referrer, originalReferrer, + "javascript: URL-created document's referrer equals the previous document's referrer"); + }, `${referrerPolicyForStartingWindowCreation} referrer policy used to create the starting page`); +} diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/javascript-url-return-value-handling-dynamic.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/javascript-url-return-value-handling-dynamic.html new file mode 100644 index 0000000000..3c08d29674 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/javascript-url-return-value-handling-dynamic.html @@ -0,0 +1,58 @@ + + +Test javascript URL string return values in direct and indirect (target) frame contexts. + + + +
+ diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/javascript-url-return-value-handling.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/javascript-url-return-value-handling.html new file mode 100644 index 0000000000..621a8cbaec --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/javascript-url-return-value-handling.html @@ -0,0 +1,36 @@ + + +Test that javascript: evaluation only performs a navigation to the + result when the result is a string value. + + + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/javascript-url-security-check-failure.sub.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/javascript-url-security-check-failure.sub.html new file mode 100644 index 0000000000..a153ad3e48 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/javascript-url-security-check-failure.sub.html @@ -0,0 +1,56 @@ + + +javascript: URL security check + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/javascript-url-security-check-multi-globals.sub.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/javascript-url-security-check-multi-globals.sub.html new file mode 100644 index 0000000000..4b9d3b7afa --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/javascript-url-security-check-multi-globals.sub.html @@ -0,0 +1,66 @@ + + +Multi-globals: which one is the initiator for the javascript: URL security check? + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/javascript-url-security-check-same-origin-domain.sub.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/javascript-url-security-check-same-origin-domain.sub.html new file mode 100644 index 0000000000..a14a13cfd6 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/javascript-url-security-check-same-origin-domain.sub.html @@ -0,0 +1,26 @@ + + +javascript: URL security check for same-origin-domain but not same-origin + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/javascript-url-task-queuing.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/javascript-url-task-queuing.html new file mode 100644 index 0000000000..1bb05bfb19 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/javascript-url-task-queuing.html @@ -0,0 +1,58 @@ + + +javascript: URL task queuing + + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/multiple-globals/context-for-location-assign.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/multiple-globals/context-for-location-assign.html new file mode 100644 index 0000000000..cb2984d409 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/multiple-globals/context-for-location-assign.html @@ -0,0 +1,27 @@ + + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/multiple-globals/context-for-location-href.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/multiple-globals/context-for-location-href.html new file mode 100644 index 0000000000..02ff214ed5 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/multiple-globals/context-for-location-href.html @@ -0,0 +1,27 @@ + + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/multiple-globals/context-for-location.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/multiple-globals/context-for-location.html new file mode 100644 index 0000000000..fae17dd2ac --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/multiple-globals/context-for-location.html @@ -0,0 +1,27 @@ + + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/multiple-globals/context-for-window-open.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/multiple-globals/context-for-window-open.html new file mode 100644 index 0000000000..0a391ef28e --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/multiple-globals/context-for-window-open.html @@ -0,0 +1,28 @@ + + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/multiple-globals/entry/entry.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/multiple-globals/entry/entry.html new file mode 100644 index 0000000000..82fecfdd38 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/multiple-globals/entry/entry.html @@ -0,0 +1,4 @@ + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/multiple-globals/entry/target.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/multiple-globals/entry/target.html new file mode 100644 index 0000000000..5ceaeaf07e --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/multiple-globals/entry/target.html @@ -0,0 +1,2 @@ + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/multiple-globals/incumbent/empty.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/multiple-globals/incumbent/empty.html new file mode 100644 index 0000000000..e69de29bb2 diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/multiple-globals/incumbent/target.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/multiple-globals/incumbent/target.html new file mode 100644 index 0000000000..5ceaeaf07e --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/multiple-globals/incumbent/target.html @@ -0,0 +1,2 @@ + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/multiple-globals/relevant/empty.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/multiple-globals/relevant/empty.html new file mode 100644 index 0000000000..e69de29bb2 diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/multiple-globals/relevant/target.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/multiple-globals/relevant/target.html new file mode 100644 index 0000000000..5ceaeaf07e --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/multiple-globals/relevant/target.html @@ -0,0 +1,2 @@ + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/multiple-globals/resources/context-helper.js b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/multiple-globals/resources/context-helper.js new file mode 100644 index 0000000000..dda338b4cc --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/multiple-globals/resources/context-helper.js @@ -0,0 +1,34 @@ +// Usage: in the top-level Window, include: +// +// +// +// +// +// Then `scriptToRun` is evaluated, with: +// - The entry Realm is that of entry/entry.html +// - The incumbent Realm is that of incumbent/empty.html +// - The relevant Realm of `relevantWindow`, `relevantWindow.location` etc. is +// that of relevant/empty.html + +window.scriptToRun = ''; + +const entryUrl = new URL('entry/entry.html', location).href; +const incumbentUrl = new URL('incumbent/empty.html', location).href; +const relevantUrl = new URL('relevant/empty.html', location).href; + +function go() { + const entry = document.querySelector('#entry'); + const incumbent = entry.contentDocument.querySelector('#incumbent'); + const incumbentScript = incumbent.contentDocument.createElement('script'); + incumbentScript.textContent = ` + function go() { + const relevantWindow = + parent.document.querySelector('#relevant').contentWindow; + ${window.scriptToRun} + } + `; + incumbent.contentDocument.head.appendChild(incumbentScript); + incumbent.contentWindow.go(); +} diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/multiple-globals/resources/target.js b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/multiple-globals/resources/target.js new file mode 100644 index 0000000000..e3a507b0d8 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/multiple-globals/resources/target.js @@ -0,0 +1,11 @@ +window.onload = function() { + let testWindow; + if (opener) { + testWindow = opener.top; + } else { + testWindow = top; + } + testWindow.postMessage( + {location: location.href, referrer: document.referrer}, + "*"); +} diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/navigate-cross-origin-iframe-to-same-url-with-fragment-fire-load-event.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/navigate-cross-origin-iframe-to-same-url-with-fragment-fire-load-event.html new file mode 100644 index 0000000000..f74bbfd7d3 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/navigate-cross-origin-iframe-to-same-url-with-fragment-fire-load-event.html @@ -0,0 +1,31 @@ + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/navigate-cross-origin-iframe-to-same-url-with-fragment.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/navigate-cross-origin-iframe-to-same-url-with-fragment.html new file mode 100644 index 0000000000..ed228ad59b --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/navigate-cross-origin-iframe-to-same-url-with-fragment.html @@ -0,0 +1,27 @@ + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/navigate-cross-origin-iframe-to-same-url.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/navigate-cross-origin-iframe-to-same-url.html new file mode 100644 index 0000000000..9996d58914 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/navigate-cross-origin-iframe-to-same-url.html @@ -0,0 +1,22 @@ + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/navigate-to-unparseable-url.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/navigate-to-unparseable-url.html new file mode 100644 index 0000000000..f4e4e36f37 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/navigate-to-unparseable-url.html @@ -0,0 +1,58 @@ + + +location.href unparseable URL throws a SyntaxError DOMException + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/navigation-unload-cross-origin.sub.window.js b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/navigation-unload-cross-origin.sub.window.js new file mode 100644 index 0000000000..f23e2c440b --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/navigation-unload-cross-origin.sub.window.js @@ -0,0 +1,15 @@ +// META: title=Cross-origin navigation started from unload handler must be ignored +// META: script=../resources/helpers.js + +promise_test(async () => { + const iframe = await addIframe(); + + iframe.contentWindow.addEventListener("unload", () => { + iframe.contentWindow.location.href = "//{{hosts[][www]}}/common/blank.html?fail"; + }); + + iframe.src = "/common/blank.html?pass"; + + await waitForIframeLoad(iframe); + assert_equals(iframe.contentWindow.location.search, "?pass"); +}); diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/navigation-unload-data-url.window.js b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/navigation-unload-data-url.window.js new file mode 100644 index 0000000000..cf39b01107 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/navigation-unload-data-url.window.js @@ -0,0 +1,15 @@ +// META: title=data: URL navigation started from unload handler must be ignored +// META: script=../resources/helpers.js + +promise_test(async () => { + const iframe = await addIframe(); + + iframe.contentWindow.addEventListener("unload", () => { + iframe.contentWindow.location.href = + `data:text/html,unload`; + }); + + iframe.src = + `data:text/html,load`; + assert_equals(await waitForMessage(iframe.contentWindow), "pass"); +}); diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/navigation-unload-form-submit-1.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/navigation-unload-form-submit-1.html new file mode 100644 index 0000000000..e06def9b20 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/navigation-unload-form-submit-1.html @@ -0,0 +1,23 @@ + + +

navigation-unload-form-submit-1.html

+ + + +
+ +
+ + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/navigation-unload-form-submit-2.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/navigation-unload-form-submit-2.html new file mode 100644 index 0000000000..43cd3c1b33 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/navigation-unload-form-submit-2.html @@ -0,0 +1,7 @@ + + +

navigation-unload-form-submit-2.html

+ + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/navigation-unload-form-submit.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/navigation-unload-form-submit.html new file mode 100644 index 0000000000..029170d46a --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/navigation-unload-form-submit.html @@ -0,0 +1,24 @@ + + + + + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/navigation-unload-javascript-url.window.js b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/navigation-unload-javascript-url.window.js new file mode 100644 index 0000000000..abbcb888a0 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/navigation-unload-javascript-url.window.js @@ -0,0 +1,15 @@ +// META: title=javascript: URL navigation started from unload handler must be ignored +// META: script=../resources/helpers.js + +promise_test(async () => { + const iframe = await addIframe(); + + iframe.contentWindow.addEventListener("unload", () => { + iframe.contentWindow.location.href = + `javascript:"unload"`; + }); + + iframe.src = + `javascript:"load"`; + assert_equals(await waitForMessage(iframe.contentWindow), "pass"); +}); diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/navigation-unload-same-origin-fragment-1.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/navigation-unload-same-origin-fragment-1.html new file mode 100644 index 0000000000..3b5d725fee --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/navigation-unload-same-origin-fragment-1.html @@ -0,0 +1,9 @@ + + +

navigation-unload-same-origin-fragment-1.html

+ + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/navigation-unload-same-origin-fragment-2.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/navigation-unload-same-origin-fragment-2.html new file mode 100644 index 0000000000..2fb7f50b43 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/navigation-unload-same-origin-fragment-2.html @@ -0,0 +1,9 @@ + + +

navigation-unload-same-origin-fragment-2.html

+ + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/navigation-unload-same-origin-fragment.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/navigation-unload-same-origin-fragment.html new file mode 100644 index 0000000000..c4dceb9e04 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/navigation-unload-same-origin-fragment.html @@ -0,0 +1,29 @@ + + + + + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/navigation-unload-same-origin.window.js b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/navigation-unload-same-origin.window.js new file mode 100644 index 0000000000..826af4b75b --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/navigation-unload-same-origin.window.js @@ -0,0 +1,15 @@ +// META: title=Same-origin navigation started from unload handler must be ignored +// META: script=../resources/helpers.js + +promise_test(async () => { + const iframe = await addIframe(); + + iframe.contentWindow.addEventListener("unload", () => { + iframe.contentWindow.location.href = "/common/blank.html?fail"; + }); + + iframe.src = "/common/blank.html?pass"; + + await waitForIframeLoad(iframe); + assert_equals(iframe.contentWindow.location.search, "?pass"); +}); diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/plugin-document.historical.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/plugin-document.historical.html new file mode 100644 index 0000000000..547917b795 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/plugin-document.historical.html @@ -0,0 +1,22 @@ + + +Same-origin PDFs must not create accessible Document objects + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/redirect-to-about.window.js b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/redirect-to-about.window.js new file mode 100644 index 0000000000..5480911895 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/redirect-to-about.window.js @@ -0,0 +1,34 @@ +"use strict"; + +["about:blank", "about:srcdoc", "about:nonstandard"].forEach(aboutURL => { + promise_test(async t => { + const iframe = document.createElement("iframe"); + iframe.src = `resources/redirect.py?location=${aboutURL}`; + document.body.append(iframe); + + // Unfortunately Firefox does not fire a load event for network errors yet, but there is no + // other way I can see to test this. (Also applicable below.) + await new Promise(r => iframe.onload = r); + + // Must throw since error pages are opaque origin. + assert_throws_dom("SecurityError", () => { + iframe.contentWindow.document; + }); + }, `An iframe with src set to a redirect to ${aboutURL}`); + + promise_test(async t => { + const iframe = document.createElement("iframe"); + iframe.src = "/common/blank.html"; + document.body.append(iframe); + + await new Promise(r => iframe.onload = r); + + iframe.contentWindow.location.href = `resources/redirect.py?location=${aboutURL}`; + await new Promise(r => iframe.onload = r); + + // Must throw since error pages are opaque origin. + assert_throws_dom("SecurityError", () => { + iframe.contentWindow.document; + }); + }, `An iframe that is navigated to a redirect to ${aboutURL}`); +}); diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/redirect-to-data.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/redirect-to-data.html new file mode 100644 index 0000000000..f9e8021ddf --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/redirect-to-data.html @@ -0,0 +1,75 @@ + + +Redirecting to data: URLs is disallowed + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/redirect-to-unparseable-url.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/redirect-to-unparseable-url.html new file mode 100644 index 0000000000..b025f34478 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/redirect-to-unparseable-url.html @@ -0,0 +1,71 @@ + + +Session history interaction with redirects to unparseable URLs + + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/refresh/README.md b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/refresh/README.md new file mode 100644 index 0000000000..52548db656 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/refresh/README.md @@ -0,0 +1 @@ +See `/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/parsing.html` for more detailed parsing tests (shared with ``). diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/refresh/navigate.window.js b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/refresh/navigate.window.js new file mode 100644 index 0000000000..7d5a0fe21d --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/refresh/navigate.window.js @@ -0,0 +1,23 @@ +async_test(t => { + const frame = document.createElement("iframe"); + frame.src = "resources/refresh.py" + frame.onload = t.step_func(() => { + // Could be better by verifying that resources/refresh.py loads too + if(frame.contentWindow.location.href === (new URL("resources/refreshed.txt?\u0080\u00FF", self.location)).href) { // Make sure bytes got mapped to code points of the same value + t.done(); + } + }); + document.body.appendChild(frame) +}, "When navigating the Refresh header needs to be followed"); + +async_test(t => { + const frame = document.createElement("iframe"); + frame.src = "resources/multiple.asis" + frame.onload = t.step_func(() => { + // Could be better by verifying that resources/refresh.py loads too + if(frame.contentWindow.location.href === (new URL("resources/refreshed.txt", self.location)).href) { + t.done(); + } + }); + document.body.appendChild(frame) +}, "When there's both a Refresh header and the Refresh header wins") diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/refresh/resources/multiple.asis b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/refresh/resources/multiple.asis new file mode 100644 index 0000000000..3026d8297b --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/refresh/resources/multiple.asis @@ -0,0 +1,6 @@ +HTTP/1.1 200 OK +Refresh: 0,./refreshed.txt +Content-Type:text/html + +I don't understand. + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/refresh/resources/refresh.py b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/refresh/resources/refresh.py new file mode 100644 index 0000000000..ecdd24f268 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/refresh/resources/refresh.py @@ -0,0 +1,4 @@ +def main(request, response): + response.headers.set(b"Content-Type", b"text/plain") + response.headers.set(b"Refresh", b"0;./refreshed.txt?\x80\xFF") # Test byte to Unicode conversion + response.content = u"Not refreshed.\n" diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/refresh/resources/refreshed.txt b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/refresh/resources/refreshed.txt new file mode 100644 index 0000000000..5df065b456 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/refresh/resources/refreshed.txt @@ -0,0 +1 @@ +Have another. diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/refresh/subresource.any.js b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/refresh/subresource.any.js new file mode 100644 index 0000000000..930dd34ad5 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/refresh/subresource.any.js @@ -0,0 +1,6 @@ +promise_test(() => { + return fetch("resources/refresh.py").then(response => { + assert_equals(response.headers.get("refresh"), "0;./refreshed.txt?\u0080\u00FF"); // Make sure bytes got mapped to code points of the same value + assert_equals(response.url, (new URL("resources/refresh.py", self.location)).href); + }); +}, "Refresh does not affect subresources."); diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/a-click-during-load.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/a-click-during-load.html new file mode 100644 index 0000000000..e035b1f517 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/a-click-during-load.html @@ -0,0 +1,32 @@ + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/a-click-during-pageshow.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/a-click-during-pageshow.html new file mode 100644 index 0000000000..006ce531e0 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/a-click-during-pageshow.html @@ -0,0 +1,32 @@ + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/a-click.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/a-click.html new file mode 100644 index 0000000000..be7d1a9849 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/a-click.html @@ -0,0 +1,30 @@ + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/a-user-click-during-load.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/a-user-click-during-load.html new file mode 100644 index 0000000000..811c828331 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/a-user-click-during-load.html @@ -0,0 +1,36 @@ + + + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/a-user-click-during-pageshow.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/a-user-click-during-pageshow.html new file mode 100644 index 0000000000..6621b081e1 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/a-user-click-during-pageshow.html @@ -0,0 +1,36 @@ + + + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/a-user-click.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/a-user-click.html new file mode 100644 index 0000000000..c9034f3573 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/a-user-click.html @@ -0,0 +1,34 @@ + + + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/form-requestsubmit-during-load.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/form-requestsubmit-during-load.html new file mode 100644 index 0000000000..0dee49edb3 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/form-requestsubmit-during-load.html @@ -0,0 +1,41 @@ + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/form-requestsubmit-during-pageshow.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/form-requestsubmit-during-pageshow.html new file mode 100644 index 0000000000..0cf0838496 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/form-requestsubmit-during-pageshow.html @@ -0,0 +1,41 @@ + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/form-requestsubmit.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/form-requestsubmit.html new file mode 100644 index 0000000000..80beb3718b --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/form-requestsubmit.html @@ -0,0 +1,39 @@ + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/form-submit-button-click-during-load.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/form-submit-button-click-during-load.html new file mode 100644 index 0000000000..1b3a163176 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/form-submit-button-click-during-load.html @@ -0,0 +1,45 @@ + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/form-submit-button-click-during-pageshow.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/form-submit-button-click-during-pageshow.html new file mode 100644 index 0000000000..c0022fd0f2 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/form-submit-button-click-during-pageshow.html @@ -0,0 +1,45 @@ + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/form-submit-button-click.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/form-submit-button-click.html new file mode 100644 index 0000000000..873c49b5be --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/form-submit-button-click.html @@ -0,0 +1,43 @@ + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/form-submit-cross-frame-crossorigin.sub.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/form-submit-cross-frame-crossorigin.sub.html new file mode 100644 index 0000000000..a2ea20bf7f --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/form-submit-cross-frame-crossorigin.sub.html @@ -0,0 +1,42 @@ + + + + + + +
+ +
+ + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/form-submit-cross-frame.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/form-submit-cross-frame.html new file mode 100644 index 0000000000..d647e6ad06 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/form-submit-cross-frame.html @@ -0,0 +1,40 @@ + + + + + + +
+ +
+ + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/form-submit-during-load.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/form-submit-during-load.html new file mode 100644 index 0000000000..2a60f44fc6 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/form-submit-during-load.html @@ -0,0 +1,41 @@ + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/form-submit-during-pageshow.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/form-submit-during-pageshow.html new file mode 100644 index 0000000000..886bf469a2 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/form-submit-during-pageshow.html @@ -0,0 +1,41 @@ + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/form-submit-popup-crossorigin.sub.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/form-submit-popup-crossorigin.sub.html new file mode 100644 index 0000000000..d54cc81477 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/form-submit-popup-crossorigin.sub.html @@ -0,0 +1,39 @@ + + + + + + +
+ +
+ + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/form-submit-popup.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/form-submit-popup.html new file mode 100644 index 0000000000..b27d54675d --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/form-submit-popup.html @@ -0,0 +1,37 @@ + + + + + + +
+ +
+ + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/form-submit.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/form-submit.html new file mode 100644 index 0000000000..eace0b0a69 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/form-submit.html @@ -0,0 +1,39 @@ + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/history-pushstate-during-load.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/history-pushstate-during-load.html new file mode 100644 index 0000000000..233d80d8d7 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/history-pushstate-during-load.html @@ -0,0 +1,28 @@ + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/history-pushstate-during-pageshow.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/history-pushstate-during-pageshow.html new file mode 100644 index 0000000000..a4e83baf1d --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/history-pushstate-during-pageshow.html @@ -0,0 +1,29 @@ + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/history-pushstate.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/history-pushstate.html new file mode 100644 index 0000000000..2faef7c319 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/history-pushstate.html @@ -0,0 +1,22 @@ + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/iframe-src-during-load.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/iframe-src-during-load.html new file mode 100644 index 0000000000..83f26b2aa9 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/iframe-src-during-load.html @@ -0,0 +1,31 @@ + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/iframe-src-during-pageshow.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/iframe-src-during-pageshow.html new file mode 100644 index 0000000000..61345cf7f9 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/iframe-src-during-pageshow.html @@ -0,0 +1,31 @@ + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/iframe-src.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/iframe-src.html new file mode 100644 index 0000000000..47407c106e --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/iframe-src.html @@ -0,0 +1,39 @@ + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/location-assign-during-load.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/location-assign-during-load.html new file mode 100644 index 0000000000..2b4ac49533 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/location-assign-during-load.html @@ -0,0 +1,31 @@ + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/location-assign-during-pageshow.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/location-assign-during-pageshow.html new file mode 100644 index 0000000000..0f84cbe246 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/location-assign-during-pageshow.html @@ -0,0 +1,31 @@ + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/location-assign-user-click.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/location-assign-user-click.html new file mode 100644 index 0000000000..785ec024e0 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/location-assign-user-click.html @@ -0,0 +1,34 @@ + + + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/location-assign.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/location-assign.html new file mode 100644 index 0000000000..53ea96ffea --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/location-assign.html @@ -0,0 +1,25 @@ + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/location-setter-during-load.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/location-setter-during-load.html new file mode 100644 index 0000000000..e4c8ca80a1 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/location-setter-during-load.html @@ -0,0 +1,76 @@ + + +Replace during the load event, triggered by location setters + + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/location-setter-during-pageshow.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/location-setter-during-pageshow.html new file mode 100644 index 0000000000..9997783ff5 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/location-setter-during-pageshow.html @@ -0,0 +1,77 @@ + + +Replace during the pageshow event, triggered by location setters + + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/location-setter-user-click.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/location-setter-user-click.html new file mode 100644 index 0000000000..9276327f1a --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/location-setter-user-click.html @@ -0,0 +1,82 @@ + + +No replace before load, triggered by location setters called as part of user-initiated clicks + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/location-setter-user-mouseup.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/location-setter-user-mouseup.html new file mode 100644 index 0000000000..9068e5a116 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/location-setter-user-mouseup.html @@ -0,0 +1,89 @@ + + +No replace before load, triggered by location setters called as part of user-initiated mouseups + + + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/location-setter.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/location-setter.html new file mode 100644 index 0000000000..b8049f084b --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/location-setter.html @@ -0,0 +1,58 @@ + + +Replace before load, triggered by location setters + + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/resources/code-injector.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/resources/code-injector.html new file mode 100644 index 0000000000..73dacf0d76 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/resources/code-injector.html @@ -0,0 +1,9 @@ + + +Subframe + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/resources/helpers.js b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/resources/helpers.js new file mode 100644 index 0000000000..58102aa925 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/resources/helpers.js @@ -0,0 +1,89 @@ +window.waitForLoad = (t, iframe, urlRelativeToThisDocument) => { + return new Promise(resolve => { + iframe.addEventListener("load", t.step_func(() => { + assert_equals(iframe.contentWindow.location.href, (new URL(urlRelativeToThisDocument, location.href)).href); + + // Wait a bit longer to ensure all history stuff has settled, e.g. the document is "completely loaded" + // (which happens from a queued task). + setTimeout(resolve, 0); + }), { once: true }); + }); +}; + +window.waitForLoadAllowingIntermediateLoads = (t, iframe, urlRelativeToThisDocument) => { + return new Promise(resolve => { + const handler = t.step_func(() => { + if (iframe.contentWindow.location.href === (new URL(urlRelativeToThisDocument, location.href)).href) { + // Wait a bit longer to ensure all history stuff has settled, e.g. the document is "completely loaded" + // (which happens from a queued task). + setTimeout(resolve, 0); + iframe.removeEventListener("load", handler); + } + }); + + iframe.addEventListener("load", handler); + }); +}; + +window.waitForMessage = () => { + return new Promise(resolve => { + window.addEventListener("message", e => { + resolve(e.data); + }, { once: true }); + }); +}; + +window.setupSentinelIframe = async (t) => { + // If this iframe gets navigated by history.back(), then the iframe under test did not, so we did a replace. + const sentinelIframe = document.createElement("iframe"); + sentinelIframe.src = "/common/blank.html?sentinelstart"; + document.body.append(sentinelIframe); + t.add_cleanup(() => sentinelIframe.remove()); + + await waitForLoad(t, sentinelIframe, "/common/blank.html?sentinelstart"); + + sentinelIframe.src = "/common/blank.html?sentinelend"; + await waitForLoad(t, sentinelIframe, "/common/blank.html?sentinelend"); + + return sentinelIframe; +}; + +window.checkSentinelIframe = async (t, sentinelIframe) => { + // Go back. Since iframe should have done a replace, this should move sentinelIframe back, not iframe. + history.back(); + await waitForLoad(t, sentinelIframe, "/common/blank.html?sentinelstart"); +}; + +window.insertIframe = (t, url, name) => { + const iframe = document.createElement("iframe"); + iframe.src = url; + + // In at least Chromium, window name targeting for form submission doesn't work if the name is set + // after the iframe is inserted into the DOM. So we can't just have callers do this themselves. + if (name) { + iframe.name = name; + } + + document.body.append(iframe); + + // Intentionally not including the following: + // t.add_cleanup(() => iframe.remove()); + // Doing so breaks some of the testdriver.js tests with "cannot find window" errors. + return iframe; +}; + +// TODO(domenic): clean up other tests in the parent directory to use this. +window.absoluteURL = relativeURL => { + return (new URL(relativeURL, location.href)).href; +}; + +// TODO(domenic): clean up other tests in the parent directory to use this. +window.codeInjectorURL = code => { + return absoluteURL("resources/code-injector.html?pipe=sub(none)&code=" + encodeURIComponent(code)); +}; + +window.changeURLHost = (url, newHost) => { + const urlObj = new URL(url); + urlObj.host = newHost; + return urlObj.href; +}; diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/resources/message-opener.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/resources/message-opener.html new file mode 100644 index 0000000000..b6f9d31358 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/resources/message-opener.html @@ -0,0 +1,8 @@ + + +Popup + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/resources/slow-code-injector.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/resources/slow-code-injector.html new file mode 100644 index 0000000000..b7e99dcbfa --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/resources/slow-code-injector.html @@ -0,0 +1,16 @@ + + +Subframe + + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/resources/slow-message-source-with-history-and-location.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/resources/slow-message-source-with-history-and-location.html new file mode 100644 index 0000000000..da279ebf82 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/resources/slow-message-source-with-history-and-location.html @@ -0,0 +1,16 @@ + + +Subframe or popup + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/window-open-popup-during-load.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/window-open-popup-during-load.html new file mode 100644 index 0000000000..5308c01c39 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/window-open-popup-during-load.html @@ -0,0 +1,67 @@ + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/window-open-popup-during-pageshow.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/window-open-popup-during-pageshow.html new file mode 100644 index 0000000000..065d933225 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/window-open-popup-during-pageshow.html @@ -0,0 +1,67 @@ + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/window-open-popup.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/window-open-popup.html new file mode 100644 index 0000000000..7b3e05f8f6 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/window-open-popup.html @@ -0,0 +1,49 @@ + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/window-open-self-during-load.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/window-open-self-during-load.html new file mode 100644 index 0000000000..255601ba8d --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/window-open-self-during-load.html @@ -0,0 +1,29 @@ + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/window-open-self-during-pageshow.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/window-open-self-during-pageshow.html new file mode 100644 index 0000000000..a8327cfac3 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/window-open-self-during-pageshow.html @@ -0,0 +1,29 @@ + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/window-open-self.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/window-open-self.html new file mode 100644 index 0000000000..10e8f38001 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/window-open-self.html @@ -0,0 +1,23 @@ + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/resources/blank.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/resources/blank.html new file mode 100644 index 0000000000..c50eddd41f --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/resources/blank.html @@ -0,0 +1 @@ + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/resources/child-navigates-parent-cross-origin-inner.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/resources/child-navigates-parent-cross-origin-inner.html new file mode 100644 index 0000000000..72b92c8061 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/resources/child-navigates-parent-cross-origin-inner.html @@ -0,0 +1,20 @@ + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/resources/child-navigates-parent-destination.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/resources/child-navigates-parent-destination.html new file mode 100644 index 0000000000..bb8ba4e698 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/resources/child-navigates-parent-destination.html @@ -0,0 +1,4 @@ + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/resources/child-navigates-parent-location-initial.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/resources/child-navigates-parent-location-initial.html new file mode 100644 index 0000000000..a4a1713a27 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/resources/child-navigates-parent-location-initial.html @@ -0,0 +1,3 @@ + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/resources/child-navigates-parent-location-inner.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/resources/child-navigates-parent-location-inner.html new file mode 100644 index 0000000000..4d7d24730f --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/resources/child-navigates-parent-location-inner.html @@ -0,0 +1,5 @@ + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/resources/child-navigates-parent-submit-initial.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/resources/child-navigates-parent-submit-initial.html new file mode 100644 index 0000000000..943708e0cd --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/resources/child-navigates-parent-submit-initial.html @@ -0,0 +1,3 @@ + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/resources/child-navigates-parent-submit-inner.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/resources/child-navigates-parent-submit-inner.html new file mode 100644 index 0000000000..0b49e13d65 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/resources/child-navigates-parent-submit-inner.html @@ -0,0 +1,6 @@ + +
+ diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/resources/click.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/resources/click.html new file mode 100644 index 0000000000..8cb03b74d5 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/resources/click.html @@ -0,0 +1,4 @@ + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/resources/document-domain-set-to-site.sub.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/resources/document-domain-set-to-site.sub.html new file mode 100644 index 0000000000..3c4355c452 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/resources/document-domain-set-to-site.sub.html @@ -0,0 +1,7 @@ + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/resources/form.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/resources/form.html new file mode 100644 index 0000000000..6523a82b39 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/resources/form.html @@ -0,0 +1,5 @@ + + +form navigation diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/resources/href.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/resources/href.html new file mode 100644 index 0000000000..eccadadf41 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/resources/href.html @@ -0,0 +1,5 @@ + + +href diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/resources/message-opener.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/resources/message-opener.html new file mode 100644 index 0000000000..b6f9d31358 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/resources/message-opener.html @@ -0,0 +1,8 @@ + + +Popup + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/resources/message-parent.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/resources/message-parent.html new file mode 100644 index 0000000000..3656358f2d --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/resources/message-parent.html @@ -0,0 +1,3 @@ + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/resources/multi-globals-subframe-1.sub.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/resources/multi-globals-subframe-1.sub.html new file mode 100644 index 0000000000..a87b2fd2be --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/resources/multi-globals-subframe-1.sub.html @@ -0,0 +1,10 @@ + + +Multi-globals test outer subframe + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/resources/multi-globals-subframe-2.sub.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/resources/multi-globals-subframe-2.sub.html new file mode 100644 index 0000000000..593c428a67 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/resources/multi-globals-subframe-2.sub.html @@ -0,0 +1,8 @@ + + +Multi-globals test inner subframe + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/resources/no-cache-single-redirect.py b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/resources/no-cache-single-redirect.py new file mode 100644 index 0000000000..9d3aff817d --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/resources/no-cache-single-redirect.py @@ -0,0 +1,21 @@ +# This handler receives requests identified by UUIDs that have mandatory +# `location` query parameters. Every other request for the same URL will result +# in a redirect to the URL described by `location`. When we don't redirect, we +# simply return the HTML document "No redirect". +def main(request, response): + response.headers.set(b"Cache-Control", b"no-store") + + uuid = request.GET.first(b"uuid") + value = request.server.stash.take(uuid) + + if value is None: + response.status = 302 + location = request.GET.first(b"location") + response.headers.set(b"Location", location) + # Ensure that the next time this uuid is request, we don't redirect. + request.server.stash.put(uuid, "sentinel value") + else: + # If we're in this branch, then `value` is not none, but the stash now + # has `None` associated with `uuid`, which means on the next request for + # this `uuid` we'll end up in the above branch instead. + return ([(b"Content-Type", b"text/html")], b"No redirect") diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/resources/page-that-post-message-to-opener.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/resources/page-that-post-message-to-opener.html new file mode 100644 index 0000000000..65a0c82149 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/resources/page-that-post-message-to-opener.html @@ -0,0 +1,6 @@ + + +Page that postMessage to its opener + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/resources/page-with-top-navigating-iframe.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/resources/page-with-top-navigating-iframe.html new file mode 100644 index 0000000000..568e44296f --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/resources/page-with-top-navigating-iframe.html @@ -0,0 +1,24 @@ + + + + + +Page that embeds an iframe that navigates its top + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/resources/portable-document-format-sample-valid.pdf b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/resources/portable-document-format-sample-valid.pdf new file mode 100644 index 0000000000..d008b1f23a Binary files /dev/null and b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/resources/portable-document-format-sample-valid.pdf differ diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/resources/portable-document-format-sample-valid.pdf.headers b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/resources/portable-document-format-sample-valid.pdf.headers new file mode 100644 index 0000000000..5a8e57e482 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/resources/portable-document-format-sample-valid.pdf.headers @@ -0,0 +1 @@ +Content-Type: application/pdf diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/resources/redirect.py b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/resources/redirect.py new file mode 100644 index 0000000000..3c78c256b0 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/resources/redirect.py @@ -0,0 +1,4 @@ +def main(request, response): + location = request.GET.first(b"location") + response.status = 302 + response.headers.set(b"Location", location) diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/resources/top-navigating-page.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/resources/top-navigating-page.html new file mode 100644 index 0000000000..557f408fba --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/resources/top-navigating-page.html @@ -0,0 +1,15 @@ + + +Page that navigates its top + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/resources/wait-for-messages.js b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/resources/wait-for-messages.js new file mode 100644 index 0000000000..62ddec49f1 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/resources/wait-for-messages.js @@ -0,0 +1,15 @@ +// Asynchronous function that waits for the given number of messages to be +// received by `window`, then returns those messages. +function waitForMessages(numMessages) { + return new Promise((resolve) => { + const messages = []; + + window.addEventListener("message", function handler(evt) { + messages.push(evt.data); + if (messages.length == numMessages) { + window.removeEventListener("message", handler); + resolve(messages); + } + }); + }); +} diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/resources/xhtml-and-non-utf-8.xhtml b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/resources/xhtml-and-non-utf-8.xhtml new file mode 100644 index 0000000000..3aacf33f1c --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/resources/xhtml-and-non-utf-8.xhtml @@ -0,0 +1,9 @@ + + + + + A test document used when you need something very non-default + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/source/navigate-child-function-parent-then-fragment.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/source/navigate-child-function-parent-then-fragment.html new file mode 100644 index 0000000000..d01ef4c77a --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/source/navigate-child-function-parent-then-fragment.html @@ -0,0 +1,36 @@ + + + + Set location from a parent, then do a fragment navigation from within the + frame. + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/source/navigate-child-function-parent.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/source/navigate-child-function-parent.html new file mode 100644 index 0000000000..2efc3a6b4a --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/source/navigate-child-function-parent.html @@ -0,0 +1,18 @@ + + +Set location from a parent + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/source/navigate-child-function-src.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/source/navigate-child-function-src.html new file mode 100644 index 0000000000..e21260cd35 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/source/navigate-child-function-src.html @@ -0,0 +1,18 @@ + + +Set src from a function called from a parent + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/source/navigate-child-function.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/source/navigate-child-function.html new file mode 100644 index 0000000000..c6fa765b89 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/source/navigate-child-function.html @@ -0,0 +1,19 @@ + + +Set location from a function called from a parent + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/source/navigate-child-src-about-blank.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/source/navigate-child-src-about-blank.html new file mode 100644 index 0000000000..479019d847 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/source/navigate-child-src-about-blank.html @@ -0,0 +1,20 @@ + + +Set the src attribute to about:blank and check referrer + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/source/support/dummy.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/source/support/dummy.html new file mode 100644 index 0000000000..0638657093 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/source/support/dummy.html @@ -0,0 +1,3 @@ + + +

Hello. \ No newline at end of file diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/source/support/location-set.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/source/support/location-set.html new file mode 100644 index 0000000000..ad733afac3 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/source/support/location-set.html @@ -0,0 +1,8 @@ + + + +

Hello. Go. \ No newline at end of file diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/source/support/set-parent-src.html b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/source/support/set-parent-src.html new file mode 100644 index 0000000000..9d45be8c8d --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/source/support/set-parent-src.html @@ -0,0 +1,8 @@ + + + +

Hello. Go. \ No newline at end of file diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/top-level-data-url.window.js b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/top-level-data-url.window.js new file mode 100644 index 0000000000..ca321f106a --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/top-level-data-url.window.js @@ -0,0 +1,20 @@ +// META: timeout=long + +const dataURL = `data:text/html,...`; +const encodedDataURL = encodeURIComponent(dataURL); + +[dataURL, `resources/redirect.py?location=${encodedDataURL}`].forEach(url => { + [undefined, "opener", "noopener", "noreferrer"].forEach(opener => { + async_test(t => { + const popup = window.open(url, "", opener); + t.step_timeout(() => { + if (opener === "noopener" || opener == "noreferrer") { + assert_equals(popup, null); + } else { + assert_true(popup.closed); + } + t.done(); + }, 1500); + }, `Navigating a popup using window.open("${url}", "", "${opener}")`); + }); +}); -- cgit v1.2.3