From 26a029d407be480d791972afb5975cf62c9360a6 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 02:47:55 +0200 Subject: Adding upstream version 124.0.1. Signed-off-by: Daniel Baumann --- .../browsing-the-web/back-forward-cache/README.md | 60 ++ .../eligibility/broadcast-channel.html | 23 + .../eligibility/dedicated-worker.html | 25 + .../eligibility/inflight-fetch-1.html | 18 + .../eligibility/inflight-fetch-2.html | 22 + .../eligibility/inflight-fetch-cors.html | 18 + .../eligibility/inflight-fetch-redirects.html | 34 + .../eligibility/shared-worker.html | 25 + .../back-forward-cache/events.html | 44 ++ .../browsing-the-web/back-forward-cache/focus.html | 73 +++ .../back-forward-cache/pushstate.https.html | 63 ++ .../back-forward-cache/resources/echo-worker.js | 16 + .../back-forward-cache/resources/event-recorder.js | 54 ++ .../resources/executor-pushstate.html | 13 + .../back-forward-cache/resources/executor.html | 5 + .../back-forward-cache/resources/executor.js | 64 ++ .../back-forward-cache/resources/helper.sub.js | 229 +++++++ .../resources/inflight-fetch-helper.js | 47 ++ .../back-forward-cache/resources/rc-helper.js | 137 ++++ .../back-forward-cache/resources/service-worker.js | 58 ++ .../back-forward-cache/resources/slow.py | 13 + .../back-forward-cache/resources/worker-helper.js | 28 + .../service-worker-client-postmessage.https.html | 71 ++ .../service-worker-clients-claim.https.html | 71 ++ .../service-worker-clients-matchall.https.html | 76 +++ ...vice-worker-controlled-after-restore.https.html | 54 ++ .../service-worker-unregister.https.html | 67 ++ .../back-forward-cache/storage-events.html | 101 +++ .../back-forward-cache/timers.html | 68 ++ .../browsing-the-web/history-traversal/001-1.html | 11 + .../browsing-the-web/history-traversal/001-2.html | 5 + .../browsing-the-web/history-traversal/001.html | 35 + .../history-traversal/PopStateEvent.html | 47 ++ .../history-traversal/api-availability.html | 22 + .../history-traversal/browsing_context_name-0.html | 35 + .../history-traversal/browsing_context_name-1.html | 6 + .../history-traversal/browsing_context_name-2.html | 4 + .../history-traversal/browsing_context_name-3.html | 6 + .../history-traversal/browsing_context_name-4.html | 6 + .../history-traversal/browsing_context_name.html | 13 + .../browsing_context_name_cross_origin-0.html | 34 + .../browsing_context_name_cross_origin.html | 13 + .../browsing_context_name_cross_origin_2.html | 43 ++ .../browsing_context_name_cross_origin_3.html | 44 ++ .../history-traversal/document-state.https.html | 133 ++++ .../event-order/after-load-hash-twice.html | 38 ++ .../event-order/after-load-hash.html | 32 + .../event-order/after-load-pushState.html | 31 + .../event-order/after-load-replaceState.html | 30 + .../event-order/before-load-hash-twice.html | 29 + .../event-order/before-load-hash.html | 27 + .../event-order/before-load-pushState.html | 28 + .../event-order/before-load-replaceState.html | 26 + .../event-order/pushState-inside-popstate.html | 16 + .../same-document-traverse-immediate.html | 38 ++ .../event-order/same-document-traverse-wait.html | 39 ++ .../browsing-the-web/history-traversal/events.html | 151 +++++ .../history-traversal/hashchange_event.html | 49 ++ ...versal-navigate-parent-while-child-loading.html | 30 + ...istory-traversal-navigates-multiple-frames.html | 29 + .../pagereveal/order-in-bfcache-restore.html | 70 ++ .../order-in-new-document-navigation.html | 18 + .../pagereveal/order-in-prerender-activation.html | 40 ++ .../order-in-prerender-activation-popup.html | 74 +++ .../resources/blank1.html | 8 + .../resources/blank2.html | 8 + .../resources/page-with-fragment.html | 20 + .../resources/post_name_on_load.html | 7 + .../resume-timer-on-history-back.html | 146 +++++ .../scroll-restoration-basic.html | 34 + ...estoration-fragment-scrolling-cross-origin.html | 71 ++ ...oll-restoration-fragment-scrolling-samedoc.html | 55 ++ ...scroll-restoration-navigation-cross-origin.html | 71 ++ .../scroll-restoration-navigation-samedoc.html | 81 +++ .../history-traversal/popstate_event.html | 48 ++ .../history-traversal/resources/a.html | 1 + .../resources/api-availability-1.html | 31 + .../resources/api-availability-2.html | 3 + .../history-traversal/resources/b.html | 1 + .../history-traversal/resources/c.html | 1 + .../resources/unset_context_name-1.sub.html | 45 ++ .../resources/unset_context_name_stash.py | 13 + .../history-traversal/same-url.html | 50 ++ .../scroll-restoration-order.html | 74 +++ .../srcdoc/consecutive-srcdoc.html | 85 +++ .../srcdoc/srcdoc-history-entries.html | 95 +++ ...oss-origin-main-frame-navigation-popup.sub.html | 10 + ...er-same-origin-main-frame-navigation-1.sub.html | 4 + .../support/window-name-navigation.sub.html | 11 + .../support/window-name-test.sub.html | 23 + .../history-traversal/unset_context_name.html | 32 + ...fter-cross-origin-aux-frame-navigation.sub.html | 17 + ...ter-cross-origin-main-frame-navigation.sub.html | 24 + ...fter-cross-origin-sub-frame-navigation.sub.html | 18 + ...after-same-origin-aux-frame-navigation.sub.html | 17 + ...me-after-same-origin-main-frame-navigation.html | 12 + ...after-same-origin-sub-frame-navigation.sub.html | 18 + .../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 | 52 ++ .../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 + .../README.md | 11 + .../anchor-fragment-history-back-on-click.html | 40 ++ .../cross-document-nav-cross-document-nav.html | 30 + ...ross-document-nav-cross-document-traversal.html | 38 ++ .../cross-document-nav-same-document-nav.html | 44 ++ ...cross-document-nav-same-document-traversal.html | 37 ++ .../cross-document-nav-stop.html | 21 + ...ross-document-traversal-cross-document-nav.html | 77 +++ ...ocument-traversal-cross-document-traversal.html | 160 +++++ ...cross-document-traversal-same-document-nav.html | 66 ++ ...document-traversal-same-document-traversal.html | 94 +++ .../cross-document-traversal-stop.html | 42 ++ .../forward-to-pruned-entry.html | 24 + .../nav-cancelation-1.html | 62 ++ .../nav-cancelation-2.sub.html | 178 +++++ .../resources/helpers.mjs | 52 ++ .../resources/nav-cancelation-2-helper.html | 18 + .../resources/slow.py | 7 + .../same-document-nav-cross-document-nav.html | 41 ++ ...same-document-nav-cross-document-traversal.html | 70 ++ .../same-document-nav-same-document-nav.html | 61 ++ .../same-document-nav-same-document-traversal.html | 55 ++ .../same-document-nav-stop.html | 28 + ...same-document-traversal-cross-document-nav.html | 42 ++ ...ocument-traversal-cross-document-traversal.html | 88 +++ .../same-document-traversal-same-document-nav.html | 57 ++ ...aversal-same-document-traversal-hashchange.html | 148 +++++ ...raversal-same-document-traversal-pushstate.html | 137 ++++ .../same-document-traversal-stop.html | 37 ++ .../read-media/cross-origin-video.html | 36 ++ .../read-media/pageload-image-in-popup.html | 31 + .../read-media/pageload-image.html | 31 + .../read-media/pageload-video.html | 28 + .../read-media/resources/iframe-document.sub.html | 5 + .../read-text/load-text-plain.html | 40 ++ .../remote-context-helper-tests/addHTML.window.js | 20 + .../addIframe-srcdoc-startOn.window.js | 24 + .../addIframe-srcdoc.window.js | 27 + .../addIframe.window.js | 40 ++ .../addScripts.window.js | 19 + .../addWindow-defaults.window.js | 15 + .../addWindow-extra-config.window.js | 36 ++ .../addWindow-features.window.js | 23 + .../addWindow-invalid-origin.window.js | 21 + .../addWindow-startOn.window.js | 19 + .../addWindow-target.window.js | 17 + .../addWorker.window.js | 29 + .../constructor.window.js | 38 ++ .../createContext-bad-executorCreator.window.js | 20 + .../getRequestHeaders.window.js | 18 + .../navigateToNew.window.js | 37 ++ .../navigation-bfcache.window.js | 35 + .../navigation-helpers.window.js | 28 + .../navigation-same-document.window.js | 39 ++ .../resources/test-helper.js | 48 ++ .../resources/test-script.js | 3 + .../resources/test-script2.js | 3 + .../resources/executor-common.js | 14 + .../resources/executor-window.js | 67 ++ .../resources/executor-window.py | 40 ++ .../resources/executor-worker.js | 12 + .../resources/remote-context-helper.js | 592 +++++++++++++++++ .../browsing-the-web/resources/has-iframe.html | 7 + .../browsers/browsing-the-web/resources/helpers.js | 84 +++ .../resources/post-top-opener-on-load.html | 6 + .../browsing-the-web/scroll-to-fragid/001.html | 16 + .../browsing-the-web/scroll-to-fragid/002.html | 21 + .../browsing-the-web/scroll-to-fragid/003.html | 25 + .../browsing-the-web/scroll-to-fragid/004.html | 23 + .../browsing-the-web/scroll-to-fragid/005.html | 23 + .../browsing-the-web/scroll-to-fragid/006.html | 34 + .../browsing-the-web/scroll-to-fragid/007.html | 37 ++ .../forward-triggers-hashchange.html | 44 ++ .../scroll-to-fragid/fragment-and-encoding-2.html | 41 ++ .../scroll-to-fragid/fragment-and-encoding.html | 50 ++ .../scroll-to-fragid/navigate-helpers.js | 23 + .../scroll-to-fragid/replacement-enabled.html | 69 ++ .../scroll-frag-non-utf8-encoded-document.html | 21 + .../scroll-frag-percent-encoded.html | 62 ++ .../scroll-position-vertical-lr.html | 25 + .../scroll-position-vertical-rl.html | 25 + .../scroll-to-fragid/scroll-position.html | 25 + .../scroll-to-fragid/scroll-to-anchor-name.html | 59 ++ .../scroll-to-fragid/scroll-to-id-top.html | 51 ++ .../scroll-to-fragid/scroll-to-top.html | 56 ++ .../browsing-the-web/unloading-documents/001.html | 15 + .../browsing-the-web/unloading-documents/002.html | 15 + .../browsing-the-web/unloading-documents/003.html | 15 + .../browsing-the-web/unloading-documents/004.html | 15 + .../browsing-the-web/unloading-documents/005.html | 15 + .../browsing-the-web/unloading-documents/base.html | 14 + .../beforeunload-canceling-1.html | 35 + .../beforeunload-canceling.html | 222 +++++++ .../beforeunload-on-history-back-1.html | 5 + .../beforeunload-on-history-back.html | 31 + .../beforeunload-on-navigation-of-parent-1.html | 2 + .../beforeunload-on-navigation-of-parent-2.html | 4 + .../beforeunload-on-navigation-of-parent.html | 31 + .../beforeunload-sticky-activation-iframe.html | 25 + .../beforeunload-sticky-activation-manual.html | 17 + .../beforeunload-sticky-activation-popup.html | 24 + .../beforeunload-synchronous.html | 33 + .../navigation-within-beforeunload-1.html | 10 + .../navigation-within-beforeunload-2.html | 4 + .../navigation-within-beforeunload.html | 29 + .../pagehide-on-history-forward-1.html | 2 + .../pagehide-on-history-forward.html | 19 + .../prompt-and-unload-script-closeable.html | 23 + .../prompt-and-unload-script-uncloseable-1.html | 10 + .../prompt-and-unload-script-uncloseable.html | 24 + .../unloading-documents/prompt/001-1.html | 10 + .../unloading-documents/prompt/001-2.html | 1 + .../unloading-documents/prompt/001.html | 14 + .../unloading-documents/prompt/002-1.html | 7 + .../unloading-documents/prompt/002.html | 20 + .../unloading-documents/prompt/003.html | 20 + .../unloading-documents/prompt/004-1.html | 28 + .../unloading-documents/prompt/004-2.html | 5 + .../unloading-documents/prompt/004.html | 29 + .../unloading-documents/prompt/manual-001.html | 9 + .../unloading-documents/prompt/manual-002.html | 9 + .../unloading-documents/prompt/manual-003.html | 11 + .../unloading-documents/prompt/manual-004.html | 11 + .../unloading-documents/prompt/manual-005.html | 22 + .../unloading-documents/prompt/manual-006.html | 9 + .../unloading-documents/prompt/next.html | 2 + .../unloading-documents/support/001-1.html | 23 + .../unloading-documents/support/001a.html | 7 + .../unloading-documents/support/001b.html | 5 + .../unloading-documents/support/002-1.html | 32 + .../unloading-documents/support/002a.html | 7 + .../unloading-documents/support/002b.html | 5 + .../unloading-documents/support/003-1.html | 23 + .../unloading-documents/support/003a.html | 8 + .../unloading-documents/support/003b.html | 5 + .../unloading-documents/support/004-1.html | 25 + .../unloading-documents/support/004a.html | 8 + .../unloading-documents/support/004b.html | 18 + .../unloading-documents/support/005-1.html | 13 + .../unloading-documents/support/005a.html | 8 + .../unloading-documents/support/005b.html | 17 + .../support/beforeunload-sticky-destination.html | 13 + .../support/beforeunload-sticky-start.html | 10 + .../unloading-documents/unload/001-1.html | 4 + .../unloading-documents/unload/001-2.html | 2 + .../unloading-documents/unload/001.html | 25 + .../unloading-documents/unload/002-1.html | 4 + .../unloading-documents/unload/002.html | 36 ++ .../unloading-documents/unload/003-1.html | 4 + .../unloading-documents/unload/003.html | 33 + .../unloading-documents/unload/004-1.html | 5 + .../unloading-documents/unload/004.html | 28 + .../unloading-documents/unload/006-1.html | 23 + .../unloading-documents/unload/006-2.html | 5 + .../unloading-documents/unload/006.html | 18 + .../unloading-documents/unload/007-1.html | 21 + .../unloading-documents/unload/007-2.html | 5 + .../unloading-documents/unload/007.html | 28 + .../unloading-documents/unload/008-1.html | 4 + .../unloading-documents/unload/008.html | 16 + .../unloading-documents/unload/009-1.html | 4 + .../unloading-documents/unload/009.html | 16 + .../unload/pagehide-manual-1.html | 2 + .../unload/pagehide-manual.html | 5 + .../unload-main-frame-cross-origin.window.js | 34 + .../unload/unload-main-frame-same-origin.window.js | 33 + .../joint-session-history-child1.html | 18 + .../joint-session-history-child2.html | 5 + .../joint-session-history-filler.html | 1 + .../joint-session-history-grandchild1.html | 8 + .../joint-session-history-grandchild2.html | 5 + .../joint-session-history-iframe-state.html | 41 ++ .../joint-session-history-only-fully-active.html | 30 + .../joint-session-history-remove-iframe.html | 24 + .../history/the-history-interface/001.html | 339 ++++++++++ .../history/the-history-interface/002.html | 318 +++++++++ .../history/the-history-interface/004.html | 62 ++ .../history/the-history-interface/005.html | 47 ++ .../history/the-history-interface/006.html | 53 ++ .../history/the-history-interface/007.html | 66 ++ .../history/the-history-interface/008.html | 40 ++ .../browsers/history/the-history-interface/008.js | 11 + .../history/the-history-interface/009-1.html | 20 + .../history/the-history-interface/009-3.html | 28 + .../history/the-history-interface/009-5.html | 23 + .../history/the-history-interface/009.html | 22 + .../history/the-history-interface/010-1.html | 16 + .../history/the-history-interface/010-3.html | 24 + .../history/the-history-interface/010-5.html | 23 + .../history/the-history-interface/010.html | 22 + .../history/the-history-interface/011.html | 32 + .../history/the-history-interface/012.html | 32 + .../history/the-history-interface/blank-new.html | 5 + .../history/the-history-interface/blank-old.html | 5 + .../history/the-history-interface/blank.html | 8 + .../history/the-history-interface/blank2.html | 13 + .../history/the-history-interface/blank3.html | 11 + .../combination_history_001.html | 20 + .../combination_history_002.html | 22 + .../combination_history_003.html | 26 + .../combination_history_004.html | 29 + .../combination_history_005.html | 34 + .../combination_history_006.html | 30 + .../combination_history_007.html | 32 + .../history-associated-with-document.window.js | 6 + .../history-state-after-bfcache.window.js | 43 ++ .../history/the-history-interface/history.js | 35 + .../the-history-interface/history_back-1.html | 15 + .../the-history-interface/history_back.html | 27 + .../the-history-interface/history_back_1.html | 26 + .../history_back_cross_realm_method.html | 22 + .../the-history-interface/history_entry.html | 11 + .../the-history-interface/history_forward-1.html | 14 + .../the-history-interface/history_forward-2.html | 15 + .../the-history-interface/history_forward.html | 32 + .../the-history-interface/history_forward_1.html | 26 + .../history_forward_cross_realm_method.html | 28 + .../history_go_cross_realm_method.html | 23 + .../the-history-interface/history_go_minus.html | 27 + .../history_go_no_argument-1.html | 17 + .../history_go_no_argument.html | 27 + .../the-history-interface/history_go_plus.html | 33 + .../the-history-interface/history_go_to_uri-1.html | 22 + .../the-history-interface/history_go_to_uri.html | 30 + .../history_go_undefined-1.html | 14 + .../history_go_undefined.html | 26 + .../the-history-interface/history_go_zero-1.html | 17 + .../the-history-interface/history_go_zero.html | 27 + .../history_go_zero_which_document.window.js | 27 + .../history_properties_only_fully_active.html | 23 + .../the-history-interface/history_pushstate.html | 19 + .../history_pushstate_err.html | 18 + .../history_pushstate_nooptionalparam.html | 20 + .../history_pushstate_url.html | 24 + .../history_pushstate_url_rewriting.html | 176 +++++ .../history_replacestate.html | 20 + .../history_replacestate_err.html | 18 + .../history_replacestate_nooptionalparam.html | 20 + .../the-history-interface/history_state.html | 24 + .../the-history-interface/iframe_history_go_0.html | 40 ++ .../joint_session_history/001-1.html | 72 +++ .../joint_session_history/001.html | 18 + .../joint_session_history/002-1.html | 35 + .../joint_session_history/002.html | 18 + .../joint_session_history/filler.html | 5 + .../the-history-interface/non-automated/history.js | 35 + .../non-automated/history_entry.html | 12 + .../traverse_the_history_unload_prompt_1-1.html | 18 + ...raverse_the_history_unload_prompt_1-manual.html | 31 + .../traverse_the_history_unload_prompt_2-1.html | 18 + ...raverse_the_history_unload_prompt_2-manual.html | 31 + ...erse_the_session_history_unload_prompt_1-1.html | 17 + ...the_session_history_unload_prompt_1-manual.html | 30 + .../pushstate-base.html | 18 + .../pushstate-whitespace.html | 20 + .../pushstate.html | 17 + .../replacestate-base.html | 18 + .../replacestate-whitespace.html | 20 + .../replacestate.html | 17 + .../resources/message-opener.sub.html | 8 + .../resources/traverse-during-beforeunload.html | 12 + .../resources/traverse-during-unload.html | 12 + .../resources/url-rewriting-helper.html | 12 + .../traverse-during-beforeunload.html | 28 + .../traverse-during-unload.html | 28 + .../traverse_the_history_1-1.html | 16 + .../traverse_the_history_1.html | 25 + .../traverse_the_history_2-1.html | 15 + .../traverse_the_history_2.html | 26 + .../traverse_the_history_3-1.html | 15 + .../traverse_the_history_3.html | 26 + .../traverse_the_history_4-1.html | 15 + .../traverse_the_history_4.html | 26 + .../traverse_the_history_5-1.html | 15 + .../traverse_the_history_5.html | 26 + .../traverse_the_history_unload_1-1.html | 15 + .../traverse_the_history_unload_1.html | 28 + .../traverse_the_history_write_after_load_1-1.html | 12 + .../traverse_the_history_write_after_load_1.html | 29 + .../traverse_the_history_write_after_load_2-1.html | 9 + .../traverse_the_history_write_after_load_2.html | 24 + .../traverse_the_history_write_onload_1-1.html | 9 + .../traverse_the_history_write_onload_1.html | 27 + .../traverse_the_history_write_onload_2-1.html | 9 + .../traverse_the_history_write_onload_2.html | 27 + ...allow_prototype_cycle_through_location.sub.html | 197 ++++++ .../assign_after_load-1.html | 9 + .../assign_after_load-2.html | 7 + .../the-location-interface/assign_after_load.html | 23 + .../assign_before_load-1.html | 7 + .../assign_before_load-2.html | 7 + .../the-location-interface/assign_before_load.html | 23 + .../cross_origin_joined_frame.sub.html | 15 + .../the-location-interface/document_location.html | 39 ++ ...location-non-configurable-toString-valueOf.html | 42 ++ .../location-origin-idna.sub.window.js | 11 + .../location-pathname-setter-question-mark.html | 16 + .../location-prevent-extensions.html | 21 + .../location-protocol-setter-non-broken-weird.html | 35 + .../location-protocol-setter-non-broken.html | 63 ++ .../location-protocol-setter-sameish.html | 26 + .../location-protocol-setter-with-colon.sub.html | 52 ++ .../location-protocol-setter.html | 104 +++ .../location-prototype-no-toString-valueOf.html | 55 ++ ...-prototype-setting-cross-origin-domain.sub.html | 31 + ...ocation-prototype-setting-cross-origin.sub.html | 28 + ...otype-setting-goes-cross-origin-domain.sub.html | 39 ++ ...n-prototype-setting-same-origin-domain.sub.html | 30 + .../location-prototype-setting-same-origin.html | 21 + .../location-stringifier.html | 24 + .../location-symbol-toprimitive.html | 14 + .../the-location-interface/location-tojson.html | 13 + .../the-location-interface/location-valueof.html | 15 + .../the-location-interface/location_assign.html | 26 + .../location_assign_about_blank-1.html | 2 + .../location_assign_about_blank.html | 24 + .../the-location-interface/location_hash.html | 62 ++ .../the-location-interface/location_host.html | 28 + .../the-location-interface/location_hostname.html | 33 + .../the-location-interface/location_href.html | 19 + .../the-location-interface/location_origin.html | 14 + .../the-location-interface/location_pathname.html | 22 + .../the-location-interface/location_port.html | 31 + .../the-location-interface/location_protocol.html | 25 + .../location_reload-iframe.html | 4 + .../the-location-interface/location_reload.html | 43 ++ .../location_reload_javascript_url.html | 60 ++ .../the-location-interface/location_replace.html | 26 + .../the-location-interface/location_search.html | 20 + .../no-browsing-context.window.js | 86 +++ .../manual_click_assign_during_load-1.html | 7 + .../manual_click_assign_during_load-2.html | 7 + .../manual_click_assign_during_load-manual.html | 17 + ...anual_click_location_replace_during_load-1.html | 10 + ...anual_click_location_replace_during_load-2.html | 7 + ..._click_location_replace_during_load-manual.html | 17 + .../manual_click_replace_during_load-manual.html | 17 + .../manual_form_submit_assign_during_load-1.html | 9 + .../manual_form_submit_assign_during_load-2.html | 7 + ...nual_form_submit_assign_during_load-manual.html | 17 + .../non-automated/reload_in_resize-1.html | 15 + .../non-automated/reload_in_resize-manual.html | 26 + .../the-location-interface/per-global.window.js | 3 + .../reload_document_open_write-1.html | 19 + .../reload_document_open_write.html | 26 + .../reload_document_write-1.html | 4 + .../reload_document_write.html | 21 + .../reload_document_write_onload-1.html | 9 + .../reload_document_write_onload.html | 26 + .../reload_post_1-manual.html | 27 + .../resources/post-your-origin.html | 3 + .../resources/post-your-protocol.html | 4 + .../resources/reload_post_1-1.py | 13 + .../history/the-location-interface/same-hash.html | 101 +++ .../the-location-interface/same_origin_frame.html | 12 + .../scripted_click_assign_during_load-1.html | 10 + .../scripted_click_assign_during_load-2.html | 7 + .../scripted_click_assign_during_load.html | 17 + ...ripted_click_location_assign_during_load-1.html | 13 + ...ripted_click_location_assign_during_load-2.html | 7 + ...scripted_click_location_assign_during_load.html | 16 + .../scripted_form_submit_assign_during_load-1.html | 12 + .../scripted_form_submit_assign_during_load-2.html | 7 + .../scripted_form_submit_assign_during_load.html | 17 + .../the-location-interface/security_location_0.htm | 27 + .../navigation-in-onload.html | 37 ++ .../navigation-in-onload_form-submission-1.html | 15 + .../navigation-in-onload_form-submission-2.html | 22 + ...n-in-onload_form-submission-dynamic-iframe.html | 16 + ...avigation-in-onload_form-submission-iframe.html | 10 + .../api_status_checking-manual.html | 23 + .../api_status_downloading-manual.html | 24 + .../api_status_obsolete-manual.html | 24 + .../api_status_updateready-manual.html | 25 + .../api_swapcache-manual.html | 30 + .../navigator_online_event-manual.https.html | 46 ++ .../navigator_online_online.https.html | 17 + .../changestonetworkingmodel/original-id.json | 1 + .../introduction-4/event_downloading-manual.html | 23 + .../offline/introduction-4/event_error-manual.html | 23 + .../introduction-4/event_obsolete-manual.html | 23 + .../introduction-4/event_updateready-manual.html | 22 + .../event_updateready_swapcache-manual.html | 30 + .../offline/manifest_main_empty-manual.https.html | 14 + .../manifest_notchanged_online-manual.https.html | 19 + .../manifest_section_empty-manual.https.html | 19 + .../manifest_section_many-manual.https.html | 19 + .../html/browsers/offline/resources/css/clock.css | 1 + .../browsers/offline/resources/css/offline.css | 5 + .../html/browsers/offline/resources/css/online.css | 5 + .../html/browsers/offline/resources/css/result.css | 11 + .../browsers/offline/resources/html/clock.html | 12 + .../html/browsers/offline/resources/js/clock.js | 3 + .../offline/resources/manifest/clock.manifest | 17 + .../resources/manifest/section_empty.manifest | 10 + .../resources/manifest/section_many.manifest | 19 + .../offline/resources/manifest/url_check.manifest | 17 + .../section_network_offline-manual.https.html | 17 + .../section_network_online-manual.https.html | 16 + .../cross-origin-due-to-document-domain-only.html | 33 + .../cross-origin-objects-function-caching.html | 49 ++ .../cross-origin-objects-function-common.js | 34 + .../cross-origin-objects-function-length.html | 45 ++ .../cross-origin-objects-function-name.html | 45 ++ .../cross-origin-objects-on-new-window.html | 25 + .../cross-origin-objects/cross-origin-objects.html | 718 +++++++++++++++++++++ .../cross-origin-objects/frame-with-then.html | 19 + .../origin/cross-origin-objects/frame.html | 51 ++ .../location-properties-smoke-test.window.js | 51 ++ ...-origin-due-to-document-domain-only-helper.html | 9 + .../win-documentdomain.sub.html | 63 ++ ...location-and-location-href-cross-realm-set.html | 106 +++ .../origin/inheritance/about-blank-iframe.html | 28 + .../origin/inheritance/about-blank-window.html | 25 + .../browsers/origin/inheritance/about-srcdoc.html | 29 + .../inheritance/document-write.https.window.js | 10 + .../document-write.https.window.js.headers | 1 + .../origin/inheritance/javascript-url.html | 33 + .../inheritance/resources/document-write.html | 40 ++ .../resources/document-write.html.headers | 1 + .../resources/iframe-with-about-blank-iframe.html | 7 + .../iframe-with-about-blank-iframe.html.headers | 1 + .../parent-no-child-bad-subdomain.sub.https.html | 27 + .../parent-no-child-yes-port.sub.https.html | 27 + .../parent-no-child-yes-same.sub.https.html | 27 + ...hild-yes-subdomain-with-redirect.sub.https.html | 27 + .../parent-no-child-yes-subdomain.sub.https.html | 27 + ...no-child-yeswithparams-subdomain.sub.https.html | 27 + .../parent-yes-child-no-port.sub.https.html | 27 + ...parent-yes-child-no-port.sub.https.html.headers | 1 + .../parent-yes-child-no-same.sub.https.html | 26 + ...parent-yes-child-no-same.sub.https.html.headers | 1 + .../parent-yes-child-no-subdomain.sub.https.html | 27 + ...t-yes-child-no-subdomain.sub.https.html.headers | 1 + .../parent-yes-child-yes-port.sub.https.html | 27 + ...arent-yes-child-yes-port.sub.https.html.headers | 1 + .../parent-yes-child-yes-same.sub.https.html | 26 + ...arent-yes-child-yes-same.sub.https.html.headers | 1 + .../parent-yes-child-yes-subdomain.sub.https.html | 27 + ...-yes-child-yes-subdomain.sub.https.html.headers | 1 + ...o-subdomain-child2-yes-subdomain.sub.https.html | 36 ++ ...bdomain-child2-yes-subdomainport.sub.https.html | 37 ++ ...subdomain1-child2-yes-subdomain2.sub.https.html | 37 ++ ...ld1-yes-subdomain-child2-no-port.sub.https.html | 37 ++ ...es-subdomain-child2-no-subdomain.sub.https.html | 38 ++ ...no-subdomain-child2-no-subdomain.sub.https.html | 38 ++ ...main-child2-no-subdomain.sub.https.html.headers | 1 + ...o-subdomain-child2-no-subdomain2.sub.https.html | 38 ++ ...ain-child2-no-subdomain2.sub.https.html.headers | 1 + ...o-subdomain-child2-yes-subdomain.sub.https.html | 38 ++ ...ain-child2-yes-subdomain.sub.https.html.headers | 1 + ...-subdomain-child2-yes-subdomain2.sub.https.html | 38 ++ ...in-child2-yes-subdomain2.sub.https.html.headers | 1 + ...bdomain-child2-yes-subdomainport.sub.https.html | 38 ++ ...child2-yes-subdomainport.sub.https.html.headers | 1 + ...ld1-yes-subdomain-child2-no-port.sub.https.html | 36 ++ ...subdomain-child2-no-port.sub.https.html.headers | 1 + ...es-subdomain-child2-no-subdomain.sub.https.html | 38 ++ ...main-child2-no-subdomain.sub.https.html.headers | 1 + ...s-subdomain-child2-yes-subdomain.sub.https.html | 39 ++ ...ain-child2-yes-subdomain.sub.https.html.headers | 1 + ...-subdomain-child2-yes-subdomain2.sub.https.html | 38 ++ ...in-child2-yes-subdomain2.sub.https.html.headers | 1 + ...bdomain-child2-yes-subdomainport.sub.https.html | 38 ++ ...child2-yes-subdomainport.sub.https.html.headers | 1 + .../origin/origin-keyed-agent-clusters/META.yml | 5 + .../origin/origin-keyed-agent-clusters/README.md | 30 + .../about-blank.https.sub.html | 63 ++ .../about-blank.https.sub.html.headers | 1 + .../document-domain.sub.https.html | 52 ++ .../document-domain.sub.https.html.headers | 1 + .../cross-origin-isolated.sub.https.html | 28 + .../cross-origin-isolated.sub.https.html.headers | 2 + .../getter-special-cases/csp-sandbox-no.https.html | 15 + .../csp-sandbox-no.https.html.headers | 1 + .../csp-sandbox-yes.https.html | 15 + .../csp-sandbox-yes.https.html.headers | 2 + .../data-to-javascript-no.https.html | 12 + .../data-to-javascript-yes.https.html | 12 + .../data-to-javascript-yes.https.html.headers | 1 + .../getter-special-cases/data-url-no.https.html | 12 + .../getter-special-cases/data-url-yes.https.html | 12 + .../data-url-yes.https.html.headers | 1 + .../javascript-url-no.https.html | 12 + .../javascript-url-yes.https.html | 12 + .../javascript-url-yes.https.html.headers | 1 + .../removed-iframe.sub.https.html | 27 + .../removed-iframe.sub.https.html.headers | 1 + .../resources/data-to-javascript-test.mjs | 33 + .../resources/data-url-test.mjs | 13 + .../getter-special-cases/resources/helpers.mjs | 28 + .../resources/javascript-url-test.mjs | 14 + .../resources/sandboxed-iframe-test.sub.mjs | 20 + .../sandboxed-same-origin-iframe-test.sub.mjs | 20 + .../sandboxed-iframe-no.https.html | 12 + .../sandboxed-iframe-yes.https.html | 12 + .../sandboxed-iframe-yes.https.html.headers | 1 + .../sandboxed-same-origin-iframe-no.https.html | 12 + .../sandboxed-same-origin-iframe-yes.https.html | 12 + ...boxed-same-origin-iframe-yes.https.html.headers | 1 + .../going-back.sub.https.html | 62 ++ .../going-back.sub.https.html.headers | 1 + .../parent-no-1-no-same-2-yes-port.sub.https.html | 41 ++ ...ent-no-1-no-same-2-yes-subdomain.sub.https.html | 41 ++ ...o-1-no-subdomain-2-yes-subdomain.sub.https.html | 40 ++ ...-1-no-subdomain-2-yes-subdomain2.sub.https.html | 41 ++ ...-1-subdomain-yes-2-subdomain2-no.sub.https.html | 43 ++ ...o-1-yes-subdomain-2-no-subdomain.sub.https.html | 41 ++ .../parent-yes-1-no-same-2-no-port.sub.https.html | 41 ++ ...-yes-1-no-same-2-no-port.sub.https.html.headers | 1 + ...ent-yes-1-no-same-2-no-subdomain.sub.https.html | 41 ++ ...1-no-same-2-no-subdomain.sub.https.html.headers | 1 + .../insecure-http.sub.html | 26 + .../insecure-http.sub.html.headers | 1 + .../popups-crash.https.html | 9 + .../opener-no-openee-yes-port.sub.https.html | 28 + .../opener-no-openee-yes-same.sub.https.html | 27 + .../opener-no-openee-yes-subdomain.sub.https.html | 28 + .../opener-yes-openee-no-port.sub.https.html | 28 + ...pener-yes-openee-no-port.sub.https.html.headers | 1 + .../opener-yes-openee-no-same.sub.https.html | 27 + ...pener-yes-openee-no-same.sub.https.html.headers | 1 + .../opener-yes-openee-no-subdomain.sub.https.html | 28 + ...-yes-openee-no-subdomain.sub.https.html.headers | 1 + .../opener-yes-openee-yes-port.sub.https.html | 28 + ...ener-yes-openee-yes-port.sub.https.html.headers | 1 + .../opener-yes-openee-yes-same.sub.https.html | 27 + ...ener-yes-openee-yes-same.sub.https.html.headers | 1 + .../opener-yes-openee-yes-subdomain.sub.https.html | 28 + ...yes-openee-yes-subdomain.sub.https.html.headers | 1 + .../regression-1399759.https.sub.html | 100 +++ .../removing-iframes.sub.https.html | 46 ++ .../removing-iframes.sub.https.html.headers | 1 + .../resources/README.md | 6 + .../resources/coep-frame.html | 5 + .../resources/coep-frame.html.headers | 2 + .../resources/crashy-popup.sub.html | 6 + .../resources/crashy-popup.sub.html.headers | 1 + .../resources/frame.html | 12 + .../resources/frame.html.headers | 1 + .../resources/helpers.mjs | 390 +++++++++++ .../resources/helpers.mjs.headers | 1 + .../resources/send-header-page-script.mjs | 63 ++ .../resources/send-header-page-script.mjs.headers | 1 + .../resources/send-oac-header.py | 43 ++ .../browsers/origin/origin-of-data-document.html | 30 + .../document_domain.html | 35 + .../document_domain_access_details.sub.html | 305 +++++++++ .../document_domain_setter.html | 76 +++ .../document_domain_setter_srcdoc.html | 84 +++ .../sandboxed-document_domain.html | 21 + .../sandboxed-document_domain.html.headers | 1 + .../support/document_domain_frame.html | 52 ++ .../support/document_domain_frame.sub.js | 65 ++ .../support/document_domain_setter_iframe.html | 12 + .../html/browsers/sandboxing/inner-iframe.html | 13 + .../html/browsers/sandboxing/noscript-iframe.html | 3 + ...from-initial-empty-sandboxed-document.window.js | 46 ++ .../sandboxing/resources/check-sandbox-flags.html | 8 + .../sandboxing/resources/document-open.html | 14 + .../sandboxing/resources/execute-postmessage.html | 5 + .../sandboxing/resources/post-done-to-opener.html | 3 + ...x-inherited-from-initiator-response-helper.html | 15 + ...ted-from-initiator-response-helper.html.headers | 1 + .../resources/sandbox-javascript-window-open.html | 18 + .../sandboxing/sandbox-allow-same-origin.html | 30 + .../browsers/sandboxing/sandbox-allow-scripts.html | 29 + .../sandboxing/sandbox-disallow-popups.html | 39 ++ .../sandboxing/sandbox-disallow-same-origin.html | 35 + ...ow-scripts-via-unsandboxed-popup.tentative.html | 33 + .../sandboxing/sandbox-disallow-scripts.html | 29 + .../sandbox-document-open-mutation.window.js | 37 ++ .../browsers/sandboxing/sandbox-document-open.html | 50 ++ .../sandbox-inherited-from-initiator-frame.html | 64 ++ .../sandbox-inherited-from-initiator-response.html | 46 ++ .../sandbox-inherited-from-required-csp.html | 154 +++++ ...-initial-empty-document-toward-same-origin.html | 30 + .../sandboxing/sandbox-javascript-window-open.html | 19 + ...sandbox-navigation-timing-iframe.tentative.html | 16 + .../sandbox-navigation-timing.tentative.html | 29 + .../sandbox-new-execution-context-iframe.html | 5 + .../sandboxing/sandbox-new-execution-context.html | 39 ++ .../sandboxing/sandbox-parse-noscript-ref.html | 6 + .../sandboxing/sandbox-parse-noscript.html | 7 + .../sandboxing/sandbox-window-open-srcdoc.html | 52 ++ ...window-open-blank-from-different-initiator.html | 90 +++ .../browsers/the-window-object/BarProp.window.js | 59 ++ .../the-window-object/Document-defaultView.html | 38 ++ .../the-window-object/Window-document.html | 25 + .../indexed-browsing-contexts-01.html | 47 ++ .../indexed-browsing-contexts-02.html | 62 ++ .../indexed-browsing-contexts-03.html | 30 + .../iterator.html | 11 + .../accessing-other-browsing-contexts/test1.html | 12 + .../accessing-other-browsing-contexts/test2.html | 6 + .../accessing-other-browsing-contexts/test3.html | 8 + .../window_length.html | 51 ++ .../the-window-object/close-method.window.js | 39 ++ .../the-window-object/closed-attribute.window.js | 69 ++ .../browsers/the-window-object/defaultstatus.html | 17 + .../the-window-object/document-attribute.window.js | 15 + .../browsers/the-window-object/focus.window.js | 15 + .../discard_iframe_history_1-1.html | 20 + .../discard_iframe_history_1-2.html | 2 + .../discard_iframe_history_1.html | 10 + .../discard_iframe_history_2-1.html | 22 + .../discard_iframe_history_2.html | 10 + .../discard_iframe_history_3-1.html | 21 + .../discard_iframe_history_3-2.html | 4 + .../discard_iframe_history_3-3.html | 4 + .../discard_iframe_history_3.html | 9 + .../discard_iframe_history_4-1.html | 21 + .../discard_iframe_history_4-2.html | 4 + .../discard_iframe_history_4-3.html | 4 + .../discard_iframe_history_4.html | 9 + .../non-automated/discard_iframe_history_1-1.html | 27 + .../non-automated/discard_iframe_history_1-2.html | 2 + .../discard_iframe_history_1-manual.html | 10 + .../non-automated/discard_iframe_history_2-1.html | 19 + .../non-automated/discard_iframe_history_2-2.html | 1 + .../non-automated/discard_iframe_history_2-3.html | 1 + .../discard_iframe_history_2-manual.html | 10 + .../the-window-object/historical.window.js | 4 + .../the-window-object/length-attribute.window.js | 24 + .../the-window-object/name-attribute.window.js | 18 + .../cross-global-npo.html | 38 ++ .../cross-global-support.html | 4 + .../named-objects.html | 76 +++ .../navigated-named-objects.window.js | 67 ++ .../prototype.html | 94 +++ .../strict-mode-redefine-readonly-property.html | 17 + .../named-access-on-the-window-object/test.html | 7 + .../window-named-properties.html | 83 +++ .../window-null-names.html | 20 + ...-to-about-blank-while-initial-load-pending.html | 26 + .../noopener-noreferrer-BarProp.window.js | 23 + .../noopener-noreferrer-sizing.window.js | 17 + .../the-window-object/open-close/callback.js | 1 + .../open-close/close_beforeunload-1.html | 7 + .../open-close/close_beforeunload.html | 16 + .../open-close/close_pagehide-1.html | 7 + .../open-close/close_pagehide.html | 16 + .../open-close/close_script_defer-1.html | 1 + .../open-close/close_script_defer.html | 18 + .../open-close/close_unload-1.html | 7 + .../the-window-object/open-close/close_unload.html | 16 + .../creating_browsing_context_test_01.html | 39 ++ ..._open_when_term_nesting_level_nonzero.window.js | 113 ++++ .../open-close/non_automated/001-1.html | 2 + .../open-close/non_automated/001-2.html | 16 + .../open-close/non_automated/001.html | 3 + .../open-close/non_automated/002-1.html | 8 + .../open-close/non_automated/002-2.html | 16 + .../open-close/non_automated/002.html | 3 + .../open-features-is-popup-condition.html | 149 +++++ ...n-features-negative-innerwidth-innerheight.html | 75 +++ .../open-features-negative-screenx-screeny.html | 67 ++ .../open-features-negative-top-left.html | 68 ++ .../open-features-negative-width-height.html | 75 +++ .../open-features-non-integer-height.html | 91 +++ .../open-features-non-integer-innerheight.html | 76 +++ .../open-features-non-integer-innerwidth.html | 75 +++ .../open-close/open-features-non-integer-left.html | 76 +++ .../open-features-non-integer-screenx.html | 75 +++ .../open-features-non-integer-screeny.html | 76 +++ .../open-close/open-features-non-integer-top.html | 73 +++ .../open-features-non-integer-width.html | 91 +++ ...atures-tokenization-innerheight-innerwidth.html | 55 ++ .../open-features-tokenization-noopener.html | 11 + .../open-features-tokenization-noreferrer.html | 11 + ...open-features-tokenization-screenx-screeny.html | 55 ++ .../open-features-tokenization-top-left.html | 69 ++ .../open-features-tokenization-width-height.html | 71 ++ .../open-close/resources/close-self.html | 3 + .../open-close/resources/is-popup-barprop.html | 15 + .../open-close/resources/message-opener.html | 52 ++ .../resources/tokenization-noopener-noreferrer.js | 152 +++++ .../proxy-getOwnPropertyDescriptor.html | 126 ++++ .../security-window/window-security.https.html | 200 ++++++ .../the-window-object/self-et-al.window.js | 43 ++ .../the-window-object/support/BarProp-target.html | 17 + .../browsers/the-window-object/support/closed.html | 12 + .../the-window-object/support/noopener-target.html | 15 + .../support/noreferrer-target.html | 13 + .../support/same-origin-iframe.html | 8 + .../the-window-object/support/sizing-target.html | 17 + .../support/window-open-popup-target.html | 24 + .../support/windowFeature-values-target.html | 24 + .../browsers/the-window-object/window-aliases.html | 28 + .../window-indexed-access-vs-named-access.html | 58 ++ .../window-indexed-properties-delete-no-cache.html | 31 + .../window-indexed-properties-strict.html | 75 +++ .../window-indexed-properties.html | 71 ++ .../window-open-defaults.window.js | 12 + .../the-window-object/window-open-invalid-url.html | 10 + .../the-window-object/window-open-noopener.html | 137 ++++ .../the-window-object/window-open-noreferrer.html | 20 + .../window-open-popup-behavior.html | 51 ++ .../window-open-windowfeatures-values.html | 72 +++ .../window-opener-unconfigurable.window.js | 17 + .../the-window-object/window-properties.https.html | 359 +++++++++++ .../the-window-object/window-prototype-chain.html | 32 + ...euse-in-nested-browsing-contexts.tentative.html | 158 +++++ ...ild-browsing-context-name-property-set.sub.html | 26 + ...efine-own-property-unforgeable-same-origin.html | 47 ++ .../windowproxy-prevent-extensions.html | 21 + ...-prototype-setting-cross-origin-domain.sub.html | 29 + ...owproxy-prototype-setting-cross-origin.sub.html | 28 + ...otype-setting-goes-cross-origin-domain.sub.html | 35 + ...y-prototype-setting-same-origin-domain.sub.html | 30 + .../windowproxy-prototype-setting-same-origin.html | 21 + .../auxiliary-browsing-contexts/opener-closed.html | 31 + .../opener-multiple.html | 35 + .../opener-noopener.html | 25 + .../opener-noreferrer.html | 29 + .../auxiliary-browsing-contexts/opener-setter.html | 33 + .../opener-setter.window.js | 38 ++ .../auxiliary-browsing-contexts/opener.html | 55 ++ .../resources/close-opener.html | 30 + .../resources/message-window-opener.html | 14 + .../resources/multiple-opener.html | 32 + .../resources/no-opener.html | 16 + .../resources/open-closer.html | 17 + .../resources/opener-setter.html | 23 + .../browsing-context-names/choose-_blank-001.html | 35 + .../browsing-context-names/choose-_blank-002.html | 21 + .../browsing-context-names/choose-_blank-003.html | 20 + .../browsing-context-names/choose-_parent-001.html | 15 + .../browsing-context-names/choose-_parent-002.html | 17 + .../browsing-context-names/choose-_parent-003.html | 17 + .../browsing-context-names/choose-_parent-004.html | 40 ++ .../browsing-context-names/choose-_self-001.html | 15 + .../browsing-context-names/choose-_self-002.html | 46 ++ .../browsing-context-names/choose-_top-001.html | 34 + .../browsing-context-names/choose-_top-002.html | 33 + .../browsing-context-names/choose-_top-003.html | 39 ++ .../browsing-context-names/choose-default-001.html | 23 + .../browsing-context-names/choose-default-002.html | 16 + .../choose-existing-001.html | 17 + .../resources/choose-_parent-001-iframe-1.html | 5 + .../resources/choose-_parent-002-iframe.html | 4 + .../resources/choose-_parent-002-window.html | 12 + .../resources/choose-_parent-003-iframe.html | 6 + .../resources/choose-_parent-003-window.html | 4 + .../resources/choose-_parent-004-iframe-1.html | 14 + .../resources/choose-_parent-004-iframe-2.html | 9 + .../resources/choose-_self-001-iframe.html | 9 + .../resources/choose-_self-002-iframe.html | 11 + .../resources/choose-_top-002-window.html | 16 + .../resources/choose-_top-003-iframe-1.html | 15 + .../resources/choose-_top-003-iframe-2.html | 10 + .../resources/choose-default-002-iframe.html | 17 + .../resources/choose-existing-001-iframe.html | 7 + .../resources/open-in-_parent.html | 9 + .../resources/open-in-_top.html | 9 + .../resources/post-to-opener.html | 12 + .../resources/post-to-top.html | 10 + .../resources/report-has-opener.html | 8 + .../resources/report-is-top.html | 10 + .../browsers/windows/browsing-context-window.html | 37 ++ .../html/browsers/windows/browsing-context.html | 48 ++ .../browsers/windows/clear-window-name.https.html | 122 ++++ .../windows/dangling-markup-window-name.html | 97 +++ .../document-domain-nested-navigate.window.js | 16 + .../windows/document-domain-nested-set.window.js | 10 + .../windows/document-domain-nested.window.js | 9 + .../windows/document-domain-removed-iframe.html | 72 +++ .../browsers/windows/embedded-opener-a-form.html | 30 + .../windows/embedded-opener-remove-frame.html | 66 ++ .../html/browsers/windows/embedded-opener.html | 32 + .../windows/iframe-cross-origin-print.sub.html | 6 + .../iframe-cross-origin-scaled-print.sub.html | 17 + .../browsers/windows/iframe-nested-print-ref.html | 9 + .../html/browsers/windows/iframe-nested-print.html | 6 + .../windows/iframe-nested-scaled-print-ref.html | 15 + .../frameElement-siblings.sub.html | 42 ++ .../nested-browsing-contexts/frameElement.sub.html | 66 ++ .../name-attribute.window.js | 58 ++ .../resources/frameElement-nested-frame.html | 7 + .../resources/frameElement-sibling-accessed.html | 16 + .../resources/frameElement-sibling-accessor.html | 33 + .../resources/frameElement-window-post.html | 14 + .../resources/post-to-opener.html | 7 + .../resources/post-to-parent.html | 6 + .../window-parent-null.html | 66 ++ .../nested-browsing-contexts/window-parent.html | 44 ++ .../nested-browsing-contexts/window-top-null.html | 66 ++ .../nested-browsing-contexts/window-top.html | 65 ++ .../noreferrer-cross-origin-close-manual.sub.html | 3 + .../windows/noreferrer-cross-origin-manual.html | 10 + ...ferrer-cross-origin-window-name-manual.sub.html | 3 + .../browsers/windows/noreferrer-null-opener.html | 25 + .../browsers/windows/noreferrer-window-name.html | 86 +++ .../windows/opener-cross-origin-manual.sub.html | 10 + .../html/browsers/windows/opener-string.window.js | 14 + ...t-party-to-first-party-cross-partition.sub.html | 26 + .../first-party-to-first-party-same-partition.html | 26 + ...ird-party-cross-partition-cross-origin.sub.html | 27 + ...hird-party-cross-partition-same-origin.sub.html | 27 + ...arty-to-first-party-cross-partition-window.html | 8 + ...party-to-first-party-same-partition-window.html | 8 + ...-cross-partition-cross-origin-iframe.https.html | 8 + ...ss-partition-cross-origin-window.sub.https.html | 6 + ...d-party-cross-partition-same-origin-iframe.html | 8 + ...rty-cross-partition-same-origin-window.sub.html | 6 + ...ty-cross-partition-cross-origin-iframe.sub.html | 17 + ...-cross-partition-cross-origin-window.https.html | 8 + ...rty-cross-partition-same-origin-iframe.sub.html | 17 + ...t-party-cross-partition-same-origin-window.html | 8 + ...-cross-partition-cross-origin-iframe-a.sub.html | 17 + ...ross-partition-cross-origin-iframe-b.https.html | 8 + ...ss-partition-cross-origin-window.sub.https.html | 6 + ...s-partition-same-origin-iframe-a.sub.https.html | 17 + ...cross-partition-same-origin-iframe-b.https.html | 8 + ...oss-partition-same-origin-window.sub.https.html | 6 + ...to-third-party-same-partition-iframe-a.sub.html | 17 + ...rty-to-third-party-same-partition-iframe-b.html | 8 + ...y-to-third-party-same-partition-window.sub.html | 6 + ...rst-party-cross-partition-cross-origin.sub.html | 29 + ...irst-party-cross-partition-same-origin.sub.html | 29 + ...ird-party-cross-partition-cross-origin.sub.html | 30 + ...hird-party-cross-partition-same-origin.sub.html | 30 + ...rd-party-to-third-party-same-partition.sub.html | 30 + .../windows/resources/browsing-context-window.html | 7 + .../windows/resources/document-domain-setter.html | 7 + .../windows/resources/echo-window-name.html | 1 + .../resources/iframe-nested-cross-origin.html | 2 + .../resources/iframe-nested-printing-pass.html | 9 + .../browsers/windows/resources/message-parent.html | 5 + .../windows/resources/nested-post-to-opener.html | 12 + .../windows/resources/noreferrer-window-name.html | 8 + .../resources/opener-cross-origin-embed.sub.html | 2 + .../windows/resources/opener-cross-origin-end.txt | 1 + .../windows/resources/opener-cross-origin.html | 4 + .../browsers/windows/resources/post-to-opener.html | 8 + .../resources/restore-window-name-back.sub.html | 7 + .../windows/resources/restore-window-name.sub.html | 43 ++ .../windows/resources/target-cross-origin.sub.html | 3 + .../windows/resources/window-close-button.html | 1 + .../windows/resources/window-name-stash.py | 13 + .../windows/resources/window-name.sub.html | 102 +++ .../browsers/windows/resources/window-opener.html | 4 + .../windows/restore-window-name-manual.https.html | 20 + ...ting-cross-origin-nested-browsing-contexts.html | 39 ++ ...targeting-multiple-cross-origin-manual.sub.html | 9 + .../targeting-with-embedded-null-in-target.html | 34 + 1125 files changed, 35188 insertions(+) create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/README.md create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/eligibility/broadcast-channel.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/eligibility/dedicated-worker.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/eligibility/inflight-fetch-1.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/eligibility/inflight-fetch-2.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/eligibility/inflight-fetch-cors.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/eligibility/inflight-fetch-redirects.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/eligibility/shared-worker.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/events.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/focus.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/pushstate.https.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/resources/echo-worker.js create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/resources/event-recorder.js create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/resources/executor-pushstate.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/resources/executor.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/resources/executor.js create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/resources/helper.sub.js create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/resources/inflight-fetch-helper.js create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/resources/rc-helper.js create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/resources/service-worker.js create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/resources/slow.py create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/resources/worker-helper.js create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/service-worker-client-postmessage.https.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/service-worker-clients-claim.https.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/service-worker-clients-matchall.https.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/service-worker-controlled-after-restore.https.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/service-worker-unregister.https.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/storage-events.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/timers.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/001-1.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/001-2.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/001.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/PopStateEvent.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/api-availability.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/browsing_context_name-0.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/browsing_context_name-1.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/browsing_context_name-2.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/browsing_context_name-3.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/browsing_context_name-4.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/browsing_context_name.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/browsing_context_name_cross_origin-0.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/browsing_context_name_cross_origin.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/browsing_context_name_cross_origin_2.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/browsing_context_name_cross_origin_3.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/document-state.https.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/event-order/after-load-hash-twice.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/event-order/after-load-hash.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/event-order/after-load-pushState.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/event-order/after-load-replaceState.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/event-order/before-load-hash-twice.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/event-order/before-load-hash.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/event-order/before-load-pushState.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/event-order/before-load-replaceState.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/event-order/pushState-inside-popstate.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/event-order/same-document-traverse-immediate.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/event-order/same-document-traverse-wait.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/events.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/hashchange_event.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/history-traversal-navigate-parent-while-child-loading.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/history-traversal-navigates-multiple-frames.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/pagereveal/order-in-bfcache-restore.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/pagereveal/order-in-new-document-navigation.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/pagereveal/order-in-prerender-activation.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/pagereveal/resources/order-in-prerender-activation-popup.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/persisted-user-state-restoration/resources/blank1.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/persisted-user-state-restoration/resources/blank2.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/persisted-user-state-restoration/resources/page-with-fragment.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/persisted-user-state-restoration/resources/post_name_on_load.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/persisted-user-state-restoration/resume-timer-on-history-back.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/persisted-user-state-restoration/scroll-restoration-basic.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/persisted-user-state-restoration/scroll-restoration-fragment-scrolling-cross-origin.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/persisted-user-state-restoration/scroll-restoration-fragment-scrolling-samedoc.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/persisted-user-state-restoration/scroll-restoration-navigation-cross-origin.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/persisted-user-state-restoration/scroll-restoration-navigation-samedoc.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/popstate_event.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/resources/a.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/resources/api-availability-1.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/resources/api-availability-2.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/resources/b.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/resources/c.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/resources/unset_context_name-1.sub.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/resources/unset_context_name_stash.py create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/same-url.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/scroll-restoration-order.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/srcdoc/consecutive-srcdoc.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/srcdoc/srcdoc-history-entries.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/support/window-name-after-cross-origin-main-frame-navigation-popup.sub.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/support/window-name-after-same-origin-main-frame-navigation-1.sub.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/support/window-name-navigation.sub.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/support/window-name-test.sub.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/unset_context_name.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/window-name-after-cross-origin-aux-frame-navigation.sub.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/window-name-after-cross-origin-main-frame-navigation.sub.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/window-name-after-cross-origin-sub-frame-navigation.sub.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/window-name-after-same-origin-aux-frame-navigation.sub.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/window-name-after-same-origin-main-frame-navigation.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/window-name-after-same-origin-sub-frame-navigation.sub.html 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 create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/README.md create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/anchor-fragment-history-back-on-click.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/cross-document-nav-cross-document-nav.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/cross-document-nav-cross-document-traversal.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/cross-document-nav-same-document-nav.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/cross-document-nav-same-document-traversal.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/cross-document-nav-stop.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/cross-document-traversal-cross-document-nav.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/cross-document-traversal-cross-document-traversal.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/cross-document-traversal-same-document-nav.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/cross-document-traversal-same-document-traversal.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/cross-document-traversal-stop.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/forward-to-pruned-entry.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/nav-cancelation-1.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/nav-cancelation-2.sub.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/resources/helpers.mjs create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/resources/nav-cancelation-2-helper.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/resources/slow.py create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/same-document-nav-cross-document-nav.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/same-document-nav-cross-document-traversal.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/same-document-nav-same-document-nav.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/same-document-nav-same-document-traversal.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/same-document-nav-stop.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/same-document-traversal-cross-document-nav.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/same-document-traversal-cross-document-traversal.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/same-document-traversal-same-document-nav.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/same-document-traversal-same-document-traversal-hashchange.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/same-document-traversal-same-document-traversal-pushstate.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/same-document-traversal-stop.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/read-media/cross-origin-video.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/read-media/pageload-image-in-popup.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/read-media/pageload-image.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/read-media/pageload-video.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/read-media/resources/iframe-document.sub.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/read-text/load-text-plain.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper-tests/addHTML.window.js create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper-tests/addIframe-srcdoc-startOn.window.js create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper-tests/addIframe-srcdoc.window.js create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper-tests/addIframe.window.js create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper-tests/addScripts.window.js create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper-tests/addWindow-defaults.window.js create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper-tests/addWindow-extra-config.window.js create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper-tests/addWindow-features.window.js create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper-tests/addWindow-invalid-origin.window.js create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper-tests/addWindow-startOn.window.js create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper-tests/addWindow-target.window.js create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper-tests/addWorker.window.js create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper-tests/constructor.window.js create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper-tests/createContext-bad-executorCreator.window.js create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper-tests/getRequestHeaders.window.js create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper-tests/navigateToNew.window.js create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper-tests/navigation-bfcache.window.js create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper-tests/navigation-helpers.window.js create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper-tests/navigation-same-document.window.js create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper-tests/resources/test-helper.js create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper-tests/resources/test-script.js create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper-tests/resources/test-script2.js create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper/resources/executor-common.js create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper/resources/executor-window.js create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper/resources/executor-window.py create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper/resources/executor-worker.js create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper/resources/remote-context-helper.js create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/resources/has-iframe.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/resources/helpers.js create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/resources/post-top-opener-on-load.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/001.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/002.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/003.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/004.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/005.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/006.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/007.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/forward-triggers-hashchange.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/fragment-and-encoding-2.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/fragment-and-encoding.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/navigate-helpers.js create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/replacement-enabled.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/scroll-frag-non-utf8-encoded-document.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/scroll-frag-percent-encoded.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/scroll-position-vertical-lr.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/scroll-position-vertical-rl.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/scroll-position.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/scroll-to-anchor-name.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/scroll-to-id-top.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/scroll-to-top.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/001.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/002.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/003.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/004.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/005.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/base.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/beforeunload-canceling-1.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/beforeunload-canceling.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/beforeunload-on-history-back-1.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/beforeunload-on-history-back.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/beforeunload-on-navigation-of-parent-1.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/beforeunload-on-navigation-of-parent-2.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/beforeunload-on-navigation-of-parent.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/beforeunload-sticky-activation-iframe.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/beforeunload-sticky-activation-manual.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/beforeunload-sticky-activation-popup.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/beforeunload-synchronous.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/navigation-within-beforeunload-1.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/navigation-within-beforeunload-2.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/navigation-within-beforeunload.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/pagehide-on-history-forward-1.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/pagehide-on-history-forward.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt-and-unload-script-closeable.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt-and-unload-script-uncloseable-1.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt-and-unload-script-uncloseable.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/001-1.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/001-2.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/001.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/002-1.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/002.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/003.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/004-1.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/004-2.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/004.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/manual-001.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/manual-002.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/manual-003.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/manual-004.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/manual-005.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/manual-006.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/next.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/001-1.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/001a.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/001b.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/002-1.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/002a.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/002b.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/003-1.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/003a.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/003b.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/004-1.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/004a.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/004b.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/005-1.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/005a.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/005b.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/beforeunload-sticky-destination.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/beforeunload-sticky-start.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/001-1.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/001-2.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/001.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/002-1.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/002.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/003-1.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/003.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/004-1.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/004.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/006-1.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/006-2.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/006.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/007-1.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/007-2.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/007.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/008-1.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/008.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/009-1.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/009.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/pagehide-manual-1.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/pagehide-manual.html create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/unload-main-frame-cross-origin.window.js create mode 100644 testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/unload-main-frame-same-origin.window.js create mode 100644 testing/web-platform/tests/html/browsers/history/joint-session-history/joint-session-history-child1.html create mode 100644 testing/web-platform/tests/html/browsers/history/joint-session-history/joint-session-history-child2.html create mode 100644 testing/web-platform/tests/html/browsers/history/joint-session-history/joint-session-history-filler.html create mode 100644 testing/web-platform/tests/html/browsers/history/joint-session-history/joint-session-history-grandchild1.html create mode 100644 testing/web-platform/tests/html/browsers/history/joint-session-history/joint-session-history-grandchild2.html create mode 100644 testing/web-platform/tests/html/browsers/history/joint-session-history/joint-session-history-iframe-state.html create mode 100644 testing/web-platform/tests/html/browsers/history/joint-session-history/joint-session-history-only-fully-active.html create mode 100644 testing/web-platform/tests/html/browsers/history/joint-session-history/joint-session-history-remove-iframe.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/001.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/002.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/004.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/005.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/006.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/007.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/008.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/008.js create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/009-1.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/009-3.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/009-5.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/009.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/010-1.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/010-3.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/010-5.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/010.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/011.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/012.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/blank-new.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/blank-old.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/blank.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/blank2.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/blank3.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/combination_history_001.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/combination_history_002.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/combination_history_003.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/combination_history_004.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/combination_history_005.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/combination_history_006.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/combination_history_007.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/history-associated-with-document.window.js create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/history-state-after-bfcache.window.js create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/history.js create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/history_back-1.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/history_back.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/history_back_1.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/history_back_cross_realm_method.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/history_entry.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/history_forward-1.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/history_forward-2.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/history_forward.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/history_forward_1.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/history_forward_cross_realm_method.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/history_go_cross_realm_method.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/history_go_minus.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/history_go_no_argument-1.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/history_go_no_argument.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/history_go_plus.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/history_go_to_uri-1.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/history_go_to_uri.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/history_go_undefined-1.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/history_go_undefined.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/history_go_zero-1.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/history_go_zero.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/history_go_zero_which_document.window.js create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/history_properties_only_fully_active.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/history_pushstate.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/history_pushstate_err.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/history_pushstate_nooptionalparam.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/history_pushstate_url.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/history_pushstate_url_rewriting.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/history_replacestate.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/history_replacestate_err.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/history_replacestate_nooptionalparam.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/history_state.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/iframe_history_go_0.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/joint_session_history/001-1.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/joint_session_history/001.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/joint_session_history/002-1.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/joint_session_history/002.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/joint_session_history/filler.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/non-automated/history.js create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/non-automated/history_entry.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/non-automated/traverse_the_history_unload_prompt_1-1.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/non-automated/traverse_the_history_unload_prompt_1-manual.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/non-automated/traverse_the_history_unload_prompt_2-1.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/non-automated/traverse_the_history_unload_prompt_2-manual.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/non-automated/traverse_the_session_history_unload_prompt_1-1.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/non-automated/traverse_the_session_history_unload_prompt_1-manual.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/pushstate-replacestate-empty-string/pushstate-base.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/pushstate-replacestate-empty-string/pushstate-whitespace.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/pushstate-replacestate-empty-string/pushstate.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/pushstate-replacestate-empty-string/replacestate-base.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/pushstate-replacestate-empty-string/replacestate-whitespace.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/pushstate-replacestate-empty-string/replacestate.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/resources/message-opener.sub.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/resources/traverse-during-beforeunload.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/resources/traverse-during-unload.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/resources/url-rewriting-helper.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/traverse-during-beforeunload.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/traverse-during-unload.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_1-1.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_1.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_2-1.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_2.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_3-1.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_3.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_4-1.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_4.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_5-1.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_5.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_unload_1-1.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_unload_1.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_write_after_load_1-1.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_write_after_load_1.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_write_after_load_2-1.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_write_after_load_2.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_write_onload_1-1.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_write_onload_1.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_write_onload_2-1.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_write_onload_2.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-location-interface/allow_prototype_cycle_through_location.sub.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-location-interface/assign_after_load-1.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-location-interface/assign_after_load-2.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-location-interface/assign_after_load.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-location-interface/assign_before_load-1.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-location-interface/assign_before_load-2.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-location-interface/assign_before_load.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-location-interface/cross_origin_joined_frame.sub.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-location-interface/document_location.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-location-interface/location-non-configurable-toString-valueOf.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-location-interface/location-origin-idna.sub.window.js create mode 100644 testing/web-platform/tests/html/browsers/history/the-location-interface/location-pathname-setter-question-mark.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-location-interface/location-prevent-extensions.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-location-interface/location-protocol-setter-non-broken-weird.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-location-interface/location-protocol-setter-non-broken.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-location-interface/location-protocol-setter-sameish.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-location-interface/location-protocol-setter-with-colon.sub.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-location-interface/location-protocol-setter.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-location-interface/location-prototype-no-toString-valueOf.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-location-interface/location-prototype-setting-cross-origin-domain.sub.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-location-interface/location-prototype-setting-cross-origin.sub.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-location-interface/location-prototype-setting-goes-cross-origin-domain.sub.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-location-interface/location-prototype-setting-same-origin-domain.sub.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-location-interface/location-prototype-setting-same-origin.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-location-interface/location-stringifier.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-location-interface/location-symbol-toprimitive.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-location-interface/location-tojson.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-location-interface/location-valueof.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-location-interface/location_assign.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-location-interface/location_assign_about_blank-1.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-location-interface/location_assign_about_blank.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-location-interface/location_hash.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-location-interface/location_host.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-location-interface/location_hostname.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-location-interface/location_href.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-location-interface/location_origin.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-location-interface/location_pathname.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-location-interface/location_port.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-location-interface/location_protocol.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-location-interface/location_reload-iframe.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-location-interface/location_reload.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-location-interface/location_reload_javascript_url.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-location-interface/location_replace.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-location-interface/location_search.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-location-interface/no-browsing-context.window.js create mode 100644 testing/web-platform/tests/html/browsers/history/the-location-interface/non-automated/manual_click_assign_during_load-1.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-location-interface/non-automated/manual_click_assign_during_load-2.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-location-interface/non-automated/manual_click_assign_during_load-manual.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-location-interface/non-automated/manual_click_location_replace_during_load-1.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-location-interface/non-automated/manual_click_location_replace_during_load-2.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-location-interface/non-automated/manual_click_location_replace_during_load-manual.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-location-interface/non-automated/manual_click_replace_during_load-manual.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-location-interface/non-automated/manual_form_submit_assign_during_load-1.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-location-interface/non-automated/manual_form_submit_assign_during_load-2.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-location-interface/non-automated/manual_form_submit_assign_during_load-manual.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-location-interface/non-automated/reload_in_resize-1.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-location-interface/non-automated/reload_in_resize-manual.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-location-interface/per-global.window.js create mode 100644 testing/web-platform/tests/html/browsers/history/the-location-interface/reload_document_open_write-1.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-location-interface/reload_document_open_write.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-location-interface/reload_document_write-1.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-location-interface/reload_document_write.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-location-interface/reload_document_write_onload-1.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-location-interface/reload_document_write_onload.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-location-interface/reload_post_1-manual.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-location-interface/resources/post-your-origin.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-location-interface/resources/post-your-protocol.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-location-interface/resources/reload_post_1-1.py create mode 100644 testing/web-platform/tests/html/browsers/history/the-location-interface/same-hash.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-location-interface/same_origin_frame.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-location-interface/scripted_click_assign_during_load-1.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-location-interface/scripted_click_assign_during_load-2.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-location-interface/scripted_click_assign_during_load.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-location-interface/scripted_click_location_assign_during_load-1.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-location-interface/scripted_click_location_assign_during_load-2.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-location-interface/scripted_click_location_assign_during_load.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-location-interface/scripted_form_submit_assign_during_load-1.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-location-interface/scripted_form_submit_assign_during_load-2.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-location-interface/scripted_form_submit_assign_during_load.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-location-interface/security_location_0.htm create mode 100644 testing/web-platform/tests/html/browsers/history/the-session-history-of-browsing-contexts/navigation-in-onload.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-session-history-of-browsing-contexts/navigation-in-onload_form-submission-1.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-session-history-of-browsing-contexts/navigation-in-onload_form-submission-2.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-session-history-of-browsing-contexts/navigation-in-onload_form-submission-dynamic-iframe.html create mode 100644 testing/web-platform/tests/html/browsers/history/the-session-history-of-browsing-contexts/navigation-in-onload_form-submission-iframe.html create mode 100644 testing/web-platform/tests/html/browsers/offline/application-cache-api/api_status_checking-manual.html create mode 100644 testing/web-platform/tests/html/browsers/offline/application-cache-api/api_status_downloading-manual.html create mode 100644 testing/web-platform/tests/html/browsers/offline/application-cache-api/api_status_obsolete-manual.html create mode 100644 testing/web-platform/tests/html/browsers/offline/application-cache-api/api_status_updateready-manual.html create mode 100644 testing/web-platform/tests/html/browsers/offline/application-cache-api/api_swapcache-manual.html create mode 100644 testing/web-platform/tests/html/browsers/offline/browser-state/navigator_online_event-manual.https.html create mode 100644 testing/web-platform/tests/html/browsers/offline/browser-state/navigator_online_online.https.html create mode 100644 testing/web-platform/tests/html/browsers/offline/changestonetworkingmodel/original-id.json create mode 100644 testing/web-platform/tests/html/browsers/offline/introduction-4/event_downloading-manual.html create mode 100644 testing/web-platform/tests/html/browsers/offline/introduction-4/event_error-manual.html create mode 100644 testing/web-platform/tests/html/browsers/offline/introduction-4/event_obsolete-manual.html create mode 100644 testing/web-platform/tests/html/browsers/offline/introduction-4/event_updateready-manual.html create mode 100644 testing/web-platform/tests/html/browsers/offline/introduction-4/event_updateready_swapcache-manual.html create mode 100644 testing/web-platform/tests/html/browsers/offline/manifest_main_empty-manual.https.html create mode 100644 testing/web-platform/tests/html/browsers/offline/manifest_notchanged_online-manual.https.html create mode 100644 testing/web-platform/tests/html/browsers/offline/manifest_section_empty-manual.https.html create mode 100644 testing/web-platform/tests/html/browsers/offline/manifest_section_many-manual.https.html create mode 100644 testing/web-platform/tests/html/browsers/offline/resources/css/clock.css create mode 100644 testing/web-platform/tests/html/browsers/offline/resources/css/offline.css create mode 100644 testing/web-platform/tests/html/browsers/offline/resources/css/online.css create mode 100644 testing/web-platform/tests/html/browsers/offline/resources/css/result.css create mode 100644 testing/web-platform/tests/html/browsers/offline/resources/html/clock.html create mode 100644 testing/web-platform/tests/html/browsers/offline/resources/js/clock.js create mode 100644 testing/web-platform/tests/html/browsers/offline/resources/manifest/clock.manifest create mode 100644 testing/web-platform/tests/html/browsers/offline/resources/manifest/section_empty.manifest create mode 100644 testing/web-platform/tests/html/browsers/offline/resources/manifest/section_many.manifest create mode 100644 testing/web-platform/tests/html/browsers/offline/resources/manifest/url_check.manifest create mode 100644 testing/web-platform/tests/html/browsers/offline/section_network_offline-manual.https.html create mode 100644 testing/web-platform/tests/html/browsers/offline/section_network_online-manual.https.html create mode 100644 testing/web-platform/tests/html/browsers/origin/cross-origin-objects/cross-origin-due-to-document-domain-only.html create mode 100644 testing/web-platform/tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-function-caching.html create mode 100644 testing/web-platform/tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-function-common.js create mode 100644 testing/web-platform/tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-function-length.html create mode 100644 testing/web-platform/tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-function-name.html create mode 100644 testing/web-platform/tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-on-new-window.html create mode 100644 testing/web-platform/tests/html/browsers/origin/cross-origin-objects/cross-origin-objects.html create mode 100644 testing/web-platform/tests/html/browsers/origin/cross-origin-objects/frame-with-then.html create mode 100644 testing/web-platform/tests/html/browsers/origin/cross-origin-objects/frame.html create mode 100644 testing/web-platform/tests/html/browsers/origin/cross-origin-objects/location-properties-smoke-test.window.js create mode 100644 testing/web-platform/tests/html/browsers/origin/cross-origin-objects/resources/cross-origin-due-to-document-domain-only-helper.html create mode 100644 testing/web-platform/tests/html/browsers/origin/cross-origin-objects/win-documentdomain.sub.html create mode 100644 testing/web-platform/tests/html/browsers/origin/cross-origin-objects/window-location-and-location-href-cross-realm-set.html create mode 100644 testing/web-platform/tests/html/browsers/origin/inheritance/about-blank-iframe.html create mode 100644 testing/web-platform/tests/html/browsers/origin/inheritance/about-blank-window.html create mode 100644 testing/web-platform/tests/html/browsers/origin/inheritance/about-srcdoc.html create mode 100644 testing/web-platform/tests/html/browsers/origin/inheritance/document-write.https.window.js create mode 100644 testing/web-platform/tests/html/browsers/origin/inheritance/document-write.https.window.js.headers create mode 100644 testing/web-platform/tests/html/browsers/origin/inheritance/javascript-url.html create mode 100644 testing/web-platform/tests/html/browsers/origin/inheritance/resources/document-write.html create mode 100644 testing/web-platform/tests/html/browsers/origin/inheritance/resources/document-write.html.headers create mode 100644 testing/web-platform/tests/html/browsers/origin/inheritance/resources/iframe-with-about-blank-iframe.html create mode 100644 testing/web-platform/tests/html/browsers/origin/inheritance/resources/iframe-with-about-blank-iframe.html.headers create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/1-iframe/parent-no-child-bad-subdomain.sub.https.html create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/1-iframe/parent-no-child-yes-port.sub.https.html create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/1-iframe/parent-no-child-yes-same.sub.https.html create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/1-iframe/parent-no-child-yes-subdomain-with-redirect.sub.https.html create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/1-iframe/parent-no-child-yes-subdomain.sub.https.html create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/1-iframe/parent-no-child-yeswithparams-subdomain.sub.https.html create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/1-iframe/parent-yes-child-no-port.sub.https.html create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/1-iframe/parent-yes-child-no-port.sub.https.html.headers create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/1-iframe/parent-yes-child-no-same.sub.https.html create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/1-iframe/parent-yes-child-no-same.sub.https.html.headers create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/1-iframe/parent-yes-child-no-subdomain.sub.https.html create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/1-iframe/parent-yes-child-no-subdomain.sub.https.html.headers create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/1-iframe/parent-yes-child-yes-port.sub.https.html create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/1-iframe/parent-yes-child-yes-port.sub.https.html.headers create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/1-iframe/parent-yes-child-yes-same.sub.https.html create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/1-iframe/parent-yes-child-yes-same.sub.https.html.headers create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/1-iframe/parent-yes-child-yes-subdomain.sub.https.html create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/1-iframe/parent-yes-child-yes-subdomain.sub.https.html.headers create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-no-child1-no-subdomain-child2-yes-subdomain.sub.https.html create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-no-child1-no-subdomain-child2-yes-subdomainport.sub.https.html create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-no-child1-no-subdomain1-child2-yes-subdomain2.sub.https.html create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-no-child1-yes-subdomain-child2-no-port.sub.https.html create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-no-child1-yes-subdomain-child2-no-subdomain.sub.https.html create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-yes-child1-no-subdomain-child2-no-subdomain.sub.https.html create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-yes-child1-no-subdomain-child2-no-subdomain.sub.https.html.headers create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-yes-child1-no-subdomain-child2-no-subdomain2.sub.https.html create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-yes-child1-no-subdomain-child2-no-subdomain2.sub.https.html.headers create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-yes-child1-no-subdomain-child2-yes-subdomain.sub.https.html create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-yes-child1-no-subdomain-child2-yes-subdomain.sub.https.html.headers create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-yes-child1-no-subdomain-child2-yes-subdomain2.sub.https.html create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-yes-child1-no-subdomain-child2-yes-subdomain2.sub.https.html.headers create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-yes-child1-no-subdomain-child2-yes-subdomainport.sub.https.html create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-yes-child1-no-subdomain-child2-yes-subdomainport.sub.https.html.headers create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-yes-child1-yes-subdomain-child2-no-port.sub.https.html create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-yes-child1-yes-subdomain-child2-no-port.sub.https.html.headers create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-yes-child1-yes-subdomain-child2-no-subdomain.sub.https.html create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-yes-child1-yes-subdomain-child2-no-subdomain.sub.https.html.headers create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-yes-child1-yes-subdomain-child2-yes-subdomain.sub.https.html create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-yes-child1-yes-subdomain-child2-yes-subdomain.sub.https.html.headers create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-yes-child1-yes-subdomain-child2-yes-subdomain2.sub.https.html create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-yes-child1-yes-subdomain-child2-yes-subdomain2.sub.https.html.headers create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-yes-child1-yes-subdomain-child2-yes-subdomainport.sub.https.html create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-yes-child1-yes-subdomain-child2-yes-subdomainport.sub.https.html.headers create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/META.yml create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/README.md create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/about-blank.https.sub.html create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/about-blank.https.sub.html.headers create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/document-domain.sub.https.html create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/document-domain.sub.https.html.headers create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/cross-origin-isolated.sub.https.html create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/cross-origin-isolated.sub.https.html.headers create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/csp-sandbox-no.https.html create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/csp-sandbox-no.https.html.headers create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/csp-sandbox-yes.https.html create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/csp-sandbox-yes.https.html.headers create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/data-to-javascript-no.https.html create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/data-to-javascript-yes.https.html create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/data-to-javascript-yes.https.html.headers create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/data-url-no.https.html create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/data-url-yes.https.html create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/data-url-yes.https.html.headers create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/javascript-url-no.https.html create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/javascript-url-yes.https.html create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/javascript-url-yes.https.html.headers create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/removed-iframe.sub.https.html create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/removed-iframe.sub.https.html.headers create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/resources/data-to-javascript-test.mjs create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/resources/data-url-test.mjs create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/resources/helpers.mjs create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/resources/javascript-url-test.mjs create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/resources/sandboxed-iframe-test.sub.mjs create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/resources/sandboxed-same-origin-iframe-test.sub.mjs create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/sandboxed-iframe-no.https.html create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/sandboxed-iframe-yes.https.html create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/sandboxed-iframe-yes.https.html.headers create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/sandboxed-same-origin-iframe-no.https.html create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/sandboxed-same-origin-iframe-yes.https.html create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/sandboxed-same-origin-iframe-yes.https.html.headers create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/going-back.sub.https.html create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/going-back.sub.https.html.headers create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/iframe-navigation/parent-no-1-no-same-2-yes-port.sub.https.html create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/iframe-navigation/parent-no-1-no-same-2-yes-subdomain.sub.https.html create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/iframe-navigation/parent-no-1-no-subdomain-2-yes-subdomain.sub.https.html create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/iframe-navigation/parent-no-1-no-subdomain-2-yes-subdomain2.sub.https.html create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/iframe-navigation/parent-no-1-subdomain-yes-2-subdomain2-no.sub.https.html create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/iframe-navigation/parent-no-1-yes-subdomain-2-no-subdomain.sub.https.html create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/iframe-navigation/parent-yes-1-no-same-2-no-port.sub.https.html create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/iframe-navigation/parent-yes-1-no-same-2-no-port.sub.https.html.headers create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/iframe-navigation/parent-yes-1-no-same-2-no-subdomain.sub.https.html create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/iframe-navigation/parent-yes-1-no-same-2-no-subdomain.sub.https.html.headers create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/insecure-http.sub.html create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/insecure-http.sub.html.headers create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/popups-crash.https.html create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/popups/opener-no-openee-yes-port.sub.https.html create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/popups/opener-no-openee-yes-same.sub.https.html create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/popups/opener-no-openee-yes-subdomain.sub.https.html create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/popups/opener-yes-openee-no-port.sub.https.html create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/popups/opener-yes-openee-no-port.sub.https.html.headers create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/popups/opener-yes-openee-no-same.sub.https.html create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/popups/opener-yes-openee-no-same.sub.https.html.headers create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/popups/opener-yes-openee-no-subdomain.sub.https.html create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/popups/opener-yes-openee-no-subdomain.sub.https.html.headers create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/popups/opener-yes-openee-yes-port.sub.https.html create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/popups/opener-yes-openee-yes-port.sub.https.html.headers create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/popups/opener-yes-openee-yes-same.sub.https.html create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/popups/opener-yes-openee-yes-same.sub.https.html.headers create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/popups/opener-yes-openee-yes-subdomain.sub.https.html create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/popups/opener-yes-openee-yes-subdomain.sub.https.html.headers create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/regression-1399759.https.sub.html create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/removing-iframes.sub.https.html create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/removing-iframes.sub.https.html.headers create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/resources/README.md create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/resources/coep-frame.html create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/resources/coep-frame.html.headers create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/resources/crashy-popup.sub.html create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/resources/crashy-popup.sub.html.headers create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/resources/frame.html create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/resources/frame.html.headers create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/resources/helpers.mjs create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/resources/helpers.mjs.headers create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/resources/send-header-page-script.mjs create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/resources/send-header-page-script.mjs.headers create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/resources/send-oac-header.py create mode 100644 testing/web-platform/tests/html/browsers/origin/origin-of-data-document.html create mode 100644 testing/web-platform/tests/html/browsers/origin/relaxing-the-same-origin-restriction/document_domain.html create mode 100644 testing/web-platform/tests/html/browsers/origin/relaxing-the-same-origin-restriction/document_domain_access_details.sub.html create mode 100644 testing/web-platform/tests/html/browsers/origin/relaxing-the-same-origin-restriction/document_domain_setter.html create mode 100644 testing/web-platform/tests/html/browsers/origin/relaxing-the-same-origin-restriction/document_domain_setter_srcdoc.html create mode 100644 testing/web-platform/tests/html/browsers/origin/relaxing-the-same-origin-restriction/sandboxed-document_domain.html create mode 100644 testing/web-platform/tests/html/browsers/origin/relaxing-the-same-origin-restriction/sandboxed-document_domain.html.headers create mode 100644 testing/web-platform/tests/html/browsers/origin/relaxing-the-same-origin-restriction/support/document_domain_frame.html create mode 100644 testing/web-platform/tests/html/browsers/origin/relaxing-the-same-origin-restriction/support/document_domain_frame.sub.js create mode 100644 testing/web-platform/tests/html/browsers/origin/relaxing-the-same-origin-restriction/support/document_domain_setter_iframe.html create mode 100644 testing/web-platform/tests/html/browsers/sandboxing/inner-iframe.html create mode 100644 testing/web-platform/tests/html/browsers/sandboxing/noscript-iframe.html create mode 100644 testing/web-platform/tests/html/browsers/sandboxing/popup-from-initial-empty-sandboxed-document.window.js create mode 100644 testing/web-platform/tests/html/browsers/sandboxing/resources/check-sandbox-flags.html create mode 100644 testing/web-platform/tests/html/browsers/sandboxing/resources/document-open.html create mode 100644 testing/web-platform/tests/html/browsers/sandboxing/resources/execute-postmessage.html create mode 100644 testing/web-platform/tests/html/browsers/sandboxing/resources/post-done-to-opener.html create mode 100644 testing/web-platform/tests/html/browsers/sandboxing/resources/sandbox-inherited-from-initiator-response-helper.html create mode 100644 testing/web-platform/tests/html/browsers/sandboxing/resources/sandbox-inherited-from-initiator-response-helper.html.headers create mode 100644 testing/web-platform/tests/html/browsers/sandboxing/resources/sandbox-javascript-window-open.html create mode 100644 testing/web-platform/tests/html/browsers/sandboxing/sandbox-allow-same-origin.html create mode 100644 testing/web-platform/tests/html/browsers/sandboxing/sandbox-allow-scripts.html create mode 100644 testing/web-platform/tests/html/browsers/sandboxing/sandbox-disallow-popups.html create mode 100644 testing/web-platform/tests/html/browsers/sandboxing/sandbox-disallow-same-origin.html create mode 100644 testing/web-platform/tests/html/browsers/sandboxing/sandbox-disallow-scripts-via-unsandboxed-popup.tentative.html create mode 100644 testing/web-platform/tests/html/browsers/sandboxing/sandbox-disallow-scripts.html create mode 100644 testing/web-platform/tests/html/browsers/sandboxing/sandbox-document-open-mutation.window.js create mode 100644 testing/web-platform/tests/html/browsers/sandboxing/sandbox-document-open.html create mode 100644 testing/web-platform/tests/html/browsers/sandboxing/sandbox-inherited-from-initiator-frame.html create mode 100644 testing/web-platform/tests/html/browsers/sandboxing/sandbox-inherited-from-initiator-response.html create mode 100644 testing/web-platform/tests/html/browsers/sandboxing/sandbox-inherited-from-required-csp.html create mode 100644 testing/web-platform/tests/html/browsers/sandboxing/sandbox-initial-empty-document-toward-same-origin.html create mode 100644 testing/web-platform/tests/html/browsers/sandboxing/sandbox-javascript-window-open.html create mode 100644 testing/web-platform/tests/html/browsers/sandboxing/sandbox-navigation-timing-iframe.tentative.html create mode 100644 testing/web-platform/tests/html/browsers/sandboxing/sandbox-navigation-timing.tentative.html create mode 100644 testing/web-platform/tests/html/browsers/sandboxing/sandbox-new-execution-context-iframe.html create mode 100644 testing/web-platform/tests/html/browsers/sandboxing/sandbox-new-execution-context.html create mode 100644 testing/web-platform/tests/html/browsers/sandboxing/sandbox-parse-noscript-ref.html create mode 100644 testing/web-platform/tests/html/browsers/sandboxing/sandbox-parse-noscript.html create mode 100644 testing/web-platform/tests/html/browsers/sandboxing/sandbox-window-open-srcdoc.html create mode 100644 testing/web-platform/tests/html/browsers/sandboxing/window-open-blank-from-different-initiator.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/BarProp.window.js create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/Document-defaultView.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/Window-document.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/accessing-other-browsing-contexts/indexed-browsing-contexts-01.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/accessing-other-browsing-contexts/indexed-browsing-contexts-02.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/accessing-other-browsing-contexts/indexed-browsing-contexts-03.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/accessing-other-browsing-contexts/iterator.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/accessing-other-browsing-contexts/test1.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/accessing-other-browsing-contexts/test2.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/accessing-other-browsing-contexts/test3.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/accessing-other-browsing-contexts/window_length.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/close-method.window.js create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/closed-attribute.window.js create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/defaultstatus.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/document-attribute.window.js create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/focus.window.js create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_1-1.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_1-2.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_1.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_2-1.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_2.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_3-1.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_3-2.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_3-3.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_3.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_4-1.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_4-2.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_4-3.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_4.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/discard_iframe_history_1-1.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/discard_iframe_history_1-2.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/discard_iframe_history_1-manual.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/discard_iframe_history_2-1.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/discard_iframe_history_2-2.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/discard_iframe_history_2-3.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/discard_iframe_history_2-manual.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/historical.window.js create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/length-attribute.window.js create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/name-attribute.window.js create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/named-access-on-the-window-object/cross-global-npo.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/named-access-on-the-window-object/cross-global-support.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/named-access-on-the-window-object/named-objects.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/named-access-on-the-window-object/navigated-named-objects.window.js create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/named-access-on-the-window-object/prototype.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/named-access-on-the-window-object/strict-mode-redefine-readonly-property.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/named-access-on-the-window-object/test.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/named-access-on-the-window-object/window-named-properties.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/named-access-on-the-window-object/window-null-names.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/navigate-to-about-blank-while-initial-load-pending.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/noopener-noreferrer-BarProp.window.js create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/noopener-noreferrer-sizing.window.js create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/open-close/callback.js create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/open-close/close_beforeunload-1.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/open-close/close_beforeunload.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/open-close/close_pagehide-1.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/open-close/close_pagehide.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/open-close/close_script_defer-1.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/open-close/close_script_defer.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/open-close/close_unload-1.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/open-close/close_unload.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/open-close/creating_browsing_context_test_01.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/open-close/no_window_open_when_term_nesting_level_nonzero.window.js create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/open-close/non_automated/001-1.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/open-close/non_automated/001-2.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/open-close/non_automated/001.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/open-close/non_automated/002-1.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/open-close/non_automated/002-2.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/open-close/non_automated/002.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-is-popup-condition.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-negative-innerwidth-innerheight.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-negative-screenx-screeny.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-negative-top-left.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-negative-width-height.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-non-integer-height.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-non-integer-innerheight.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-non-integer-innerwidth.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-non-integer-left.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-non-integer-screenx.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-non-integer-screeny.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-non-integer-top.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-non-integer-width.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-tokenization-innerheight-innerwidth.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-tokenization-noopener.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-tokenization-noreferrer.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-tokenization-screenx-screeny.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-tokenization-top-left.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-tokenization-width-height.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/open-close/resources/close-self.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/open-close/resources/is-popup-barprop.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/open-close/resources/message-opener.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/open-close/resources/tokenization-noopener-noreferrer.js create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/proxy-getOwnPropertyDescriptor.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/security-window/window-security.https.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/self-et-al.window.js create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/support/BarProp-target.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/support/closed.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/support/noopener-target.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/support/noreferrer-target.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/support/same-origin-iframe.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/support/sizing-target.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/support/window-open-popup-target.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/support/windowFeature-values-target.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/window-aliases.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/window-indexed-access-vs-named-access.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/window-indexed-properties-delete-no-cache.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/window-indexed-properties-strict.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/window-indexed-properties.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/window-open-defaults.window.js create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/window-open-invalid-url.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/window-open-noopener.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/window-open-noreferrer.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/window-open-popup-behavior.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/window-open-windowfeatures-values.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/window-opener-unconfigurable.window.js create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/window-properties.https.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/window-prototype-chain.html create mode 100644 testing/web-platform/tests/html/browsers/the-window-object/window-reuse-in-nested-browsing-contexts.tentative.html create mode 100644 testing/web-platform/tests/html/browsers/the-windowproxy-exotic-object/document-tree-child-browsing-context-name-property-set.sub.html create mode 100644 testing/web-platform/tests/html/browsers/the-windowproxy-exotic-object/windowproxy-define-own-property-unforgeable-same-origin.html create mode 100644 testing/web-platform/tests/html/browsers/the-windowproxy-exotic-object/windowproxy-prevent-extensions.html create mode 100644 testing/web-platform/tests/html/browsers/the-windowproxy-exotic-object/windowproxy-prototype-setting-cross-origin-domain.sub.html create mode 100644 testing/web-platform/tests/html/browsers/the-windowproxy-exotic-object/windowproxy-prototype-setting-cross-origin.sub.html create mode 100644 testing/web-platform/tests/html/browsers/the-windowproxy-exotic-object/windowproxy-prototype-setting-goes-cross-origin-domain.sub.html create mode 100644 testing/web-platform/tests/html/browsers/the-windowproxy-exotic-object/windowproxy-prototype-setting-same-origin-domain.sub.html create mode 100644 testing/web-platform/tests/html/browsers/the-windowproxy-exotic-object/windowproxy-prototype-setting-same-origin.html create mode 100644 testing/web-platform/tests/html/browsers/windows/auxiliary-browsing-contexts/opener-closed.html create mode 100644 testing/web-platform/tests/html/browsers/windows/auxiliary-browsing-contexts/opener-multiple.html create mode 100644 testing/web-platform/tests/html/browsers/windows/auxiliary-browsing-contexts/opener-noopener.html create mode 100644 testing/web-platform/tests/html/browsers/windows/auxiliary-browsing-contexts/opener-noreferrer.html create mode 100644 testing/web-platform/tests/html/browsers/windows/auxiliary-browsing-contexts/opener-setter.html create mode 100644 testing/web-platform/tests/html/browsers/windows/auxiliary-browsing-contexts/opener-setter.window.js create mode 100644 testing/web-platform/tests/html/browsers/windows/auxiliary-browsing-contexts/opener.html create mode 100644 testing/web-platform/tests/html/browsers/windows/auxiliary-browsing-contexts/resources/close-opener.html create mode 100644 testing/web-platform/tests/html/browsers/windows/auxiliary-browsing-contexts/resources/message-window-opener.html create mode 100644 testing/web-platform/tests/html/browsers/windows/auxiliary-browsing-contexts/resources/multiple-opener.html create mode 100644 testing/web-platform/tests/html/browsers/windows/auxiliary-browsing-contexts/resources/no-opener.html create mode 100644 testing/web-platform/tests/html/browsers/windows/auxiliary-browsing-contexts/resources/open-closer.html create mode 100644 testing/web-platform/tests/html/browsers/windows/auxiliary-browsing-contexts/resources/opener-setter.html create mode 100644 testing/web-platform/tests/html/browsers/windows/browsing-context-names/choose-_blank-001.html create mode 100644 testing/web-platform/tests/html/browsers/windows/browsing-context-names/choose-_blank-002.html create mode 100644 testing/web-platform/tests/html/browsers/windows/browsing-context-names/choose-_blank-003.html create mode 100644 testing/web-platform/tests/html/browsers/windows/browsing-context-names/choose-_parent-001.html create mode 100644 testing/web-platform/tests/html/browsers/windows/browsing-context-names/choose-_parent-002.html create mode 100644 testing/web-platform/tests/html/browsers/windows/browsing-context-names/choose-_parent-003.html create mode 100644 testing/web-platform/tests/html/browsers/windows/browsing-context-names/choose-_parent-004.html create mode 100644 testing/web-platform/tests/html/browsers/windows/browsing-context-names/choose-_self-001.html create mode 100644 testing/web-platform/tests/html/browsers/windows/browsing-context-names/choose-_self-002.html create mode 100644 testing/web-platform/tests/html/browsers/windows/browsing-context-names/choose-_top-001.html create mode 100644 testing/web-platform/tests/html/browsers/windows/browsing-context-names/choose-_top-002.html create mode 100644 testing/web-platform/tests/html/browsers/windows/browsing-context-names/choose-_top-003.html create mode 100644 testing/web-platform/tests/html/browsers/windows/browsing-context-names/choose-default-001.html create mode 100644 testing/web-platform/tests/html/browsers/windows/browsing-context-names/choose-default-002.html create mode 100644 testing/web-platform/tests/html/browsers/windows/browsing-context-names/choose-existing-001.html create mode 100644 testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/choose-_parent-001-iframe-1.html create mode 100644 testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/choose-_parent-002-iframe.html create mode 100644 testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/choose-_parent-002-window.html create mode 100644 testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/choose-_parent-003-iframe.html create mode 100644 testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/choose-_parent-003-window.html create mode 100644 testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/choose-_parent-004-iframe-1.html create mode 100644 testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/choose-_parent-004-iframe-2.html create mode 100644 testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/choose-_self-001-iframe.html create mode 100644 testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/choose-_self-002-iframe.html create mode 100644 testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/choose-_top-002-window.html create mode 100644 testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/choose-_top-003-iframe-1.html create mode 100644 testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/choose-_top-003-iframe-2.html create mode 100644 testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/choose-default-002-iframe.html create mode 100644 testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/choose-existing-001-iframe.html create mode 100644 testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/open-in-_parent.html create mode 100644 testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/open-in-_top.html create mode 100644 testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/post-to-opener.html create mode 100644 testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/post-to-top.html create mode 100644 testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/report-has-opener.html create mode 100644 testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/report-is-top.html create mode 100644 testing/web-platform/tests/html/browsers/windows/browsing-context-window.html create mode 100644 testing/web-platform/tests/html/browsers/windows/browsing-context.html create mode 100644 testing/web-platform/tests/html/browsers/windows/clear-window-name.https.html create mode 100644 testing/web-platform/tests/html/browsers/windows/dangling-markup-window-name.html create mode 100644 testing/web-platform/tests/html/browsers/windows/document-domain-nested-navigate.window.js create mode 100644 testing/web-platform/tests/html/browsers/windows/document-domain-nested-set.window.js create mode 100644 testing/web-platform/tests/html/browsers/windows/document-domain-nested.window.js create mode 100644 testing/web-platform/tests/html/browsers/windows/document-domain-removed-iframe.html create mode 100644 testing/web-platform/tests/html/browsers/windows/embedded-opener-a-form.html create mode 100644 testing/web-platform/tests/html/browsers/windows/embedded-opener-remove-frame.html create mode 100644 testing/web-platform/tests/html/browsers/windows/embedded-opener.html create mode 100644 testing/web-platform/tests/html/browsers/windows/iframe-cross-origin-print.sub.html create mode 100644 testing/web-platform/tests/html/browsers/windows/iframe-cross-origin-scaled-print.sub.html create mode 100644 testing/web-platform/tests/html/browsers/windows/iframe-nested-print-ref.html create mode 100644 testing/web-platform/tests/html/browsers/windows/iframe-nested-print.html create mode 100644 testing/web-platform/tests/html/browsers/windows/iframe-nested-scaled-print-ref.html create mode 100644 testing/web-platform/tests/html/browsers/windows/nested-browsing-contexts/frameElement-siblings.sub.html create mode 100644 testing/web-platform/tests/html/browsers/windows/nested-browsing-contexts/frameElement.sub.html create mode 100644 testing/web-platform/tests/html/browsers/windows/nested-browsing-contexts/name-attribute.window.js create mode 100644 testing/web-platform/tests/html/browsers/windows/nested-browsing-contexts/resources/frameElement-nested-frame.html create mode 100644 testing/web-platform/tests/html/browsers/windows/nested-browsing-contexts/resources/frameElement-sibling-accessed.html create mode 100644 testing/web-platform/tests/html/browsers/windows/nested-browsing-contexts/resources/frameElement-sibling-accessor.html create mode 100644 testing/web-platform/tests/html/browsers/windows/nested-browsing-contexts/resources/frameElement-window-post.html create mode 100644 testing/web-platform/tests/html/browsers/windows/nested-browsing-contexts/resources/post-to-opener.html create mode 100644 testing/web-platform/tests/html/browsers/windows/nested-browsing-contexts/resources/post-to-parent.html create mode 100644 testing/web-platform/tests/html/browsers/windows/nested-browsing-contexts/window-parent-null.html create mode 100644 testing/web-platform/tests/html/browsers/windows/nested-browsing-contexts/window-parent.html create mode 100644 testing/web-platform/tests/html/browsers/windows/nested-browsing-contexts/window-top-null.html create mode 100644 testing/web-platform/tests/html/browsers/windows/nested-browsing-contexts/window-top.html create mode 100644 testing/web-platform/tests/html/browsers/windows/noreferrer-cross-origin-close-manual.sub.html create mode 100644 testing/web-platform/tests/html/browsers/windows/noreferrer-cross-origin-manual.html create mode 100644 testing/web-platform/tests/html/browsers/windows/noreferrer-cross-origin-window-name-manual.sub.html create mode 100644 testing/web-platform/tests/html/browsers/windows/noreferrer-null-opener.html create mode 100644 testing/web-platform/tests/html/browsers/windows/noreferrer-window-name.html create mode 100644 testing/web-platform/tests/html/browsers/windows/opener-cross-origin-manual.sub.html create mode 100644 testing/web-platform/tests/html/browsers/windows/opener-string.window.js create mode 100644 testing/web-platform/tests/html/browsers/windows/post-message/first-party-to-first-party-cross-partition.sub.html create mode 100644 testing/web-platform/tests/html/browsers/windows/post-message/first-party-to-first-party-same-partition.html create mode 100644 testing/web-platform/tests/html/browsers/windows/post-message/first-party-to-third-party-cross-partition-cross-origin.sub.html create mode 100644 testing/web-platform/tests/html/browsers/windows/post-message/first-party-to-third-party-cross-partition-same-origin.sub.html create mode 100644 testing/web-platform/tests/html/browsers/windows/post-message/resources/first-party-to-first-party-cross-partition-window.html create mode 100644 testing/web-platform/tests/html/browsers/windows/post-message/resources/first-party-to-first-party-same-partition-window.html create mode 100644 testing/web-platform/tests/html/browsers/windows/post-message/resources/first-party-to-third-party-cross-partition-cross-origin-iframe.https.html create mode 100644 testing/web-platform/tests/html/browsers/windows/post-message/resources/first-party-to-third-party-cross-partition-cross-origin-window.sub.https.html create mode 100644 testing/web-platform/tests/html/browsers/windows/post-message/resources/first-party-to-third-party-cross-partition-same-origin-iframe.html create mode 100644 testing/web-platform/tests/html/browsers/windows/post-message/resources/first-party-to-third-party-cross-partition-same-origin-window.sub.html create mode 100644 testing/web-platform/tests/html/browsers/windows/post-message/resources/third-party-to-first-party-cross-partition-cross-origin-iframe.sub.html create mode 100644 testing/web-platform/tests/html/browsers/windows/post-message/resources/third-party-to-first-party-cross-partition-cross-origin-window.https.html create mode 100644 testing/web-platform/tests/html/browsers/windows/post-message/resources/third-party-to-first-party-cross-partition-same-origin-iframe.sub.html create mode 100644 testing/web-platform/tests/html/browsers/windows/post-message/resources/third-party-to-first-party-cross-partition-same-origin-window.html create mode 100644 testing/web-platform/tests/html/browsers/windows/post-message/resources/third-party-to-third-party-cross-partition-cross-origin-iframe-a.sub.html create mode 100644 testing/web-platform/tests/html/browsers/windows/post-message/resources/third-party-to-third-party-cross-partition-cross-origin-iframe-b.https.html create mode 100644 testing/web-platform/tests/html/browsers/windows/post-message/resources/third-party-to-third-party-cross-partition-cross-origin-window.sub.https.html create mode 100644 testing/web-platform/tests/html/browsers/windows/post-message/resources/third-party-to-third-party-cross-partition-same-origin-iframe-a.sub.https.html create mode 100644 testing/web-platform/tests/html/browsers/windows/post-message/resources/third-party-to-third-party-cross-partition-same-origin-iframe-b.https.html create mode 100644 testing/web-platform/tests/html/browsers/windows/post-message/resources/third-party-to-third-party-cross-partition-same-origin-window.sub.https.html create mode 100644 testing/web-platform/tests/html/browsers/windows/post-message/resources/third-party-to-third-party-same-partition-iframe-a.sub.html create mode 100644 testing/web-platform/tests/html/browsers/windows/post-message/resources/third-party-to-third-party-same-partition-iframe-b.html create mode 100644 testing/web-platform/tests/html/browsers/windows/post-message/resources/third-party-to-third-party-same-partition-window.sub.html create mode 100644 testing/web-platform/tests/html/browsers/windows/post-message/third-party-to-first-party-cross-partition-cross-origin.sub.html create mode 100644 testing/web-platform/tests/html/browsers/windows/post-message/third-party-to-first-party-cross-partition-same-origin.sub.html create mode 100644 testing/web-platform/tests/html/browsers/windows/post-message/third-party-to-third-party-cross-partition-cross-origin.sub.html create mode 100644 testing/web-platform/tests/html/browsers/windows/post-message/third-party-to-third-party-cross-partition-same-origin.sub.html create mode 100644 testing/web-platform/tests/html/browsers/windows/post-message/third-party-to-third-party-same-partition.sub.html create mode 100644 testing/web-platform/tests/html/browsers/windows/resources/browsing-context-window.html create mode 100644 testing/web-platform/tests/html/browsers/windows/resources/document-domain-setter.html create mode 100644 testing/web-platform/tests/html/browsers/windows/resources/echo-window-name.html create mode 100644 testing/web-platform/tests/html/browsers/windows/resources/iframe-nested-cross-origin.html create mode 100644 testing/web-platform/tests/html/browsers/windows/resources/iframe-nested-printing-pass.html create mode 100644 testing/web-platform/tests/html/browsers/windows/resources/message-parent.html create mode 100644 testing/web-platform/tests/html/browsers/windows/resources/nested-post-to-opener.html create mode 100644 testing/web-platform/tests/html/browsers/windows/resources/noreferrer-window-name.html create mode 100644 testing/web-platform/tests/html/browsers/windows/resources/opener-cross-origin-embed.sub.html create mode 100644 testing/web-platform/tests/html/browsers/windows/resources/opener-cross-origin-end.txt create mode 100644 testing/web-platform/tests/html/browsers/windows/resources/opener-cross-origin.html create mode 100644 testing/web-platform/tests/html/browsers/windows/resources/post-to-opener.html create mode 100644 testing/web-platform/tests/html/browsers/windows/resources/restore-window-name-back.sub.html create mode 100644 testing/web-platform/tests/html/browsers/windows/resources/restore-window-name.sub.html create mode 100644 testing/web-platform/tests/html/browsers/windows/resources/target-cross-origin.sub.html create mode 100644 testing/web-platform/tests/html/browsers/windows/resources/window-close-button.html create mode 100644 testing/web-platform/tests/html/browsers/windows/resources/window-name-stash.py create mode 100644 testing/web-platform/tests/html/browsers/windows/resources/window-name.sub.html create mode 100644 testing/web-platform/tests/html/browsers/windows/resources/window-opener.html create mode 100644 testing/web-platform/tests/html/browsers/windows/restore-window-name-manual.https.html create mode 100644 testing/web-platform/tests/html/browsers/windows/targeting-cross-origin-nested-browsing-contexts.html create mode 100644 testing/web-platform/tests/html/browsers/windows/targeting-multiple-cross-origin-manual.sub.html create mode 100644 testing/web-platform/tests/html/browsers/windows/targeting-with-embedded-null-in-target.html (limited to 'testing/web-platform/tests/html/browsers') diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/README.md b/testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/README.md new file mode 100644 index 0000000000..afda8f6c8a --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/README.md @@ -0,0 +1,60 @@ +# How to write back-forward cache tests + +In the back-forward cache tests, the main test HTML usually: + +1. Opens new executor Windows using `window.open()` + `noopener` option, + because less isolated Windows (e.g. iframes and `window.open()` without + `noopener` option) are often not eligible for back-forward cache (e.g. + in Chromium). +2. Injects scripts to the executor Windows and receives the results via + `RemoteContext.execute_script()` by + [/common/dispatcher](../../../../common/dispatcher/README.md). + Follow the semantics and guideline described there. + +Back-forward cache specific helpers are in: + +- [resources/executor.html](resources/executor.html): + The BFCache-specific executor and contains helpers for executors. +- [resources/helper.sub.js](resources/helper.sub.js): + Helpers for main test HTMLs. + +We must ensure that injected scripts are evaluated only after page load +(more precisely, the first `pageshow` event) and not during navigation, +to prevent unexpected interference between injected scripts, in-flight fetch +requests behind `RemoteContext.execute_script()`, navigation and back-forward +cache. To ensure this, + +- Call `await remoteContext.execute_script(waitForPageShow)` before any + other scripts are injected to the remote context, and +- Call `prepareNavigation(callback)` synchronously from the script injected + by `RemoteContext.execute_script()`, and trigger navigation on or after the + callback is called. + +In typical A-B-A scenarios (where we navigate from Page A to Page B and then +navigate back to Page A, assuming Page A is (or isn't) in BFCache), + +- Call `prepareNavigation()` on the executor, and then navigate to B, and then + navigate back to Page A. +- Call `assert_bfcached()` or `assert_not_bfcached()` on the main test HTML, to + check the BFCache status. This is important to do to ensure the test would + not fail normally and instead result in `PRECONDITION_FAILED` if the page is + unexpectedly bfcached/not bfcached. +- Check other test expectations on the main test HTML, + +as in [events.html](./events.html) and `runEventTest()` in +[resources/helper.sub.js](resources/helper.sub.js). + +# Asserting PRECONDITION_FAILED for unexpected BFCache eligibility + +Browsers are not actually obliged to put pages in BFCache after navigations, so +BFCache WPTs shouldn't result in `FAILED` if it expects a certain case to be +supported by BFCache. But, it is still useful to test those cases in the +browsers that do support BFCache for that case. + +To distinguish genuine failures from just not using BFCache, we use +`assert_bfcached()` and `assert_not_bfcached()` which result in +`PRECONDITION_FAILED` rather than `FAILED`. that should be put in the +expectations for the failing tests (instead of marking it as `FAILED` or +skipping the test). This means if the test starts passing (e.g. if we start +BFCaching in the case being tested), we will notice that the output changed from +`PRECONDITION_FAILED` to `PASS`. diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/eligibility/broadcast-channel.html b/testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/eligibility/broadcast-channel.html new file mode 100644 index 0000000000..bc04a5ed7f --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/eligibility/broadcast-channel.html @@ -0,0 +1,23 @@ + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/eligibility/dedicated-worker.html b/testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/eligibility/dedicated-worker.html new file mode 100644 index 0000000000..b08588a8bd --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/eligibility/dedicated-worker.html @@ -0,0 +1,25 @@ + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/eligibility/inflight-fetch-1.html b/testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/eligibility/inflight-fetch-1.html new file mode 100644 index 0000000000..6a48d0657b --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/eligibility/inflight-fetch-1.html @@ -0,0 +1,18 @@ + + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/eligibility/inflight-fetch-2.html b/testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/eligibility/inflight-fetch-2.html new file mode 100644 index 0000000000..a767c4fa83 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/eligibility/inflight-fetch-2.html @@ -0,0 +1,22 @@ + + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/eligibility/inflight-fetch-cors.html b/testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/eligibility/inflight-fetch-cors.html new file mode 100644 index 0000000000..c04089a5e2 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/eligibility/inflight-fetch-cors.html @@ -0,0 +1,18 @@ + + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/eligibility/inflight-fetch-redirects.html b/testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/eligibility/inflight-fetch-redirects.html new file mode 100644 index 0000000000..b0b49d5f12 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/eligibility/inflight-fetch-redirects.html @@ -0,0 +1,34 @@ + + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/eligibility/shared-worker.html b/testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/eligibility/shared-worker.html new file mode 100644 index 0000000000..77139fd08a --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/eligibility/shared-worker.html @@ -0,0 +1,25 @@ + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/events.html b/testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/events.html new file mode 100644 index 0000000000..4b1d3e408e --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/events.html @@ -0,0 +1,44 @@ + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/focus.html b/testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/focus.html new file mode 100644 index 0000000000..3901a5417d --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/focus.html @@ -0,0 +1,73 @@ + + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/pushstate.https.html b/testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/pushstate.https.html new file mode 100644 index 0000000000..218562254a --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/pushstate.https.html @@ -0,0 +1,63 @@ + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/resources/echo-worker.js b/testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/resources/echo-worker.js new file mode 100644 index 0000000000..3e3ecb52e9 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/resources/echo-worker.js @@ -0,0 +1,16 @@ +// On receiving a message from the parent Document, send back a message to the +// parent Document. This is used to wait for worker initialization and test +// that this worker is alive and working. + +// For dedicated workers. +self.addEventListener('message', event => { + postMessage(event.data); +}); + +// For shared workers. +onconnect = e => { + const port = e.ports[0]; + port.onmessage = event => { + port.postMessage(event.data); + } +}; diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/resources/event-recorder.js b/testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/resources/event-recorder.js new file mode 100644 index 0000000000..469286a399 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/resources/event-recorder.js @@ -0,0 +1,54 @@ +// Recording events + +const params = new URLSearchParams(window.location.search); +const uuid = params.get('uuid'); + +// The recorded events are stored in localStorage rather than global variables +// to catch events fired just before navigating out. +function getPushedItems(key) { + return JSON.parse(localStorage.getItem(key) || '[]'); +} + +function pushItem(key, value) { + const array = getPushedItems(key); + array.push(value); + localStorage.setItem(key, JSON.stringify(array)); +} + +window.recordEvent = function(eventName) { + pushItem(uuid + '.observedEvents', eventName); +} + +window.getRecordedEvents = function() { + return getPushedItems(uuid + '.observedEvents'); +} + +// Records events fired on `window` and `document`, with names listed in +// `eventNames`. +function startRecordingEvents(eventNames) { + for (const eventName of eventNames) { + window.addEventListener(eventName, event => { + let result = eventName; + if (event.persisted) { + result += '.persisted'; + } + if (eventName === 'visibilitychange') { + result += '.' + document.visibilityState; + } + recordEvent('window.' + result); + }); + document.addEventListener(eventName, () => { + let result = eventName; + if (eventName === 'visibilitychange') { + result += '.' + document.visibilityState; + } + recordEvent('document.' + result); + }); + } +} + +// When a comma-separated list of event names are given as the `events` +// parameter in the URL, start record the events of the given names. +if (params.get('events')) { + startRecordingEvents(params.get('events').split(',')); +} diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/resources/executor-pushstate.html b/testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/resources/executor-pushstate.html new file mode 100644 index 0000000000..dcf4a798d0 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/resources/executor-pushstate.html @@ -0,0 +1,13 @@ + + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/resources/executor.html b/testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/resources/executor.html new file mode 100644 index 0000000000..2d118bbe2b --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/resources/executor.html @@ -0,0 +1,5 @@ + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/resources/executor.js b/testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/resources/executor.js new file mode 100644 index 0000000000..67ce068130 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/resources/executor.js @@ -0,0 +1,64 @@ +const params = new URLSearchParams(window.location.search); +const uuid = params.get('uuid'); + +// Executor and BFCache detection + +// When navigating out from this page, always call +// `prepareNavigation(callback)` synchronously from the script injected by +// `RemoteContext.execute_script()`, and trigger navigation on or after the +// callback is called. +// prepareNavigation() suspends task polling and avoid in-flight fetch +// requests during navigation that might evict the page from BFCache. +// +// When we navigate to the page again, task polling is resumed, either +// - (BFCache cases) when the pageshow event listener added by +// prepareNavigation() is executed, or +// - (Non-BFCache cases) when `Executor.execute()` is called again during +// non-BFCache page loading. +// +// In such scenarios, `assert_bfcached()` etc. in `helper.sub.js` can determine +// whether the page is restored from BFCache or not, by observing +// - `isPageshowFired`: whether the pageshow event listener added by the +// prepareNavigation() before navigating out, and +// - `loadCount`: whether this inline script is evaluated again. +// - `isPageshowPersisted` is used to assert that `event.persisted` is true +// when restored from BFCache. + +window.isPageshowFired = false; +window.isPageshowPersisted = null; +window.loadCount = parseInt(localStorage.getItem(uuid + '.loadCount') || '0') + 1; +localStorage.setItem(uuid + '.loadCount', loadCount); + +window.pageShowPromise = new Promise(resolve => + window.addEventListener('pageshow', resolve, {once: true})); + +const executor = new Executor(uuid); + +window.prepareNavigation = function(callback) { + window.addEventListener( + 'pageshow', + (event) => { + window.isPageshowFired = true; + window.isPageshowPersisted = event.persisted; + executor.resume(); + }, + {once: true}); + executor.suspend(callback); +} + +// Try to disable BFCache by acquiring and never releasing a Web Lock. +// This requires HTTPS. +// Note: This is a workaround depending on non-specified WebLock+BFCache +// behavior, and doesn't work on Safari. We might want to introduce a +// test-only BFCache-disabling API instead in the future. +// https://github.com/web-platform-tests/wpt/issues/16359#issuecomment-795004780 +// https://crbug.com/1298336 +window.disableBFCache = () => { + return new Promise(resolve => { + // Use page's UUID as a unique lock name. + navigator.locks.request(uuid, () => { + resolve(); + return new Promise(() => {}); + }); + }); +}; diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/resources/helper.sub.js b/testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/resources/helper.sub.js new file mode 100644 index 0000000000..a1d18d108e --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/resources/helper.sub.js @@ -0,0 +1,229 @@ +// Helpers called on the main test HTMLs. +// Functions in `RemoteContext.execute_script()`'s 1st argument are evaluated +// on the executors (`executor.html`), and helpers available on the executors +// are defined in `executor.html`. + +const originSameOrigin = + location.protocol === 'http:' ? + 'http://{{host}}:{{ports[http][0]}}' : + 'https://{{host}}:{{ports[https][0]}}'; +const originSameSite = + location.protocol === 'http:' ? + 'http://{{host}}:{{ports[http][1]}}' : + 'https://{{host}}:{{ports[https][1]}}'; +const originCrossSite = + location.protocol === 'http:' ? + 'http://{{hosts[alt][www]}}:{{ports[http][0]}}' : + 'https://{{hosts[alt][www]}}:{{ports[https][0]}}'; + +const executorPath = + '/html/browsers/browsing-the-web/back-forward-cache/resources/executor.html?uuid='; + +// Asserts that the executor `target` is (or isn't, respectively) +// restored from BFCache. These should be used in the following fashion: +// 1. Call prepareNavigation() on the executor `target`. +// 2. Navigate the executor to another page. +// 3. Navigate back to the executor `target`. +// 4. Call assert_bfcached() or assert_not_bfcached() on the main test HTML. +async function assert_bfcached(target) { + const status = await getBFCachedStatus(target); + assert_implements_optional(status === 'BFCached', + "Could have been BFCached but actually wasn't"); +} + +async function assert_not_bfcached(target) { + const status = await getBFCachedStatus(target); + assert_implements(status !== 'BFCached', + 'Should not be BFCached but actually was'); +} + +async function getBFCachedStatus(target) { + const [loadCount, isPageshowFired, isPageshowPersisted] = + await target.execute_script(() => [ + window.loadCount, window.isPageshowFired, window.isPageshowPersisted]); + + if (loadCount === 1 && isPageshowFired === true && + isPageshowPersisted === true) { + return 'BFCached'; + } else if (loadCount === 2 && isPageshowFired === false) { + return 'Not BFCached'; + } else { + // This can occur for example when this is called before first navigating + // away (loadCount = 1, isPageshowFired = false), e.g. when + // 1. sending a script for navigation and then + // 2. calling getBFCachedStatus() without waiting for the completion of + // the script on the `target` page. + assert_unreached( + `Got unexpected BFCache status: loadCount = ${loadCount}, ` + + `isPageshowFired = ${isPageshowFired}, ` + + `isPageshowPersisted = ${isPageshowPersisted}`); + } +} + +// Always call `await remoteContext.execute_script(waitForPageShow);` after +// triggering to navigation to the page, to wait for pageshow event on the +// remote context. +const waitForPageShow = () => window.pageShowPromise; + +// Run a test that navigates A->B->A: +// 1. Page A is opened by `params.openFunc(url)`. +// 2. `params.funcBeforeNavigation(params.argsBeforeNavigation)` is executed +// on page A. +// 3. The window is navigated to page B on `params.targetOrigin`. +// 4. The window is back navigated to page A (expecting BFCached). +// +// Events `params.events` (an array of strings) are observed on page A and +// `params.expectedEvents` (an array of strings) is expected to be recorded. +// See `event-recorder.js` for event recording. +// +// Parameters can be omitted. See `defaultParams` below for default. +function runEventTest(params, description) { + const defaultParams = { + openFunc(url) { + window.open( + `${url}&events=${this.events.join(',')}`, + '_blank', + 'noopener' + ) + }, + events: ['pagehide', 'pageshow', 'load'], + expectedEvents: [ + 'window.load', + 'window.pageshow', + 'window.pagehide.persisted', + 'window.pageshow.persisted' + ], + async funcAfterAssertion(pageA) { + assert_array_equals( + await pageA.execute_script(() => getRecordedEvents()), + this.expectedEvents); + } + } + // Apply defaults. + params = { ...defaultParams, ...params }; + + runBfcacheTest(params, description); +} + +async function navigateAndThenBack(pageA, pageB, urlB, + funcBeforeBackNavigation, + argsBeforeBackNavigation) { + await pageA.execute_script( + (url) => { + prepareNavigation(() => { + location.href = url; + }); + }, + [urlB] + ); + + await pageB.execute_script(waitForPageShow); + if (funcBeforeBackNavigation) { + await pageB.execute_script(funcBeforeBackNavigation, + argsBeforeBackNavigation); + } + await pageB.execute_script( + () => { + prepareNavigation(() => { history.back(); }); + } + ); + + await pageA.execute_script(waitForPageShow); +} + +function runBfcacheTest(params, description) { + const defaultParams = { + openFunc: url => window.open(url, '_blank', 'noopener'), + scripts: [], + funcBeforeNavigation: () => {}, + argsBeforeNavigation: [], + targetOrigin: originCrossSite, + funcBeforeBackNavigation: () => {}, + argsBeforeBackNavigation: [], + shouldBeCached: true, + funcAfterAssertion: () => {}, + } + // Apply defaults. + params = {...defaultParams, ...params }; + + promise_test(async t => { + const pageA = new RemoteContext(token()); + const pageB = new RemoteContext(token()); + + const urlA = executorPath + pageA.context_id; + const urlB = params.targetOrigin + executorPath + pageB.context_id; + + // So that tests can refer to these URLs for assertions if necessary. + pageA.url = originSameOrigin + urlA; + pageB.url = urlB; + + params.openFunc(urlA); + + await pageA.execute_script(waitForPageShow); + + for (const src of params.scripts) { + await pageA.execute_script((src) => { + const script = document.createElement("script"); + script.src = src; + document.head.append(script); + return new Promise(resolve => script.onload = resolve); + }, [src]); + } + + await pageA.execute_script(params.funcBeforeNavigation, + params.argsBeforeNavigation); + await navigateAndThenBack(pageA, pageB, urlB, + params.funcBeforeBackNavigation, + params.argsBeforeBackNavigation); + + if (params.shouldBeCached) { + await assert_bfcached(pageA); + } else { + await assert_not_bfcached(pageA); + } + + if (params.funcAfterAssertion) { + await params.funcAfterAssertion(pageA, pageB, t); + } + }, description); +} + +// Call clients.claim() on the service worker +async function claim(t, worker) { + const channel = new MessageChannel(); + const saw_message = new Promise(function(resolve) { + channel.port1.onmessage = t.step_func(function(e) { + assert_equals(e.data, 'PASS', 'Worker call to claim() should fulfill.'); + resolve(); + }); + }); + worker.postMessage({type: "claim", port: channel.port2}, [channel.port2]); + await saw_message; +} + +// Assigns the current client to a local variable on the service worker. +async function storeClients(t, worker) { + const channel = new MessageChannel(); + const saw_message = new Promise(function(resolve) { + channel.port1.onmessage = t.step_func(function(e) { + assert_equals(e.data, 'PASS', 'storeClients'); + resolve(); + }); + }); + worker.postMessage({type: "storeClients", port: channel.port2}, [channel.port2]); + await saw_message; +} + +// Call storedClients.postMessage("") on the service worker +async function postMessageToStoredClients(t, worker) { + const channel = new MessageChannel(); + const saw_message = new Promise(function(resolve) { + channel.port1.onmessage = t.step_func(function(e) { + assert_equals(e.data, 'PASS', 'postMessageToStoredClients'); + resolve(); + }); + }); + worker.postMessage({type: "postMessageToStoredClients", + port: channel.port2}, [channel.port2]); + await saw_message; +} diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/resources/inflight-fetch-helper.js b/testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/resources/inflight-fetch-helper.js new file mode 100644 index 0000000000..7832003b76 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/resources/inflight-fetch-helper.js @@ -0,0 +1,47 @@ +// Delay after fetch start: +// - 0.0 seconds: before BFCache +// - 2.0 seconds: when in BFCache +// - 3.5 seconds: after restored from BFCache +function runTest(urlToFetch, hasCSP, shouldSucceed, description) { + runBfcacheTest({ + funcBeforeNavigation: async (urlToFetch, hasCSP) => { + if (hasCSP) { + // Set CSP. + const meta = document.createElement('meta'); + meta.setAttribute('http-equiv', 'Content-Security-Policy'); + meta.setAttribute('content', "connect-src 'self'"); + document.head.appendChild(meta); + } + + // Initiate a `fetch()`. + window.fetchPromise = fetch(urlToFetch); + + // Wait for 0.5 seconds to receive response headers for the fetch() + // before BFCache, if any. + await new Promise(resolve => setTimeout(resolve, 500)); + }, + argsBeforeNavigation: [urlToFetch, hasCSP], + funcBeforeBackNavigation: () => { + // Wait for 2 seconds before back navigating to pageA. + return new Promise(resolve => setTimeout(resolve, 2000)); + }, + funcAfterAssertion: async (pageA, pageB, t) => { + // Wait for fetch() completion and check the result. + const result = pageA.execute_script( + () => window.fetchPromise.then(r => r.text())); + if (shouldSucceed) { + assert_equals( + await result, + 'Body', + 'Fetch should complete successfully after restored from BFCache'); + } else { + await promise_rejects_js(t, TypeError, result, + 'Fetch should fail after restored from BFCache'); + } + } + }, 'Eligibility (in-flight fetch): ' + description); +} + +const url = new URL('../resources/slow.py', location); +const sameOriginUrl = url.href; +const crossSiteUrl = originCrossSite + url.pathname; diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/resources/rc-helper.js b/testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/resources/rc-helper.js new file mode 100644 index 0000000000..80c164f560 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/resources/rc-helper.js @@ -0,0 +1,137 @@ +// A collection of helper functions that make use of the `remoteContextHelper` +// to test BFCache support and behavior. + +// Call `prepareForBFCache()` before navigating away from the page. This simply +// sets a variable in window. +async function prepareForBFCache(remoteContextHelper) { + await remoteContextHelper.executeScript(() => { + window.beforeBFCache = true; + }); +} + +// Call `getBeforeCache()` after navigating back to the page. This returns the +// value in window. +async function getBeforeBFCache(remoteContextHelper) { + return await remoteContextHelper.executeScript(() => { + return window.beforeBFCache; + }); +} + +// If the value in window is set to true, this means that the page was reloaded, +// i.e., the page was restored from BFCache. +// Call `prepareForBFCache()` before navigating away to call this function. +async function assertImplementsBFCacheOptional(remoteContextHelper) { + var beforeBFCache = await getBeforeBFCache(remoteContextHelper); + assert_implements_optional(beforeBFCache == true, 'BFCache not supported.'); +} + +// Subtracts set `b` from set `a` and returns the result. +function setMinus(a, b) { + const minus = new Set(); + a.forEach(e => { + if (!b.has(e)) { + minus.add(e); + } + }); + return minus; +} + +// Return a sorted Array from the iterable `s`. +function sorted(s) { + return Array.from(s).sort(); +} + +// Assert expected reasons and the reported reasons match. +function matchReasons(expectedNotRestoredReasonsSet, notRestoredReasonsSet) { + const missing = setMinus( + expectedNotRestoredReasonsSet, notRestoredReasonsSet, 'Missing reasons'); + const extra = setMinus( + notRestoredReasonsSet, expectedNotRestoredReasonsSet, 'Extra reasons'); + assert_true(missing.size + extra.size == 0, `Expected: ${sorted(expectedNotRestoredReasonsSet)}\n` + + `Got: ${sorted(notRestoredReasonsSet)}\n` + + `Missing: ${sorted(missing)}\n` + + `Extra: ${sorted(extra)}\n`); +} + +// This function takes a set of reasons and extracts reasons out of it and returns a set of strings. +// For example, if the input is [{"reason": "error-document"}, {"reason": "masked"}], +// the output is ["error-document", "masked"]. +function extractReason(reasonSet) { + let reasonsExtracted = new Set(); + for (let reason of reasonSet) { + reasonsExtracted.add(reason.reason); + } + return reasonsExtracted; +} + +// A helper function to assert that the page is not restored from BFCache by +// checking whether the `beforeBFCache` value from `window` is undefined +// due to page reload. +// This function also takes an optional `notRestoredReasons` list which +// indicates the set of expected reasons that make the page not restored. +// If the reasons list is undefined, the check will be skipped. Otherwise +// this check will use the `notRestoredReasons` API, to obtain the reasons +// in a tree structure, and flatten the reasons before making the order- +// insensitive comparison. +// If the API is not available, the function will terminate instead of marking +// the assertion failed. +// Call `prepareForBFCache()` before navigating away to call this function. +async function assertNotRestoredFromBFCache( + remoteContextHelper, notRestoredReasons) { + var beforeBFCache = await getBeforeBFCache(remoteContextHelper); + assert_equals(beforeBFCache, undefined, 'document unexpectedly BFCached'); + + // The reason is optional, so skip the remaining test if the + // `notRestoredReasons` is not set. + if (notRestoredReasons === undefined) { + return; + } + + let isFeatureEnabled = await remoteContextHelper.executeScript(() => { + return 'notRestoredReasons' in + performance.getEntriesByType('navigation')[0]; + }); + + // Return if the `notRestoredReasons` API is not available. + if (!isFeatureEnabled) { + return; + } + + let result = await remoteContextHelper.executeScript(() => { + return performance.getEntriesByType('navigation')[0].notRestoredReasons; + }); + + let expectedNotRestoredReasonsSet = new Set(notRestoredReasons); + let notRestoredReasonsSet = new Set(); + + // Flatten the reasons from the main frame and all the child frames. + const collectReason = (node) => { + for (let reason of node.reasons) { + notRestoredReasonsSet.add(reason.reason); + } + for (let child of node.children) { + collectReason(child); + } + }; + collectReason(result); + matchReasons(expectedNotRestoredReasonsSet, notRestoredReasonsSet); +} + +// A helper function that combines the steps of setting window property, +// navigating away and back, and making assertion on whether BFCache is +// supported. +// This function can be used to check if the current page is eligible for +// BFCache. +async function assertBFCacheEligibility( + remoteContextHelper, shouldRestoreFromBFCache) { + await prepareForBFCache(remoteContextHelper); + // Navigate away and back. + const newRemoteContextHelper = await remoteContextHelper.navigateToNew(); + await newRemoteContextHelper.historyBack(); + + if (shouldRestoreFromBFCache) { + await assertImplementsBFCacheOptional(remoteContextHelper); + } else { + await assertNotRestoredFromBFCache(remoteContextHelper); + } +} diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/resources/service-worker.js b/testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/resources/service-worker.js new file mode 100644 index 0000000000..ab9a3239ea --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/resources/service-worker.js @@ -0,0 +1,58 @@ +self.addEventListener('message', function(event) { + if (event.data.type == "claim") { + self.clients.claim() + .then(function(result) { + if (result !== undefined) { + event.data.port.postMessage( + 'FAIL: claim() should be resolved with undefined'); + return; + } + event.data.port.postMessage('PASS'); + }) + .catch(function(error) { + event.data.port.postMessage('FAIL: exception: ' + error.name); + }); + } else if (event.data.type == "storeClients") { + self.clients.matchAll() + .then(function(result) { + self.storedClients = result; + event.data.port.postMessage("PASS"); + }); + } else if (event.data.type == "postMessageToStoredClients") { + for (let client of self.storedClients) { + client.postMessage("dummyValue"); + } + event.data.port.postMessage("PASS"); + } else if (event.data.type == 'storeMessagePort') { + let isCloseEventFired = false; + const port = event.ports[0]; + port.start(); + port.onmessage = (event) => { + if (event.data == 'Confirm the ports can communicate') { + port.postMessage('Receive message'); + } else if (event.data == 'Ask if the close event was fired') { + port.postMessage(isCloseEventFired); + } + }; + port.onclose = () => { + isCloseEventFired = true; + }; + } + }); + +self.addEventListener('fetch', e => { + if (e.request.url.match(/\/is-controlled/)) { + e.respondWith(new Response('controlled')); + } + else if (e.request.url.match(/\/get-clients-matchall/)) { + const options = { includeUncontrolled: true, type: 'all' }; + e.respondWith( + self.clients.matchAll(options) + .then(clients => { + const client_urls = []; + clients.forEach(client => client_urls.push(client.url)); + return new Response(JSON.stringify(client_urls)); + }) + ); + } + }); diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/resources/slow.py b/testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/resources/slow.py new file mode 100644 index 0000000000..01bb3309b1 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/resources/slow.py @@ -0,0 +1,13 @@ +import time + +def main(request, response): + delay_before_header = float(request.GET.first(b"delayBeforeHeader", 0)) / 1000 + delay_before_body = float(request.GET.first(b"delayBeforeBody", 0)) / 1000 + + time.sleep(delay_before_header) + if b"cors" in request.GET: + response.headers.set(b"Access-Control-Allow-Origin", b"*") + response.write_status_headers() + + time.sleep(delay_before_body) + response.writer.write_content(b"Body") diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/resources/worker-helper.js b/testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/resources/worker-helper.js new file mode 100644 index 0000000000..d5f3a0c814 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/resources/worker-helper.js @@ -0,0 +1,28 @@ +// Worker-related helper file to be used from executor.html. + +// The class `WorkerHelper` is exposed to `globalThis` because this should be +// used via `eval()`. +globalThis.WorkerHelper = class { + static pingWorker(worker) { + return new Promise((resolve, reject) => { + const message = 'message ' + Math.random(); + const onmessage = e => { + if (e.data === message) { + resolve('PASS'); + } else { + reject('pingWorker: expected ' + message + ' but got ' + e.data); + } + }; + worker.onerror = reject; + if (worker instanceof Worker) { + worker.addEventListener('message', onmessage, {once: true}); + worker.postMessage(message); + } else if (worker instanceof SharedWorker) { + worker.port.onmessage = onmessage; + worker.port.postMessage(message); + } else { + reject('Unexpected worker type'); + } + }); + } +}; diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/service-worker-client-postmessage.https.html b/testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/service-worker-client-postmessage.https.html new file mode 100644 index 0000000000..acc682a073 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/service-worker-client-postmessage.https.html @@ -0,0 +1,71 @@ + + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/service-worker-clients-claim.https.html b/testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/service-worker-clients-claim.https.html new file mode 100644 index 0000000000..d9540c221b --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/service-worker-clients-claim.https.html @@ -0,0 +1,71 @@ + + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/service-worker-clients-matchall.https.html b/testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/service-worker-clients-matchall.https.html new file mode 100644 index 0000000000..069529dbe4 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/service-worker-clients-matchall.https.html @@ -0,0 +1,76 @@ + + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/service-worker-controlled-after-restore.https.html b/testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/service-worker-controlled-after-restore.https.html new file mode 100644 index 0000000000..a937eb85ac --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/service-worker-controlled-after-restore.https.html @@ -0,0 +1,54 @@ + + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/service-worker-unregister.https.html b/testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/service-worker-unregister.https.html new file mode 100644 index 0000000000..1c3f81153c --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/service-worker-unregister.https.html @@ -0,0 +1,67 @@ + + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/storage-events.html b/testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/storage-events.html new file mode 100644 index 0000000000..6957496c30 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/storage-events.html @@ -0,0 +1,101 @@ + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/timers.html b/testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/timers.html new file mode 100644 index 0000000000..aab650f36e --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/back-forward-cache/timers.html @@ -0,0 +1,68 @@ + + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/001-1.html b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/001-1.html new file mode 100644 index 0000000000..cadcf126f5 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/001-1.html @@ -0,0 +1,11 @@ + +001-1 + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/001-2.html b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/001-2.html new file mode 100644 index 0000000000..6387bc89c8 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/001-2.html @@ -0,0 +1,5 @@ + +001-2 + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/001.html b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/001.html new file mode 100644 index 0000000000..336ede4cb6 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/001.html @@ -0,0 +1,35 @@ + +pageshow event from traversal + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/PopStateEvent.html b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/PopStateEvent.html new file mode 100644 index 0000000000..9ee7576249 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/PopStateEvent.html @@ -0,0 +1,47 @@ + + +Synthetic popstate events + + +
+ diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/api-availability.html b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/api-availability.html new file mode 100644 index 0000000000..2f7d3fafdf --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/api-availability.html @@ -0,0 +1,22 @@ + +API availability following history traversal + + + +

Test requires popup blocker disabled

+
+ diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/browsing_context_name-0.html b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/browsing_context_name-0.html new file mode 100644 index 0000000000..5cbab71a5e --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/browsing_context_name-0.html @@ -0,0 +1,35 @@ + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/browsing_context_name-1.html b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/browsing_context_name-1.html new file mode 100644 index 0000000000..85748a2ebc --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/browsing_context_name-1.html @@ -0,0 +1,6 @@ +document 1 + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/browsing_context_name-2.html b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/browsing_context_name-2.html new file mode 100644 index 0000000000..b0c869046b --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/browsing_context_name-2.html @@ -0,0 +1,4 @@ +document 2 + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/browsing_context_name-3.html b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/browsing_context_name-3.html new file mode 100644 index 0000000000..e0c239744f --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/browsing_context_name-3.html @@ -0,0 +1,6 @@ +document 3 + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/browsing_context_name-4.html b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/browsing_context_name-4.html new file mode 100644 index 0000000000..5d2dfa6bb8 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/browsing_context_name-4.html @@ -0,0 +1,6 @@ +document 4 + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/browsing_context_name.html b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/browsing_context_name.html new file mode 100644 index 0000000000..60a8acb098 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/browsing_context_name.html @@ -0,0 +1,13 @@ + +Retaining window.name on history traversal + + +

+
+
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/browsing_context_name_cross_origin-0.html b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/browsing_context_name_cross_origin-0.html
new file mode 100644
index 0000000000..9e91722714
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/browsing_context_name_cross_origin-0.html
@@ -0,0 +1,34 @@
+
+
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/browsing_context_name_cross_origin.html b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/browsing_context_name_cross_origin.html
new file mode 100644
index 0000000000..caa0bce3eb
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/browsing_context_name_cross_origin.html
@@ -0,0 +1,13 @@
+
+Restoring window.name on cross-origin history traversal
+
+
+

+
+
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/browsing_context_name_cross_origin_2.html b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/browsing_context_name_cross_origin_2.html
new file mode 100644
index 0000000000..8202a892a3
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/browsing_context_name_cross_origin_2.html
@@ -0,0 +1,43 @@
+
+Restoring window.name on cross-origin history traversal
+
+
+
+

+
+
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/browsing_context_name_cross_origin_3.html b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/browsing_context_name_cross_origin_3.html
new file mode 100644
index 0000000000..b6a35680dd
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/browsing_context_name_cross_origin_3.html
@@ -0,0 +1,44 @@
+
+Restoring window.name on cross-origin history traversal
+
+
+
+

+
+
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/document-state.https.html b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/document-state.https.html
new file mode 100644
index 0000000000..f03efc3b65
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/document-state.https.html
@@ -0,0 +1,133 @@
+
+
+Test the properties of a session history entry's document state
+
+
+
+
+
+
+
+
+
+
+
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/event-order/after-load-hash-twice.html b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/event-order/after-load-hash-twice.html
new file mode 100644
index 0000000000..75889ef517
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/event-order/after-load-hash-twice.html
@@ -0,0 +1,38 @@
+
+
+Popstate/hashchange/load event ordering
+
+
+
+
+
+
+
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/event-order/after-load-hash.html b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/event-order/after-load-hash.html
new file mode 100644
index 0000000000..f74d716d91
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/event-order/after-load-hash.html
@@ -0,0 +1,32 @@
+
+
+Popstate/hashchange/load event ordering
+
+
+
+
+
+
+
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/event-order/after-load-pushState.html b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/event-order/after-load-pushState.html
new file mode 100644
index 0000000000..4f9f3dad47
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/event-order/after-load-pushState.html
@@ -0,0 +1,31 @@
+
+
+Popstate/hashchange/load event ordering
+
+
+
+
+
+
+
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/event-order/after-load-replaceState.html b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/event-order/after-load-replaceState.html
new file mode 100644
index 0000000000..28148ff7b2
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/event-order/after-load-replaceState.html
@@ -0,0 +1,30 @@
+
+
+Popstate/hashchange/load event ordering
+
+
+
+
+
+
+
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/event-order/before-load-hash-twice.html b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/event-order/before-load-hash-twice.html
new file mode 100644
index 0000000000..7c8df11843
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/event-order/before-load-hash-twice.html
@@ -0,0 +1,29 @@
+
+
+Popstate/hashchange/load event ordering
+
+
+
+
+
+
+
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/event-order/before-load-hash.html b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/event-order/before-load-hash.html
new file mode 100644
index 0000000000..97c4636fad
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/event-order/before-load-hash.html
@@ -0,0 +1,27 @@
+
+
+Popstate/hashchange/load event ordering
+
+
+
+
+
+
+
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/event-order/before-load-pushState.html b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/event-order/before-load-pushState.html
new file mode 100644
index 0000000000..a08afa474f
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/event-order/before-load-pushState.html
@@ -0,0 +1,28 @@
+
+
+Popstate/hashchange/load event ordering
+
+
+
+
+
+
+
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/event-order/before-load-replaceState.html b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/event-order/before-load-replaceState.html
new file mode 100644
index 0000000000..10d30038fb
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/event-order/before-load-replaceState.html
@@ -0,0 +1,26 @@
+
+
+Popstate/hashchange/load event ordering
+
+
+
+
+
+
+
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/event-order/pushState-inside-popstate.html b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/event-order/pushState-inside-popstate.html
new file mode 100644
index 0000000000..35ada116ed
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/event-order/pushState-inside-popstate.html
@@ -0,0 +1,16 @@
+
+
+
+
+
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/event-order/same-document-traverse-immediate.html b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/event-order/same-document-traverse-immediate.html
new file mode 100644
index 0000000000..51ea20b289
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/event-order/same-document-traverse-immediate.html
@@ -0,0 +1,38 @@
+
+
+Popstate/hashchange/load event ordering
+
+
+
+
+
+
+
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/event-order/same-document-traverse-wait.html b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/event-order/same-document-traverse-wait.html
new file mode 100644
index 0000000000..39bc760ff7
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/event-order/same-document-traverse-wait.html
@@ -0,0 +1,39 @@
+
+
+Popstate/hashchange/load event ordering
+
+
+
+
+
+
+
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/events.html b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/events.html
new file mode 100644
index 0000000000..d5ff83fac0
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/events.html
@@ -0,0 +1,151 @@
+
+ PageTransitionEffect Event 
+
+
+
+ diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/hashchange_event.html b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/hashchange_event.html new file mode 100644 index 0000000000..b7111255f8 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/hashchange_event.html @@ -0,0 +1,49 @@ + +Queue a task to fire hashchange event + + +
+ diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/history-traversal-navigate-parent-while-child-loading.html b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/history-traversal-navigate-parent-while-child-loading.html new file mode 100644 index 0000000000..2b70375a14 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/history-traversal-navigate-parent-while-child-loading.html @@ -0,0 +1,30 @@ + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/history-traversal-navigates-multiple-frames.html b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/history-traversal-navigates-multiple-frames.html new file mode 100644 index 0000000000..4f2429fbfd --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/history-traversal-navigates-multiple-frames.html @@ -0,0 +1,29 @@ + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/pagereveal/order-in-bfcache-restore.html b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/pagereveal/order-in-bfcache-restore.html new file mode 100644 index 0000000000..f453c80a2a --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/pagereveal/order-in-bfcache-restore.html @@ -0,0 +1,70 @@ + +pagereveal event fires and in correct order on restoration from BFCache + + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/pagereveal/order-in-new-document-navigation.html b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/pagereveal/order-in-new-document-navigation.html new file mode 100644 index 0000000000..d2c44511d3 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/pagereveal/order-in-new-document-navigation.html @@ -0,0 +1,18 @@ + +pagereveal event fires and in correct order on new-document navigation + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/pagereveal/order-in-prerender-activation.html b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/pagereveal/order-in-prerender-activation.html new file mode 100644 index 0000000000..b281b2b088 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/pagereveal/order-in-prerender-activation.html @@ -0,0 +1,40 @@ + +pagereveal event fires and in correct order on prerender activation + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/pagereveal/resources/order-in-prerender-activation-popup.html b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/pagereveal/resources/order-in-prerender-activation-popup.html new file mode 100644 index 0000000000..78989adc17 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/pagereveal/resources/order-in-prerender-activation-popup.html @@ -0,0 +1,74 @@ + +pagereveal event fires and in correct order on prerender activation (popup) + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/persisted-user-state-restoration/resources/blank1.html b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/persisted-user-state-restoration/resources/blank1.html new file mode 100644 index 0000000000..6b4df1ef2f --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/persisted-user-state-restoration/resources/blank1.html @@ -0,0 +1,8 @@ + + + Blank 1 \ No newline at end of file diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/persisted-user-state-restoration/resources/blank2.html b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/persisted-user-state-restoration/resources/blank2.html new file mode 100644 index 0000000000..def2139667 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/persisted-user-state-restoration/resources/blank2.html @@ -0,0 +1,8 @@ + + + Blank 2 diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/persisted-user-state-restoration/resources/page-with-fragment.html b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/persisted-user-state-restoration/resources/page-with-fragment.html new file mode 100644 index 0000000000..11737661d0 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/persisted-user-state-restoration/resources/page-with-fragment.html @@ -0,0 +1,20 @@ + + + +Page with fragment + + \ No newline at end of file diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/persisted-user-state-restoration/resources/post_name_on_load.html b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/persisted-user-state-restoration/resources/post_name_on_load.html new file mode 100644 index 0000000000..1e9b10d1ee --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/persisted-user-state-restoration/resources/post_name_on_load.html @@ -0,0 +1,7 @@ + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/persisted-user-state-restoration/resume-timer-on-history-back.html b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/persisted-user-state-restoration/resume-timer-on-history-back.html new file mode 100644 index 0000000000..77602b2d42 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/persisted-user-state-restoration/resume-timer-on-history-back.html @@ -0,0 +1,146 @@ + +Verify history.back() on a persisted page resumes timers + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/persisted-user-state-restoration/scroll-restoration-basic.html b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/persisted-user-state-restoration/scroll-restoration-basic.html new file mode 100644 index 0000000000..e47cd9c383 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/persisted-user-state-restoration/scroll-restoration-basic.html @@ -0,0 +1,34 @@ + +Verify existence and basic read/write function of history.scrollRestoration + + + + + + \ No newline at end of file diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/persisted-user-state-restoration/scroll-restoration-fragment-scrolling-cross-origin.html b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/persisted-user-state-restoration/scroll-restoration-fragment-scrolling-cross-origin.html new file mode 100644 index 0000000000..fec801e94b --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/persisted-user-state-restoration/scroll-restoration-fragment-scrolling-cross-origin.html @@ -0,0 +1,71 @@ + + +Precedence of scroll restoration mode over fragment scrolling in cross-origin history traversal + + + + +
+ + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/persisted-user-state-restoration/scroll-restoration-fragment-scrolling-samedoc.html b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/persisted-user-state-restoration/scroll-restoration-fragment-scrolling-samedoc.html new file mode 100644 index 0000000000..073e0f6e06 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/persisted-user-state-restoration/scroll-restoration-fragment-scrolling-samedoc.html @@ -0,0 +1,55 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/persisted-user-state-restoration/scroll-restoration-navigation-cross-origin.html b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/persisted-user-state-restoration/scroll-restoration-navigation-cross-origin.html new file mode 100644 index 0000000000..87a337b2da --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/persisted-user-state-restoration/scroll-restoration-navigation-cross-origin.html @@ -0,0 +1,71 @@ + + +Correct behaviour of scroll restoration mode is cross origin history traversal + + + + + + + + + + \ No newline at end of file diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/persisted-user-state-restoration/scroll-restoration-navigation-samedoc.html b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/persisted-user-state-restoration/scroll-restoration-navigation-samedoc.html new file mode 100644 index 0000000000..46d40eedc6 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/persisted-user-state-restoration/scroll-restoration-navigation-samedoc.html @@ -0,0 +1,81 @@ + +Correct behaviour of scroll restoration mode in same document history traversals + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/popstate_event.html b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/popstate_event.html new file mode 100644 index 0000000000..05b1dbf4b7 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/popstate_event.html @@ -0,0 +1,48 @@ + +Queue a task to fire popstate event + + +
+ diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/resources/a.html b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/resources/a.html new file mode 100644 index 0000000000..55b73e1153 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/resources/a.html @@ -0,0 +1 @@ +Welcome to A. \ No newline at end of file diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/resources/api-availability-1.html b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/resources/api-availability-1.html new file mode 100644 index 0000000000..2c31168750 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/resources/api-availability-1.html @@ -0,0 +1,31 @@ + +API availability following history traversal - 1 + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/resources/api-availability-2.html b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/resources/api-availability-2.html new file mode 100644 index 0000000000..420e5092bc --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/resources/api-availability-2.html @@ -0,0 +1,3 @@ + +API availability following history traversal - 2 + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/resources/b.html b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/resources/b.html new file mode 100644 index 0000000000..8f2fc900dd --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/resources/b.html @@ -0,0 +1 @@ +Welcome to B. \ No newline at end of file diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/resources/c.html b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/resources/c.html new file mode 100644 index 0000000000..db494e878e --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/resources/c.html @@ -0,0 +1 @@ +Welcome to C. \ No newline at end of file diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/resources/unset_context_name-1.sub.html b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/resources/unset_context_name-1.sub.html new file mode 100644 index 0000000000..97918a1f99 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/resources/unset_context_name-1.sub.html @@ -0,0 +1,45 @@ + + +window.name test helper + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/resources/unset_context_name_stash.py b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/resources/unset_context_name_stash.py new file mode 100644 index 0000000000..411a4587bc --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/resources/unset_context_name_stash.py @@ -0,0 +1,13 @@ +def main(request, response): + key = request.GET.first(b"id") + if request.method == "POST": + value = request.GET.first(b"value") + request.server.stash.take(key) + request.server.stash.put(key, value) + return b"OK" + else: + value = request.server.stash.take(key) + if value is not None: + return value + else: + return b"NONE" diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/same-url.html b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/same-url.html new file mode 100644 index 0000000000..bcca5ed90c --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/same-url.html @@ -0,0 +1,50 @@ +Test same-URL navigation and its effects on history + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/scroll-restoration-order.html b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/scroll-restoration-order.html new file mode 100644 index 0000000000..8fe7d9f977 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/scroll-restoration-order.html @@ -0,0 +1,74 @@ + + +History restoration order test + + + + + + + + \ No newline at end of file diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/srcdoc/consecutive-srcdoc.html b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/srcdoc/consecutive-srcdoc.html new file mode 100644 index 0000000000..9aab36b986 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/srcdoc/consecutive-srcdoc.html @@ -0,0 +1,85 @@ + + +changing srcdoc to a different srcdoc + + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/srcdoc/srcdoc-history-entries.html b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/srcdoc/srcdoc-history-entries.html new file mode 100644 index 0000000000..09f4094c5f --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/srcdoc/srcdoc-history-entries.html @@ -0,0 +1,95 @@ + + +srcdoc history entries + + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/support/window-name-after-cross-origin-main-frame-navigation-popup.sub.html b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/support/window-name-after-cross-origin-main-frame-navigation-popup.sub.html new file mode 100644 index 0000000000..e13d191658 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/support/window-name-after-cross-origin-main-frame-navigation-popup.sub.html @@ -0,0 +1,10 @@ + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/support/window-name-after-same-origin-main-frame-navigation-1.sub.html b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/support/window-name-after-same-origin-main-frame-navigation-1.sub.html new file mode 100644 index 0000000000..4b7824b488 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/support/window-name-after-same-origin-main-frame-navigation-1.sub.html @@ -0,0 +1,4 @@ + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/support/window-name-navigation.sub.html b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/support/window-name-navigation.sub.html new file mode 100644 index 0000000000..285469a148 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/support/window-name-navigation.sub.html @@ -0,0 +1,11 @@ + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/support/window-name-test.sub.html b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/support/window-name-test.sub.html new file mode 100644 index 0000000000..460db2e979 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/support/window-name-test.sub.html @@ -0,0 +1,23 @@ + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/unset_context_name.html b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/unset_context_name.html new file mode 100644 index 0000000000..285f6d7428 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/unset_context_name.html @@ -0,0 +1,32 @@ + +window.name is reset after navigating to a different origin + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/window-name-after-cross-origin-aux-frame-navigation.sub.html b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/window-name-after-cross-origin-aux-frame-navigation.sub.html new file mode 100644 index 0000000000..6bc64c6373 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/window-name-after-cross-origin-aux-frame-navigation.sub.html @@ -0,0 +1,17 @@ + + + + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/window-name-after-cross-origin-main-frame-navigation.sub.html b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/window-name-after-cross-origin-main-frame-navigation.sub.html new file mode 100644 index 0000000000..fb0bb1883f --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/window-name-after-cross-origin-main-frame-navigation.sub.html @@ -0,0 +1,24 @@ + + + + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/window-name-after-cross-origin-sub-frame-navigation.sub.html b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/window-name-after-cross-origin-sub-frame-navigation.sub.html new file mode 100644 index 0000000000..a309be6d80 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/window-name-after-cross-origin-sub-frame-navigation.sub.html @@ -0,0 +1,18 @@ + + + + + + + + + + + + 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..58b73494e1 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/navigating-across-documents/about-srcdoc-navigation-blocked.window.js @@ -0,0 +1,52 @@ +// 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.location = "about:srcdoc?query"; + + // See the documentation in the above test. + await Promise.race([ + t.step_wait(() => iframe.contentDocument === null), + failOnMessage(iframe.contentWindow) + ]); +}, "Navigations to about:srcdoc?query via window.location within an " + + "about:srcdoc document 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"); + + // See the documentation in the above test. + 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..d20a440d03 --- /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}")`); + }); +}); diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/README.md b/testing/web-platform/tests/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/README.md new file mode 100644 index 0000000000..cc313a155a --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/README.md @@ -0,0 +1,11 @@ +# Overlapping navigation and traversal tests + +These tests follow the behavior outlined in the +[session history rewrite](https://github.com/whatwg/html/pull/6315). + + discusses these results. + +We are not yet 100% sure on this behavior, especially for overlapping +traversal cases where the spec is complex and some of the tests don't +seem to match any browser. Please feel free to discuss on the spec +issue. diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/anchor-fragment-history-back-on-click.html b/testing/web-platform/tests/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/anchor-fragment-history-back-on-click.html new file mode 100644 index 0000000000..a081bec514 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/anchor-fragment-history-back-on-click.html @@ -0,0 +1,40 @@ + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/cross-document-nav-cross-document-nav.html b/testing/web-platform/tests/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/cross-document-nav-cross-document-nav.html new file mode 100644 index 0000000000..99d9a8fbb1 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/cross-document-nav-cross-document-nav.html @@ -0,0 +1,30 @@ + + +Cross-document navigation after a cross-document navigation + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/cross-document-nav-cross-document-traversal.html b/testing/web-platform/tests/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/cross-document-nav-cross-document-traversal.html new file mode 100644 index 0000000000..341f66a996 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/cross-document-nav-cross-document-traversal.html @@ -0,0 +1,38 @@ + + +Cross-document traversal during cross-document navigation + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/cross-document-nav-same-document-nav.html b/testing/web-platform/tests/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/cross-document-nav-same-document-nav.html new file mode 100644 index 0000000000..99525cb3ed --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/cross-document-nav-same-document-nav.html @@ -0,0 +1,44 @@ + + +Cross-document navigation after a same-document navigation + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/cross-document-nav-same-document-traversal.html b/testing/web-platform/tests/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/cross-document-nav-same-document-traversal.html new file mode 100644 index 0000000000..2ff91be7e1 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/cross-document-nav-same-document-traversal.html @@ -0,0 +1,37 @@ + + +Same-document traversal during cross-document navigation + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/cross-document-nav-stop.html b/testing/web-platform/tests/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/cross-document-nav-stop.html new file mode 100644 index 0000000000..0803d6c8d1 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/cross-document-nav-stop.html @@ -0,0 +1,21 @@ + + +Stop during cross-document navigations + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/cross-document-traversal-cross-document-nav.html b/testing/web-platform/tests/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/cross-document-traversal-cross-document-nav.html new file mode 100644 index 0000000000..5141259d08 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/cross-document-traversal-cross-document-nav.html @@ -0,0 +1,77 @@ + + +Cross-document navigations during cross-document traversals + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/cross-document-traversal-cross-document-traversal.html b/testing/web-platform/tests/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/cross-document-traversal-cross-document-traversal.html new file mode 100644 index 0000000000..97907df23d --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/cross-document-traversal-cross-document-traversal.html @@ -0,0 +1,160 @@ + + +Cross-document traversals during cross-document traversals + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/cross-document-traversal-same-document-nav.html b/testing/web-platform/tests/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/cross-document-traversal-same-document-nav.html new file mode 100644 index 0000000000..df6258f9b3 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/cross-document-traversal-same-document-nav.html @@ -0,0 +1,66 @@ + + +Same-document navigations during cross-document traversals + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/cross-document-traversal-same-document-traversal.html b/testing/web-platform/tests/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/cross-document-traversal-same-document-traversal.html new file mode 100644 index 0000000000..3c37c46b64 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/cross-document-traversal-same-document-traversal.html @@ -0,0 +1,94 @@ + + +Same-document traversals during cross-document traversals + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/cross-document-traversal-stop.html b/testing/web-platform/tests/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/cross-document-traversal-stop.html new file mode 100644 index 0000000000..6202eb9226 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/cross-document-traversal-stop.html @@ -0,0 +1,42 @@ + + +Stop during cross-document traversals + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/forward-to-pruned-entry.html b/testing/web-platform/tests/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/forward-to-pruned-entry.html new file mode 100644 index 0000000000..8e1c349e21 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/forward-to-pruned-entry.html @@ -0,0 +1,24 @@ + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/nav-cancelation-1.html b/testing/web-platform/tests/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/nav-cancelation-1.html new file mode 100644 index 0000000000..b52fa04977 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/nav-cancelation-1.html @@ -0,0 +1,62 @@ + + +Parent main frame cancels a same-origin child whose navigation is pending + + + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/nav-cancelation-2.sub.html b/testing/web-platform/tests/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/nav-cancelation-2.sub.html new file mode 100644 index 0000000000..c081513b7c --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/nav-cancelation-2.sub.html @@ -0,0 +1,178 @@ + + +Grandparent main frame cancels a navigation in a cross-origin grandchild + + + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/resources/helpers.mjs b/testing/web-platform/tests/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/resources/helpers.mjs new file mode 100644 index 0000000000..7938497920 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/resources/helpers.mjs @@ -0,0 +1,52 @@ +export function createIframe(t) { + return new Promise((resolve, reject) => { + const iframe = document.createElement("iframe"); + iframe.onload = () => resolve(iframe); + iframe.onerror = () => reject(new Error("Could not load iframe")); + iframe.src = "/common/blank.html"; + + t.add_cleanup(() => iframe.remove()); + document.body.append(iframe); + }); +} + +export function delay(t, ms) { + return new Promise(resolve => t.step_timeout(resolve, ms)); +} + +export function waitForLoad(obj) { + return new Promise(resolve => { + obj.addEventListener("load", resolve, { once: true }); + }); +} + +export function waitForHashchange(obj) { + return new Promise(resolve => { + obj.addEventListener("hashchange", resolve, { once: true }); + }); +} + +export function waitForPopstate(obj) { + return new Promise(resolve => { + obj.addEventListener("popstate", resolve, { once: true }); + }); +} + +// This is used when we want to end the test by asserting some load doesn't +// happen, but we're not sure how long to wait. We could just wait a long-ish +// time (e.g. a second), but that makes the tests slow. Instead, assume that +// network loads take roughly the same time. Then, you can use this function to +// wait a small multiple of the duration of a separate iframe load; this should +// be long enough to catch any problems. +export async function waitForPotentialNetworkLoads(t) { + const before = performance.now(); + + // Sometimes we're doing something, like a traversal, which cancels our first + // attempt at iframe loading. In that case we bail out after 100 ms and try + // again. (Better ideas welcome...) + await Promise.race([createIframe(t), delay(t, 100)]); + await createIframe(t); + + const after = performance.now(); + await delay(t, after - before); +} diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/resources/nav-cancelation-2-helper.html b/testing/web-platform/tests/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/resources/nav-cancelation-2-helper.html new file mode 100644 index 0000000000..a0b4acda2e --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/resources/nav-cancelation-2-helper.html @@ -0,0 +1,18 @@ + + +Page with child frame that navigates slowly + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/resources/slow.py b/testing/web-platform/tests/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/resources/slow.py new file mode 100644 index 0000000000..5ee32a60ba --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/overlapping-navigations-and-traversals/resources/slow.py @@ -0,0 +1,7 @@ +# Like /common/slow.py except with text/html content-type so that it won't +# trigger strange parts of the + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/read-media/pageload-video.html b/testing/web-platform/tests/html/browsers/browsing-the-web/read-media/pageload-video.html new file mode 100644 index 0000000000..9bce1f0c36 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/read-media/pageload-video.html @@ -0,0 +1,28 @@ + + +Media documents: video + + + + + + +

+ diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/read-media/resources/iframe-document.sub.html b/testing/web-platform/tests/html/browsers/browsing-the-web/read-media/resources/iframe-document.sub.html new file mode 100644 index 0000000000..69523efa7a --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/read-media/resources/iframe-document.sub.html @@ -0,0 +1,5 @@ + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/read-text/load-text-plain.html b/testing/web-platform/tests/html/browsers/browsing-the-web/read-text/load-text-plain.html new file mode 100644 index 0000000000..ad75631533 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/read-text/load-text-plain.html @@ -0,0 +1,40 @@ + +Page load processing model for text files + + + + +
+ diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper-tests/addHTML.window.js b/testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper-tests/addHTML.window.js new file mode 100644 index 0000000000..0c093cc462 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper-tests/addHTML.window.js @@ -0,0 +1,20 @@ +// META: title=RemoteContextWrapper addHtml +// META: script=/common/dispatcher/dispatcher.js +// META: script=/common/get-host-info.sub.js +// META: script=/common/utils.js +// META: script=/html/browsers/browsing-the-web/remote-context-helper/resources/remote-context-helper.js +// META: script=./resources/test-helper.js + +'use strict'; + +// This tests that arguments passed to the constructor are respected. +promise_test(async t => { + const rcHelper = new RemoteContextHelper(); + + const main = await rcHelper.addWindow(); + await assertSimplestScriptRuns(main); + + await main.addHTML('
div-content
'); + await assertFunctionRuns( + main, () => document.getElementById('div-id').textContent, 'div-content'); +}); diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper-tests/addIframe-srcdoc-startOn.window.js b/testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper-tests/addIframe-srcdoc-startOn.window.js new file mode 100644 index 0000000000..2ef047c212 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper-tests/addIframe-srcdoc-startOn.window.js @@ -0,0 +1,24 @@ +// META: title=RemoteContextWrapper addIframe with srcdoc and startOn +// META: script=/common/dispatcher/dispatcher.js +// META: script=/common/get-host-info.sub.js +// META: script=/common/utils.js +// META: script=/html/browsers/browsing-the-web/remote-context-helper/resources/remote-context-helper.js +// META: script=./resources/test-helper.js + +'use strict'; + +promise_test(async t => { + const rcHelper = new RemoteContextHelper(); + + const main = await rcHelper.addWindow(); + + const iframe = await main.addIframeSrcdoc( + /*extraConfig=*/ {startOn: 'pageshow'}); + + await assertSimplestScriptRuns(iframe); + await assert_equals( + await iframe.executeScript(() => { + return executorStartEvent.type; + }), + 'pageshow'); +}); diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper-tests/addIframe-srcdoc.window.js b/testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper-tests/addIframe-srcdoc.window.js new file mode 100644 index 0000000000..1a959cbaf0 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper-tests/addIframe-srcdoc.window.js @@ -0,0 +1,27 @@ +// META: title=RemoteContextWrapper addIframe with srcdoc +// META: script=/common/dispatcher/dispatcher.js +// META: script=/common/get-host-info.sub.js +// META: script=/common/utils.js +// META: script=/html/browsers/browsing-the-web/remote-context-helper/resources/remote-context-helper.js +// META: script=./resources/test-helper.js + +'use strict'; + +// This tests that arguments passed to the constructor are respected. +promise_test(async t => { + const rcHelper = new RemoteContextHelper(); + + const main = await rcHelper.addWindow(); + + const iframe = await main.addIframeSrcdoc( + /*extraConfig=*/ {scripts: ['./resources/test-script.js']}, + /*attributes=*/ {id: 'test-id'}, + ); + + await assertSimplestScriptRuns(iframe); + await assertFunctionRuns(iframe, () => testFunction(), 'testFunction exists'); + + assert_equals( + await main.executeScript(() => document.getElementById('test-id').id), + 'test-id', 'verify id'); +}); diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper-tests/addIframe.window.js b/testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper-tests/addIframe.window.js new file mode 100644 index 0000000000..c1630e4680 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper-tests/addIframe.window.js @@ -0,0 +1,40 @@ +// META: title=RemoteContextWrapper addIframe +// META: script=/common/dispatcher/dispatcher.js +// META: script=/common/get-host-info.sub.js +// META: script=/common/utils.js +// META: script=/html/browsers/browsing-the-web/remote-context-helper/resources/remote-context-helper.js +// META: script=./resources/test-helper.js + +'use strict'; + +// This tests that arguments passed to the constructor are respected. +promise_test(async t => { + // Precondition: Test was loaded from the HTTP_ORIGIN. + assert_equals( + location.origin, get_host_info()['HTTP_ORIGIN'], + 'test window was loaded on HTTP_ORIGIN'); + + const rcHelper = new RemoteContextHelper(); + + const main = await rcHelper.addWindow(); + + const headerName = 'x-wpt-test-header'; + const headerValue = 'test-escaping()'; + const iframe = await main.addIframe( + /*extraConfig=*/ { + origin: 'HTTP_REMOTE_ORIGIN', + scripts: ['/common/get-host-info.sub.js', './resources/test-script.js'], + headers: [[headerName, headerValue]], + }, + /*attributes=*/ {id: 'test-id'}, + ); + + await assertSimplestScriptRuns(iframe); + await assertFunctionRuns(iframe, () => testFunction(), 'testFunction exists'); + await assertOriginIsAsExpected(iframe, get_host_info()['HTTP_REMOTE_ORIGIN']); + await assertHeaderIsAsExpected(iframe, headerName, headerValue); + + assert_equals( + await main.executeScript(() => document.getElementById('test-id').id), + 'test-id', 'verify id'); +}); diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper-tests/addScripts.window.js b/testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper-tests/addScripts.window.js new file mode 100644 index 0000000000..01cf06c65d --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper-tests/addScripts.window.js @@ -0,0 +1,19 @@ +// META: title=RemoteContextWrapper addScripts +// META: script=/common/dispatcher/dispatcher.js +// META: script=/common/get-host-info.sub.js +// META: script=/common/utils.js +// META: script=/html/browsers/browsing-the-web/remote-context-helper/resources/remote-context-helper.js +// META: script=./resources/test-helper.js + +'use strict'; + +// This tests that arguments passed to the constructor are respected. +promise_test(async t => { + const rcHelper = new RemoteContextHelper(); + + const main = await rcHelper.addWindow(); + await assertSimplestScriptRuns(main); + + await main.addScripts(['./resources/test-script.js']); + await assertFunctionRuns(main, () => testFunction(), 'testFunction exists'); +}); diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper-tests/addWindow-defaults.window.js b/testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper-tests/addWindow-defaults.window.js new file mode 100644 index 0000000000..34fa9cd39a --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper-tests/addWindow-defaults.window.js @@ -0,0 +1,15 @@ +// META: title=RemoteContextHelper with defaults +// META: script=/common/dispatcher/dispatcher.js +// META: script=/common/get-host-info.sub.js +// META: script=/common/utils.js +// META: script=/html/browsers/browsing-the-web/remote-context-helper/resources/remote-context-helper.js +// META: script=./resources/test-helper.js + +'use strict'; + +promise_test(async t => { + const rcHelper = new RemoteContextHelper(); + const main = await rcHelper.addWindow(); + await assertSimplestScriptRuns(main); + await assertOriginIsAsExpected(main, location.origin); +}); diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper-tests/addWindow-extra-config.window.js b/testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper-tests/addWindow-extra-config.window.js new file mode 100644 index 0000000000..112d2d726e --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper-tests/addWindow-extra-config.window.js @@ -0,0 +1,36 @@ +// META: title=RemoteContextHelper addWindow with extra config +// META: script=/common/dispatcher/dispatcher.js +// META: script=/common/get-host-info.sub.js +// META: script=/common/utils.js +// META: script=/html/browsers/browsing-the-web/remote-context-helper/resources/remote-context-helper.js +// META: script=./resources/test-helper.js + +'use strict'; + +// This tests that arguments passed to the constructor are respected. +promise_test(async t => { + const header1Name = 'x-wpt-test-header1'; + const header1Value = 'test-escaping1()'; + const rcHelper = new RemoteContextHelper({ + origin: 'HTTP_REMOTE_ORIGIN', + scripts: ['/common/get-host-info.sub.js', './resources/test-script.js'], + headers: [[header1Name, header1Value]], + }); + + const header2Name = 'x-wpt-test-header2'; + const header2Value = 'test-escaping2()'; + const main = await rcHelper.addWindow( + { + origin: location.origin, + scripts: [new URL('./resources/test-script2.js', location).toString()], + headers: [[header2Name, header2Value]], + }, + ); + + await assertSimplestScriptRuns(main); + await assertFunctionRuns(main, () => testFunction(), 'testFunction exists'); + await assertFunctionRuns(main, () => testFunction2(), 'testFunction2 exists'); + await assertOriginIsAsExpected(main, location.origin); + await assertHeaderIsAsExpected(main, header1Name, header1Value); + await assertHeaderIsAsExpected(main, header2Name, header2Value); +}); diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper-tests/addWindow-features.window.js b/testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper-tests/addWindow-features.window.js new file mode 100644 index 0000000000..329c55e626 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper-tests/addWindow-features.window.js @@ -0,0 +1,23 @@ +// META: title=RemoteContextHelper addWindow features +// META: script=/common/dispatcher/dispatcher.js +// META: script=/common/get-host-info.sub.js +// META: script=/common/utils.js +// META: script=/html/browsers/browsing-the-web/remote-context-helper/resources/remote-context-helper.js +// META: script=./resources/test-helper.js + +'use strict'; + +promise_test(async t => { + const rcHelper = new RemoteContextHelper(); + { + const main = await rcHelper.addWindow(); + await assertSimplestScriptRuns(main); + await assertWindowHasOpenerEquals(main, true); + } + { + const main = await rcHelper.addWindow( + /*extraConfig=*/ null, /*options=*/ {features: 'noopener'}); + await assertSimplestScriptRuns(main); + await assertWindowHasOpenerEquals(main, false); + } +}); diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper-tests/addWindow-invalid-origin.window.js b/testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper-tests/addWindow-invalid-origin.window.js new file mode 100644 index 0000000000..58aee312cc --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper-tests/addWindow-invalid-origin.window.js @@ -0,0 +1,21 @@ +// META: title=RemoteContextHelper addWindow with extra config +// META: script=/common/dispatcher/dispatcher.js +// META: script=/common/get-host-info.sub.js +// META: script=/common/utils.js +// META: script=/html/browsers/browsing-the-web/remote-context-helper/resources/remote-context-helper.js +// META: script=./resources/test-helper.js + +'use strict'; + +// This tests that arguments passed to the constructor are respected. +promise_test(async t => { + const header1Name = 'x-wpt-test-header1'; + const header1Value = 'test-escaping1()'; + const rcHelper = new RemoteContextHelper({ + origin: 'INVALID', + }); + + promise_rejects_js( + t, RangeError, rcHelper.addWindow(), + 'Exception should be thrown for invalid origin.'); +}); diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper-tests/addWindow-startOn.window.js b/testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper-tests/addWindow-startOn.window.js new file mode 100644 index 0000000000..0f57a87638 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper-tests/addWindow-startOn.window.js @@ -0,0 +1,19 @@ +// META: title=RemoteContextHelper addWindow target +// META: script=/common/dispatcher/dispatcher.js +// META: script=/common/get-host-info.sub.js +// META: script=/common/utils.js +// META: script=/html/browsers/browsing-the-web/remote-context-helper/resources/remote-context-helper.js +// META: script=./resources/test-helper.js + +'use strict'; + +promise_test(async t => { + const rcHelper = new RemoteContextHelper(); + const main = await rcHelper.addWindow({startOn: 'pageshow'}); + await assertSimplestScriptRuns(main); + await assert_equals( + await main.executeScript(() => { + return executorStartEvent.type; + }), + 'pageshow'); +}); diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper-tests/addWindow-target.window.js b/testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper-tests/addWindow-target.window.js new file mode 100644 index 0000000000..3f742048b4 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper-tests/addWindow-target.window.js @@ -0,0 +1,17 @@ +// META: title=RemoteContextHelper addWindow target +// META: script=/common/dispatcher/dispatcher.js +// META: script=/common/get-host-info.sub.js +// META: script=/common/utils.js +// META: script=/html/browsers/browsing-the-web/remote-context-helper/resources/remote-context-helper.js +// META: script=./resources/test-helper.js + +'use strict'; + +promise_test(async t => { + const rcHelper = new RemoteContextHelper(); + const name = 'a name'; + const main = await rcHelper.addWindow( + /*extraConfig=*/ null, /*options=*/ {target: name}); + await assertSimplestScriptRuns(main); + await assertWindowNameEquals(main, name); +}); diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper-tests/addWorker.window.js b/testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper-tests/addWorker.window.js new file mode 100644 index 0000000000..d4ba8b0312 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper-tests/addWorker.window.js @@ -0,0 +1,29 @@ +// META: title=RemoteContextWrapper addWorker +// META: script=/common/dispatcher/dispatcher.js +// META: script=/common/get-host-info.sub.js +// META: script=/common/utils.js +// META: script=/html/browsers/browsing-the-web/remote-context-helper/resources/remote-context-helper.js +// META: script=./resources/test-helper.js + +'use strict'; + +// This tests that arguments passed to the constructor are respected. +promise_test(async t => { + const rcHelper = new RemoteContextHelper(); + + const main = await rcHelper.addWindow(); + + const headerName = 'x-wpt-test-header'; + const headerValue = 'test-escaping()'; + const worker = await main.addWorker( + { + scripts: ['/common/get-host-info.sub.js', './resources/test-script.js'], + headers: [[headerName, headerValue]], + }, + ); + + await assertSimplestScriptRuns(worker); + await assertFunctionRuns(worker, () => testFunction(), 'testFunction exists'); + await assertOriginIsAsExpected(worker, location.origin); + await assertHeaderIsAsExpected(worker, headerName, headerValue); +}); diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper-tests/constructor.window.js b/testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper-tests/constructor.window.js new file mode 100644 index 0000000000..dcbb3dabbc --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper-tests/constructor.window.js @@ -0,0 +1,38 @@ +// META: title=RemoteContextHelper constructor +// META: script=/common/dispatcher/dispatcher.js +// META: script=/common/get-host-info.sub.js +// META: script=/common/utils.js +// META: script=/html/browsers/browsing-the-web/remote-context-helper/resources/remote-context-helper.js +// META: script=./resources/test-helper.js + +'use strict'; + +// This tests that arguments passed to the constructor are respected. +promise_test(async t => { + // Precondition: Test was loaded from the HTTP_ORIGIN. + assert_equals( + location.origin, get_host_info()['HTTP_ORIGIN'], + 'test window was loaded on HTTP_ORIGIN'); + + const headerName = 'x-wpt-test-header'; + const headerValue = 'test-escaping()'; + const rcHelper = new RemoteContextHelper({ + origin: 'HTTP_REMOTE_ORIGIN', + scripts: [ + '/common/get-host-info.sub.js', + './resources/test-script.js', + ], + headers: [[headerName, headerValue]], + }); + + + const main = await rcHelper.addWindow(); + + await assertSimplestScriptRuns(main); + await assertFunctionRuns(main, () => testFunction(), 'testFunction exists'); + + // Verify that the origin is different. + await assertOriginIsAsExpected(main, get_host_info()['HTTP_REMOTE_ORIGIN']); + + await assertHeaderIsAsExpected(main, headerName, headerValue); +}); diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper-tests/createContext-bad-executorCreator.window.js b/testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper-tests/createContext-bad-executorCreator.window.js new file mode 100644 index 0000000000..bf24581173 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper-tests/createContext-bad-executorCreator.window.js @@ -0,0 +1,20 @@ +// META: title=RemoteContextHelper createContext with throwing/rejecting executorCreators. +// META: script=/common/dispatcher/dispatcher.js +// META: script=/common/get-host-info.sub.js +// META: script=/common/utils.js +// META: script=/html/browsers/browsing-the-web/remote-context-helper/resources/remote-context-helper.js + +'use strict'; + +promise_test(async t => { + const rcHelper = new RemoteContextHelper(); + + const err = new Error('something bad!'); + promise_rejects_exactly( + t, err, rcHelper.createContext({ executorCreator() { throw err; } }), + 'Sync exception must be rethrown'); + + promise_rejects_exactly( + t, err, rcHelper.createContext({ executorCreator() { return Promise.reject(err); } }), + 'Async rejection must be rethrown'); +}); diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper-tests/getRequestHeaders.window.js b/testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper-tests/getRequestHeaders.window.js new file mode 100644 index 0000000000..90610e27fb --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper-tests/getRequestHeaders.window.js @@ -0,0 +1,18 @@ +// META: title=RemoteContextHelper with defaults +// META: script=/common/dispatcher/dispatcher.js +// META: script=/common/get-host-info.sub.js +// META: script=/common/utils.js +// META: script=/html/browsers/browsing-the-web/remote-context-helper/resources/remote-context-helper.js +// META: script=./resources/test-helper.js + +'use strict'; + +promise_test(async t => { + const rcHelper = new RemoteContextHelper(); + const main = await rcHelper.addWindow(); + + const headers = await main.getRequestHeaders(); + + assert_equals(headers.constructor, Headers); + assert_true(headers.has("user-agent"), "user-agent is present"); +}); diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper-tests/navigateToNew.window.js b/testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper-tests/navigateToNew.window.js new file mode 100644 index 0000000000..f7dd3f8325 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper-tests/navigateToNew.window.js @@ -0,0 +1,37 @@ +// META: title=RemoteContextWrapper navigateToNew +// META: script=/common/dispatcher/dispatcher.js +// META: script=/common/get-host-info.sub.js +// META: script=/common/utils.js +// META: script=/html/browsers/browsing-the-web/remote-context-helper/resources/remote-context-helper.js +// META: script=./resources/test-helper.js + +'use strict'; + +promise_test(async t => { + // Precondition: Test was loaded from the HTTP_ORIGIN. + assert_equals( + location.origin, get_host_info()['HTTP_ORIGIN'], + 'test window was loaded on HTTP_ORIGIN'); + + const rcHelper = new RemoteContextHelper(); + + const main = await rcHelper.addWindow(); + + const headerName = 'x-wpt-test-header'; + const headerValue = 'test-escaping()'; + const newMain = await main.navigateToNew( + { + origin: 'HTTP_REMOTE_ORIGIN', + scripts: ['/common/get-host-info.sub.js', './resources/test-script.js'], + headers: [[headerName, headerValue]], + }, + ); + + await assertSimplestScriptRuns(newMain); + await assertFunctionRuns( + newMain, () => testFunction(), 'testFunction exists'); + + const remoteOrigin = get_host_info()['HTTP_REMOTE_ORIGIN']; + await assertOriginIsAsExpected(newMain, remoteOrigin); + await assertHeaderIsAsExpected(newMain, headerName, headerValue); +}); diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper-tests/navigation-bfcache.window.js b/testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper-tests/navigation-bfcache.window.js new file mode 100644 index 0000000000..1fa90a9064 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper-tests/navigation-bfcache.window.js @@ -0,0 +1,35 @@ +// META: title=RemoteContextHelper navigation using BFCache +// META: script=/common/dispatcher/dispatcher.js +// META: script=/common/get-host-info.sub.js +// META: script=/common/utils.js +// META: script=/html/browsers/browsing-the-web/remote-context-helper/resources/remote-context-helper.js +// META: script=./resources/test-helper.js + +'use strict'; + +promise_test(async t => { + const rcHelper = new RemoteContextHelper(); + + // Open a window with noopener so that BFCache will work. + const rc1 = await rcHelper.addWindow( + /*config=*/ null, /*options=*/ {features: 'noopener'}); + + // Add a pageshow listener to stash the event. + await rc1.executeScript(() => { + window.addEventListener('pageshow', (event) => { + window.pageshowEvent = event; + }); + }); + + // Navigate away. + const rc2 = await rc1.navigateToNew(); + await assertSimplestScriptRuns(rc2); + + // Navigate back. + await rc2.historyBack(); + + // Verify that the document was BFCached. + assert_true(await rc1.executeScript(() => { + return window.pageshowEvent.persisted; + })); +}); diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper-tests/navigation-helpers.window.js b/testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper-tests/navigation-helpers.window.js new file mode 100644 index 0000000000..079e20661e --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper-tests/navigation-helpers.window.js @@ -0,0 +1,28 @@ +// META: title=RemoteContextHelper navigation helpers +// META: script=/common/dispatcher/dispatcher.js +// META: script=/common/get-host-info.sub.js +// META: script=/common/utils.js +// META: script=/html/browsers/browsing-the-web/remote-context-helper/resources/remote-context-helper.js +// META: script=./resources/test-helper.js +// META: timeout=long + +'use strict'; + +promise_test(async t => { + const rcHelper = new RemoteContextHelper(); + const rc1 = await rcHelper.addWindow(); + await assertSimplestScriptRuns(rc1); + + const rc2 = await rc1.navigateToNew(); + await assertSimplestScriptRuns(rc2); + + await rc2.historyBack(); + await assertSimplestScriptRuns(rc1); + + await rc1.historyForward(); + await assertSimplestScriptRuns(rc2); + + const rc3 = await rc2.navigateToNew(); + await rc3.historyGo(-2); + await assertSimplestScriptRuns(rc1); +}); diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper-tests/navigation-same-document.window.js b/testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper-tests/navigation-same-document.window.js new file mode 100644 index 0000000000..6f637e2b90 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper-tests/navigation-same-document.window.js @@ -0,0 +1,39 @@ +// META: title=RemoteContextHelper navigation using BFCache +// META: script=/common/dispatcher/dispatcher.js +// META: script=/common/get-host-info.sub.js +// META: script=/common/utils.js +// META: script=/html/browsers/browsing-the-web/remote-context-helper/resources/remote-context-helper.js +// META: script=./resources/test-helper.js + +'use strict'; + +async function assertLocationIs(remoteContextWrapper, expectedLocation) { + assert_equals( + await remoteContextWrapper.executeScript(() => { + return location.toString(); + }), + expectedLocation, 'verify location'); +} + +promise_test(async t => { + const rcHelper = new RemoteContextHelper(); + + const rc = await rcHelper.addWindow(); + + const oldLocation = await rc.executeScript(() => { + return location.toString(); + }); + const newLocation = oldLocation + '#fragment'; + + // Navigate to same document. + await rc.navigateTo(newLocation); + + // Verify that the window navigated. + await assertLocationIs(rc, newLocation); + + // Navigate back. + await rc.historyBack(oldLocation); + + // Verify that the window navigated back and the executor is running. + await assertLocationIs(rc, oldLocation); +}); diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper-tests/resources/test-helper.js b/testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper-tests/resources/test-helper.js new file mode 100644 index 0000000000..71cd87e553 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper-tests/resources/test-helper.js @@ -0,0 +1,48 @@ +async function assertSimplestScriptRuns(remoteContextWrapper) { + assert_equals( + await remoteContextWrapper.executeScript(() => { + return 1; + }), + 1, 'simplest script runs'); +} + +async function assertFunctionRuns( + remoteContextWrapper, functionToRun, expectedReturn) { + assert_equals( + await remoteContextWrapper.executeScript(functionToRun), expectedReturn, + 'function runs'); +} + +async function assertOriginIsAsExpected(remoteContextWrapper, expectedOrigin) { + assert_equals( + await remoteContextWrapper.executeScript(() => { + return location.origin; + }), + expectedOrigin, 'verify origin'); +} + +async function assertWindowNameEquals(remoteContextWrapper, expectedName) { + assert_equals( + await remoteContextWrapper.executeScript(() => { + return window.name; + }), + expectedName, 'verify name'); +} + +async function assertWindowHasOpenerEquals(remoteContextWrapper, hasParent) { + assert_equals( + await remoteContextWrapper.executeScript(() => { + return !!window.opener; + }), + hasParent, 'verify opener'); +} + +async function assertHeaderIsAsExpected( + remoteContextWrapper, headerName, headerValue) { + assert_equals( + headerValue, + await remoteContextWrapper.executeScript(async (headerName) => { + const res = await fetch(location); + return res.headers.get(headerName); + }, [headerName]), 'header is set'); +} \ No newline at end of file diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper-tests/resources/test-script.js b/testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper-tests/resources/test-script.js new file mode 100644 index 0000000000..d1c02cab29 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper-tests/resources/test-script.js @@ -0,0 +1,3 @@ +function testFunction() { + return 'testFunction exists'; +} diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper-tests/resources/test-script2.js b/testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper-tests/resources/test-script2.js new file mode 100644 index 0000000000..f9e72c442b --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper-tests/resources/test-script2.js @@ -0,0 +1,3 @@ +function testFunction2() { + return 'testFunction2 exists'; +} diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper/resources/executor-common.js b/testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper/resources/executor-common.js new file mode 100644 index 0000000000..ce9b5f9116 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper/resources/executor-common.js @@ -0,0 +1,14 @@ +// Functions available by default in the executor. + +'use strict'; + +let executor; + +// Expects addScript to be present (window or worker version). +function addScripts(urls) { + return Promise.all(urls.map(addScript)); +} + +function startExecutor(uuid) { + executor = new Executor(uuid); +} diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper/resources/executor-window.js b/testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper/resources/executor-window.js new file mode 100644 index 0000000000..54df6735c9 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper/resources/executor-window.js @@ -0,0 +1,67 @@ +// Functions available by default in the executor. + +'use strict'; + +let executorStartEvent = null; + +function requestExecutor(uuid, startOn) { + if (startOn) { + addEventListener(startOn, (e) => { + executorStartEvent = e; + startExecutor(uuid); + }); + } else { + startExecutor(uuid); + } +} + +function addScript(url) { + const script = document.createElement('script'); + script.src = url; + const promise = new Promise((resolve, reject) => { + script.onload = () => resolve(url); + script.onerror = (e) => reject(e); + }); + document.body.appendChild(script); + return promise; +} + +/** + * Suspends the executor and executes the function in `fnString` when it has + * suspended. Installs a pageshow handler to resume the executor if the + * document is BFCached. Installs a hashchange handler to detect when the + * navigation did not change documents. + * + * This returns nothing because fn is invoke after waiting for the document to + * be suspended. If we were to return a promise, the executor could not suspend + * until that promise resolved but the promise cannot resolve until the executor + * is suspended. This could be avoided by adding support + * directly in the dispatcher for tasks suspend immediately after execution. + * + * @param {string} fnString A stringified function to be executed. + * @param {any[]} args The arguments to pass to the function. + */ +function executeScriptToNavigate(fnString, args) { + // Only one of these listeners should run. + const controller = new AbortController(); + window.addEventListener('pageshow', (event) => { + controller.abort(); + executor.resume(); + }, {signal: controller.signal, once: true}); + window.addEventListener('hashchange', (event) => { + controller.abort(); + const oldURLObject = new URL(event.oldURL); + const newURLObject = new URL(event.newURL); + oldURLObject.hash = ''; + newURLObject.hash = ''; + // If only the hash-fragment changed then the navigation was + // same-document and we should resume the executor. + if (oldURLObject.toString() == newURLObject.toString()) { + executor.resume(); + } + }, {signal: controller.signal, once: true}); + + executor.suspend(() => { + eval(fnString).apply(null, args); + }); +} diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper/resources/executor-window.py b/testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper/resources/executor-window.py new file mode 100644 index 0000000000..1a660100b9 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper/resources/executor-window.py @@ -0,0 +1,40 @@ +import html +import json +from urllib import parse + +def main(request, response): + initRequestHeaders = "" + for header_name in request.headers.keys(): + for header_value in request.headers.get_list(header_name): + js_name = json.dumps(header_name.lower().decode("utf-8")) + js_value = json.dumps(header_value.decode("utf-8")) + initRequestHeaders += f"window.__requestHeaders.append({js_name}, {js_value});\n" + if (b"status" in request.GET): + status = int(request.GET.first(b"status")) + else: + status = 200 + query = parse.parse_qs(request.url_parts.query) + scripts = [] + for script in query.get("script", []): + scripts.append(f"") + scripts_s = "\n".join(scripts) + + uuid = query.get("uuid")[0] + + start_on = query.get("startOn") + start_on_s = f"'{start_on[0]}'" if start_on else "null" + + return (status, [("Content-Type", "text/html")], f""" + + + + + +{scripts_s} + + +""") diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper/resources/executor-worker.js b/testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper/resources/executor-worker.js new file mode 100644 index 0000000000..0ca136191e --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper/resources/executor-worker.js @@ -0,0 +1,12 @@ +'use strict'; + +importScripts('/common/dispatcher/dispatcher.js', './executor-common.js'); + +function addScript(url) { + importScripts(url); +} + +const params = new URLSearchParams(location.search); +addScripts(params.getAll('script')); + +startExecutor(params.get('uuid')); diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper/resources/remote-context-helper.js b/testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper/resources/remote-context-helper.js new file mode 100644 index 0000000000..aa24b36e8b --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper/resources/remote-context-helper.js @@ -0,0 +1,592 @@ +'use strict'; + +// Requires: +// - /common/dispatcher/dispatcher.js +// - /common/utils.js +// - /common/get-host-info.sub.js if automagic conversion of origin names to +// URLs is used. + +/** + * This provides a more friendly interface to remote contexts in dispatches.js. + * The goal is to make it easy to write multi-window/-frame/-worker tests where + * the logic is entirely in 1 test file and there is no need to check in any + * other file (although it is often helpful to check in files of JS helper + * functions that are shared across remote context). + * + * So for example, to test that history traversal works, we create a new window, + * navigate it to a new document, go back and then go forward. + * + * @example + * promise_test(async t => { + * const rcHelper = new RemoteContextHelper(); + * const rc1 = await rcHelper.addWindow(); + * const rc2 = await rc1.navigateToNew(); + * assert_equals(await rc2.executeScript(() => 'here'), 'here', 'rc2 is live'); + * rc2.historyBack(); + * assert_equals(await rc1.executeScript(() => 'here'), 'here', 'rc1 is live'); + * rc1.historyForward(); + * assert_equals(await rc2.executeScript(() => 'here'), 'here', 'rc2 is live'); + * }); + * + * Note on the correspondence between remote contexts and + * `RemoteContextWrapper`s. A remote context is entirely determined by its URL. + * So navigating away from one and then back again will result in a remote + * context that can be controlled by the same `RemoteContextWrapper` instance + * before and after navigation. Messages sent to a remote context while it is + * destroyed or in BFCache will be queued and processed if that that URL is + * navigated back to. + * + * Navigation: + * This framework does not keep track of the history of the frame tree and so it + * is up to the test script to keep track of what remote contexts are currently + * active and to keep references to the corresponding `RemoteContextWrapper`s. + * + * Any action that leads to navigation in the remote context must be executed + * using + * @see RemoteContextWrapper.navigate. + */ + +{ + const RESOURCES_PATH = + '/html/browsers/browsing-the-web/remote-context-helper/resources'; + const WINDOW_EXECUTOR_PATH = `${RESOURCES_PATH}/executor-window.py`; + const WORKER_EXECUTOR_PATH = `${RESOURCES_PATH}/executor-worker.js`; + + /** + * Turns a string into an origin. If `origin` is null this will return the + * current document's origin. If `origin` contains not '/', this will attempt + * to use it as an index in `get_host_info()`. Otherwise returns the input + * origin. + * @private + * @param {string|null} origin The input origin. + * @return {string|null} The output origin. + * @throws {RangeError} is `origin` cannot be found in + * `get_host_info()`. + */ + function finalizeOrigin(origin) { + if (!origin) { + return location.origin; + } + if (!origin.includes('/')) { + const origins = get_host_info(); + if (origin in origins) { + return origins[origin]; + } else { + throw new RangeError( + `${origin} is not a key in the get_host_info() object`); + } + } + return origin; + } + + /** + * @private + * @param {string} url + * @returns {string} Absolute url using `location` as the base. + */ + function makeAbsolute(url) { + return new URL(url, location).toString(); + } + + /** + * Represents a configuration for a remote context executor. + */ + class RemoteContextConfig { + /** + * @param {Object} [options] + * @param {string} [options.origin] A URL or a key in `get_host_info()`. + * @see finalizeOrigin for how origins are handled. + * @param {string[]} [options.scripts] A list of script URLs. The current + * document will be used as the base for relative URLs. + * @param {[string, string][]} [options.headers] A list of pairs of name + * and value. The executor will be served with these headers set. + * @param {string} [options.startOn] If supplied, the executor will start + * when this event occurs, e.g. "pageshow", + * (@see window.addEventListener). This only makes sense for + * window-based executors, not worker-based. + * @param {string} [options.status] If supplied, the executor will pass + * this value in the "status" parameter to the executor. The default + * executor will default to a status code of 200, if the parameter is + * not supplied. + */ + constructor( + {origin, scripts = [], headers = [], startOn, status} = {}) { + this.origin = origin; + this.scripts = scripts; + this.headers = headers; + this.startOn = startOn; + this.status = status; + } + + /** + * If `config` is not already a `RemoteContextConfig`, one is constructed + * using `config`. + * @private + * @param {object} [config] + * @returns + */ + static ensure(config) { + if (!config) { + return DEFAULT_CONTEXT_CONFIG; + } + return new RemoteContextConfig(config); + } + + /** + * Merges `this` with another `RemoteContextConfig` and to give a new + * `RemoteContextConfig`. `origin` is replaced by the other if present, + * `headers` and `scripts` are concatenated with `this`'s coming first. + * @param {RemoteContextConfig} extraConfig + * @returns {RemoteContextConfig} + */ + merged(extraConfig) { + let origin = this.origin; + if (extraConfig.origin) { + origin = extraConfig.origin; + } + let startOn = this.startOn; + if (extraConfig.startOn) { + startOn = extraConfig.startOn; + } + let status = this.status; + if (extraConfig.status) { + status = extraConfig.status; + } + const headers = this.headers.concat(extraConfig.headers); + const scripts = this.scripts.concat(extraConfig.scripts); + return new RemoteContextConfig({ + origin, + headers, + scripts, + startOn, + status + }); + } + } + + /** + * The default `RemoteContextConfig` to use if none is supplied. It has no + * origin, headers or scripts. + * @constant {RemoteContextConfig} + */ + const DEFAULT_CONTEXT_CONFIG = new RemoteContextConfig(); + + /** + * This class represents a configuration for creating remote contexts. This is + * the entry-point + * for creating remote contexts, providing @see addWindow . + */ + class RemoteContextHelper { + /** + * @param {RemoteContextConfig|object} config The configuration + * for this remote context. + */ + constructor(config) { + this.config = RemoteContextConfig.ensure(config); + } + + /** + * Creates a new remote context and returns a `RemoteContextWrapper` giving + * access to it. + * @private + * @param {Object} options + * @param {(url: string) => Promise} [options.executorCreator] A + * function that takes a URL and causes the browser to navigate some + * window to that URL, e.g. via an iframe or a new window. If this is + * not supplied, then the returned RemoteContextWrapper won't actually + * be communicating with something yet, and something will need to + * navigate to it using its `url` property, before communication can be + * established. + * @param {RemoteContextConfig|object} [options.extraConfig] If supplied, + * extra configuration for this remote context to be merged with + * `this`'s existing config. If it's not a `RemoteContextConfig`, it + * will be used to construct a new one. + * @returns {Promise} + */ + async createContext({ + executorCreator, + extraConfig, + isWorker = false, + }) { + const config = + this.config.merged(RemoteContextConfig.ensure(extraConfig)); + + const origin = finalizeOrigin(config.origin); + const url = new URL( + isWorker ? WORKER_EXECUTOR_PATH : WINDOW_EXECUTOR_PATH, origin); + + // UUID is needed for executor. + const uuid = token(); + url.searchParams.append('uuid', uuid); + + if (config.headers) { + addHeaders(url, config.headers); + } + for (const script of config.scripts) { + url.searchParams.append('script', makeAbsolute(script)); + } + + if (config.startOn) { + url.searchParams.append('startOn', config.startOn); + } + + if (config.status) { + url.searchParams.append('status', config.status); + } + + if (executorCreator) { + await executorCreator(url.href); + } + + return new RemoteContextWrapper(new RemoteContext(uuid), this, url.href); + } + + /** + * Creates a window with a remote context. @see createContext for + * @param {RemoteContextConfig|object} [extraConfig] Will be + * merged with `this`'s config. + * @param {Object} [options] + * @param {string} [options.target] Passed to `window.open` as the + * 2nd argument + * @param {string} [options.features] Passed to `window.open` as the + * 3rd argument + * @returns {Promise} + */ + addWindow(extraConfig, options) { + return this.createContext({ + executorCreator: windowExecutorCreator(options), + extraConfig, + }); + } + } + // Export this class. + self.RemoteContextHelper = RemoteContextHelper; + + /** + * Attaches header to the URL. See + * https://web-platform-tests.org/writing-tests/server-pipes.html#headers + * @param {string} url the URL to which headers should be attached. + * @param {[[string, string]]} headers a list of pairs of head-name, + * header-value. + */ + function addHeaders(url, headers) { + function escape(s) { + return s.replace('(', '\\(').replace(')', '\\)'); + } + const formattedHeaders = headers.map((header) => { + return `header(${escape(header[0])}, ${escape(header[1])})`; + }); + url.searchParams.append('pipe', formattedHeaders.join('|')); + } + + function windowExecutorCreator({target = '_blank', features} = {}) { + return url => { + window.open(url, target, features); + }; + } + + function elementExecutorCreator( + remoteContextWrapper, elementName, attributes) { + return url => { + return remoteContextWrapper.executeScript((url, elementName, attributes) => { + const el = document.createElement(elementName); + for (const attribute in attributes) { + el.setAttribute(attribute, attributes[attribute]); + } + el.src = url; + document.body.appendChild(el); + }, [url, elementName, attributes]); + }; + } + + function iframeSrcdocExecutorCreator(remoteContextWrapper, attributes) { + return async (url) => { + // `url` points to the content needed to run an `Executor` in the frame. + // So we download the content and pass it via the `srcdoc` attribute, + // setting the iframe's `src` to `undefined`. + attributes['srcdoc'] = await fetch(url).then(r => r.text()); + elementExecutorCreator( + remoteContextWrapper, 'iframe', attributes)(undefined); + }; + } + + function workerExecutorCreator() { + return url => { + new Worker(url); + }; + } + + function navigateExecutorCreator(remoteContextWrapper) { + return url => { + return remoteContextWrapper.navigate((url) => { + window.location = url; + }, [url]); + }; + } + + /** + * This class represents a remote context running an executor (a + * window/frame/worker that can receive commands). It is the interface for + * scripts to control remote contexts. + * + * Instances are returned when new remote contexts are created (e.g. + * `addFrame` or `navigateToNew`). + */ + class RemoteContextWrapper { + /** + * This should only be constructed by `RemoteContextHelper`. + * @private + */ + constructor(context, helper, url) { + this.context = context; + this.helper = helper; + this.url = url; + } + + /** + * Executes a script in the remote context. + * @param {function} fn The script to execute. + * @param {any[]} args An array of arguments to pass to the script. + * @returns {Promise} The return value of the script (after + * being serialized and deserialized). + */ + async executeScript(fn, args) { + return this.context.execute_script(fn, args); + } + + /** + * Adds a string of HTML to the executor's document. + * @param {string} html + * @returns {Promise} + */ + async addHTML(html) { + return this.executeScript((htmlSource) => { + document.body.insertAdjacentHTML('beforebegin', htmlSource); + }, [html]); + } + + /** + * Adds scripts to the executor's document. + * @param {string[]} urls A list of URLs. URLs are relative to the current + * document. + * @returns {Promise} + */ + async addScripts(urls) { + if (!urls) { + return []; + } + return this.executeScript(urls => { + return addScripts(urls); + }, [urls.map(makeAbsolute)]); + } + + /** + * Adds an iframe with `src` attribute to the current document. + * @param {RemoteContextConfig} [extraConfig] + * @param {[string, string][]} [attributes] A list of pairs of strings + * of attribute name and value these will be set on the iframe element + * when added to the document. + * @returns {Promise} The remote context. + */ + addIframe(extraConfig, attributes = {}) { + return this.helper.createContext({ + executorCreator: elementExecutorCreator(this, 'iframe', attributes), + extraConfig, + }); + } + + /** + * Adds an iframe with `srcdoc` attribute to the current document + * @param {RemoteContextConfig} [extraConfig] + * @param {[string, string][]} [attributes] A list of pairs of strings + * of attribute name and value these will be set on the iframe element + * when added to the document. + * @returns {Promise} The remote context. + */ + addIframeSrcdoc(extraConfig, attributes = {}) { + return this.helper.createContext({ + executorCreator: iframeSrcdocExecutorCreator(this, attributes), + extraConfig, + }); + } + + /** + * Adds a dedicated worker to the current document. + * @param {RemoteContextConfig} [extraConfig] + * @returns {Promise} The remote context. + */ + addWorker(extraConfig) { + return this.helper.createContext({ + executorCreator: workerExecutorCreator(), + extraConfig, + isWorker: true, + }); + } + + /** + * Gets a `Headers` object containing the request headers that were used + * when the browser requested this document. + * + * Currently, this only works for `RemoteContextHelper`s representing + * windows, not workers. + * @returns {Promise} + */ + async getRequestHeaders() { + // This only works in window environments for now. We could make it work + // for workers too; if you have a need, just share or duplicate the code + // that's in executor-window.py. Anyway, we explicitly use `window` in + // the script so that we get a clear error if you try using it on a + // worker. + + // We need to serialize and deserialize the `Headers` object manually. + const asNestedArrays = await this.executeScript(() => [...window.__requestHeaders]); + return new Headers(asNestedArrays); + } + + /** + * Executes a script in the remote context that will perform a navigation. + * To do this safely, we must suspend the executor and wait for that to + * complete before executing. This ensures that all outstanding requests are + * completed and no more can start. It also ensures that the executor will + * restart if the page goes into BFCache or it was a same-document + * navigation. It does not return a value. + * + * NOTE: We cannot monitor whether and what navigations are happening. The + * logic has been made as robust as possible but is not fool-proof. + * + * Foolproof rule: + * - The script must perform exactly one navigation. + * - If that navigation is a same-document history traversal, you must + * `await` the result of `waitUntilLocationIs`. (Same-document non-traversal + * navigations do not need this extra step.) + * + * More complex rules: + * - The script must perform a navigation. If it performs no navigation, + * the remote context will be left in the suspended state. + * - If the script performs a direct same-document navigation, it is not + * necessary to use this function but it will work as long as it is the only + * navigation performed. + * - If the script performs a same-document history navigation, you must + * `await` the result of `waitUntilLocationIs`. + * + * @param {function} fn The script to execute. + * @param {any[]} args An array of arguments to pass to the script. + * @returns {Promise} + */ + navigate(fn, args) { + return this.executeScript((fnText, args) => { + executeScriptToNavigate(fnText, args); + }, [fn.toString(), args]); + } + + /** + * Navigates to the given URL, by executing a script in the remote + * context that will perform navigation with the `location.href` + * setter. + * + * Be aware that performing a cross-document navigation using this + * method will cause this `RemoteContextWrapper` to become dormant, + * since the remote context it points to is no longer active and + * able to receive messages. You also won't be able to reliably + * tell when the navigation finishes; the returned promise will + * fulfill when the script finishes running, not when the navigation + * is done. As such, this is most useful for testing things like + * unload behavior (where it doesn't matter) or prerendering (where + * there is already a `RemoteContextWrapper` for the destination). + * For other cases, using `navigateToNew()` will likely be better. + * + * @param {string|URL} url The URL to navigate to. + * @returns {Promise} + */ + navigateTo(url) { + return this.navigate(url => { + location.href = url; + }, [url.toString()]); + } + + /** + * Navigates the context to a new document running an executor. + * @param {RemoteContextConfig} [extraConfig] + * @returns {Promise} The remote context. + */ + async navigateToNew(extraConfig) { + return this.helper.createContext({ + executorCreator: navigateExecutorCreator(this), + extraConfig, + }); + } + + ////////////////////////////////////// + // Navigation Helpers. + // + // It is up to the test script to know which remote context will be + // navigated to and which `RemoteContextWrapper` should be used after + // navigation. + // + // NOTE: For a same-document history navigation, the caller use `await` a + // call to `waitUntilLocationIs` in order to know that the navigation has + // completed. For convenience the method below can return the promise to + // wait on, if passed the expected location. + + async waitUntilLocationIs(expectedLocation) { + return this.executeScript(async (expectedLocation) => { + if (location.href === expectedLocation) { + return; + } + + // Wait until the location updates to the expected one. + await new Promise(resolve => { + const listener = addEventListener('hashchange', (event) => { + if (event.newURL === expectedLocation) { + removeEventListener(listener); + resolve(); + } + }); + }); + }, [expectedLocation]); + } + + /** + * Performs a history traversal. + * @param {integer} n How many steps to traverse. @see history.go + * @param {string} [expectedLocation] If supplied will be passed to @see waitUntilLocationIs. + * @returns {Promise} + */ + async historyGo(n, expectedLocation) { + await this.navigate((n) => { + history.go(n); + }, [n]); + if (expectedLocation) { + await this.waitUntilLocationIs(expectedLocation); + } + } + + /** + * Performs a history traversal back. + * @param {string} [expectedLocation] If supplied will be passed to @see waitUntilLocationIs. + * @returns {Promise} + */ + async historyBack(expectedLocation) { + await this.navigate(() => { + history.back(); + }); + if (expectedLocation) { + await this.waitUntilLocationIs(expectedLocation); + } + } + + /** + * Performs a history traversal back. + * @param {string} [expectedLocation] If supplied will be passed to @see waitUntilLocationIs. + * @returns {Promise} + */ + async historyForward(expectedLocation) { + await this.navigate(() => { + history.forward(); + }); + if (expectedLocation) { + await this.waitUntilLocationIs(expectedLocation); + } + } + } +} diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/resources/has-iframe.html b/testing/web-platform/tests/html/browsers/browsing-the-web/resources/has-iframe.html new file mode 100644 index 0000000000..e6dfba1011 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/resources/has-iframe.html @@ -0,0 +1,7 @@ + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/resources/helpers.js b/testing/web-platform/tests/html/browsers/browsing-the-web/resources/helpers.js new file mode 100644 index 0000000000..b19addfadf --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/resources/helpers.js @@ -0,0 +1,84 @@ +// This file contains general helpers for navigation/history tests. The goal is +// to make tests more imperative and ordered, instead of requiring lots of +// nested callbacks and jumping back and forth. However, +// html/browsers/browsing-the-web/remote-context-helper/resources/remote-context-helper.js +// might be even better at that, so prefer that when you can. +// +// TODO(domenic): consider unifying with +// overlapping-navigations-and-traversals/resources/helpers.mjs. + +window.openWindow = (url, t) => { + const w = window.open(url); + t?.add_cleanup(() => w.close()); + + return new Promise(resolve => { + w.addEventListener("load", () => resolve(w), { once: true }); + }); +}; + +window.addIframe = (url = "/common/blank.html", doc = document) => { + const iframe = doc.createElement("iframe"); + iframe.src = url; + doc.body.append(iframe); + + return new Promise(resolve => { + iframe.addEventListener("load", () => resolve(iframe), { once: true }); + }); +}; + +window.addSrcdocIframe = async () => { + const iframe = document.createElement("iframe"); + iframe.srcdoc = ` diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/001.html b/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/001.html new file mode 100644 index 0000000000..32599bbc50 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/001.html @@ -0,0 +1,16 @@ + + +Fragment Navigation: Updating document address + + +
+ diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/002.html b/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/002.html new file mode 100644 index 0000000000..92bfd63415 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/002.html @@ -0,0 +1,21 @@ + + +Fragment Navigation: Updating document address twice + + +
+ diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/003.html b/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/003.html new file mode 100644 index 0000000000..86d85b9ca6 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/003.html @@ -0,0 +1,25 @@ + + +Fragment Navigation: Updating scroll position + + + +
+
scroll 1
+
Filler
+
scroll 2
+ diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/004.html b/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/004.html new file mode 100644 index 0000000000..c365c6fd29 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/004.html @@ -0,0 +1,23 @@ + + +Fragment Navigation: hashchange event + + + +
+ diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/005.html b/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/005.html new file mode 100644 index 0000000000..f0761a64f6 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/005.html @@ -0,0 +1,23 @@ + + +Fragment Navigation: hashchange event + + + +
+ diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/006.html b/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/006.html new file mode 100644 index 0000000000..a65b9eb4a2 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/006.html @@ -0,0 +1,34 @@ + + +Fragment Navigation: hashchange event multiple changes old/newURL + + + +
+ diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/007.html b/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/007.html new file mode 100644 index 0000000000..0b6fe813ba --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/007.html @@ -0,0 +1,37 @@ + + +Fragment Navigation: hashchange event multiple changes old/newURL + + + + +
+ diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/forward-triggers-hashchange.html b/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/forward-triggers-hashchange.html new file mode 100644 index 0000000000..45f7e38ba3 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/forward-triggers-hashchange.html @@ -0,0 +1,44 @@ + + +Navigating forward after replace() should still trigger hashchange + + + + + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/fragment-and-encoding-2.html b/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/fragment-and-encoding-2.html new file mode 100644 index 0000000000..cd2502ab1c --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/fragment-and-encoding-2.html @@ -0,0 +1,41 @@ + + +Fragment navigation: encoding + + +
+
+
+
+ diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/fragment-and-encoding.html b/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/fragment-and-encoding.html new file mode 100644 index 0000000000..21fbd4618d --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/fragment-and-encoding.html @@ -0,0 +1,50 @@ + + +Fragment navigation: encoding + + +
+
+
+
+
+ diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/navigate-helpers.js b/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/navigate-helpers.js new file mode 100644 index 0000000000..7a9adeb3d2 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/navigate-helpers.js @@ -0,0 +1,23 @@ +"use strict"; + +// Usage examples: +// navigateAndWaitForChange(frameWindow, w => w.location.href = "..."); +// navigateAndWaitForChange(frameWindow, w => w.history.back()); +// navigateAndWaitForChange(frameWindow, w => w.history.back(), { assumeSuccessAfter: 100 }); + +window.navigateAndWaitForChange = (w, navigationAction, { assumeSuccessAfter } = {}) => { + return new Promise(resolve => { + w.addEventListener("hashchange", listener); + + function listener() { + w.removeEventListener("hashchange", listener); + resolve(); + } + + if (assumeSuccessAfter !== undefined) { + step_timeout(resolve, assumeSuccessAfter); + } + + navigationAction(w); + }); +}; diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/replacement-enabled.html b/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/replacement-enabled.html new file mode 100644 index 0000000000..b22fbed80f --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/replacement-enabled.html @@ -0,0 +1,69 @@ + + +Navigating to a fragment should not clear forward history + + + + + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/scroll-frag-non-utf8-encoded-document.html b/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/scroll-frag-non-utf8-encoded-document.html new file mode 100644 index 0000000000..7d4e994f0a --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/scroll-frag-non-utf8-encoded-document.html @@ -0,0 +1,21 @@ + +Fragment Navigation: fragment id should not be found in non UTF8 document + + + + + +
+
+
+ diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/scroll-frag-percent-encoded.html b/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/scroll-frag-percent-encoded.html new file mode 100644 index 0000000000..aa179425c5 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/scroll-frag-percent-encoded.html @@ -0,0 +1,62 @@ + +Fragment Navigation: fragment id should be percent-decoded + + + + +
+
+
+
+
+
+
+ diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/scroll-position-vertical-lr.html b/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/scroll-position-vertical-lr.html new file mode 100644 index 0000000000..57d99440e1 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/scroll-position-vertical-lr.html @@ -0,0 +1,25 @@ + + + + +Fragment Navigation: Scroll to block start position in vertical-lr writing mode + + + + +
+
+ + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/scroll-position-vertical-rl.html b/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/scroll-position-vertical-rl.html new file mode 100644 index 0000000000..60a902199a --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/scroll-position-vertical-rl.html @@ -0,0 +1,25 @@ + + + + +Fragment Navigation: Scroll to block start position in vertical-rl writing mode + + + + +
+
+ + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/scroll-position.html b/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/scroll-position.html new file mode 100644 index 0000000000..c38d2de83b --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/scroll-position.html @@ -0,0 +1,25 @@ + + + + +Fragment Navigation: Scroll to block start position + + + + +
+
+ + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/scroll-to-anchor-name.html b/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/scroll-to-anchor-name.html new file mode 100644 index 0000000000..060aed11e2 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/scroll-to-anchor-name.html @@ -0,0 +1,59 @@ + +Fragment Navigation: scroll to anchor name is lower priority than equal id + + + + +
+ +
+ + +
+ diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/scroll-to-id-top.html b/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/scroll-to-id-top.html new file mode 100644 index 0000000000..601d40a2a1 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/scroll-to-id-top.html @@ -0,0 +1,51 @@ + +Fragment Navigation: TOP is a valid element id, which overrides navigating to top of the document + + + + +
+
+
+ diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/scroll-to-top.html b/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/scroll-to-top.html new file mode 100644 index 0000000000..bf62e4cd55 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/scroll-to-fragid/scroll-to-top.html @@ -0,0 +1,56 @@ + +Fragment Navigation: When fragid is TOP scroll to the top of the document + + + + +
+
+
+ diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/001.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/001.html new file mode 100644 index 0000000000..1ef88d3cc1 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/001.html @@ -0,0 +1,15 @@ + +document.open in unload + + +
+ diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/002.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/002.html new file mode 100644 index 0000000000..a4e0b243e2 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/002.html @@ -0,0 +1,15 @@ + +document.open in unload + + +
+ diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/003.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/003.html new file mode 100644 index 0000000000..d0a19e0ddc --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/003.html @@ -0,0 +1,15 @@ + +document.open in beforeunload with link + + +
+ diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/004.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/004.html new file mode 100644 index 0000000000..fca926f652 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/004.html @@ -0,0 +1,15 @@ + +document.open in beforeunload with button + + +
+ diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/005.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/005.html new file mode 100644 index 0000000000..c215fb88e7 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/005.html @@ -0,0 +1,15 @@ + +document.open in pagehide in iframe + + +
+ diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/base.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/base.html new file mode 100644 index 0000000000..70c07cba4c --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/base.html @@ -0,0 +1,14 @@ + +Base + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/beforeunload-canceling-1.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/beforeunload-canceling-1.html new file mode 100644 index 0000000000..6ba1e65740 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/beforeunload-canceling-1.html @@ -0,0 +1,35 @@ + + +Support page for beforeunload-canceling.html + +

If this goes away, it navigated

+ + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/beforeunload-canceling.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/beforeunload-canceling.html new file mode 100644 index 0000000000..29a685fa59 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/beforeunload-canceling.html @@ -0,0 +1,222 @@ + + +beforeunload return value cancelation behavior + + + + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/beforeunload-on-history-back-1.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/beforeunload-on-history-back-1.html new file mode 100644 index 0000000000..4403cfa8e9 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/beforeunload-on-history-back-1.html @@ -0,0 +1,5 @@ + +001-1 + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/beforeunload-on-history-back.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/beforeunload-on-history-back.html new file mode 100644 index 0000000000..5b0415c422 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/beforeunload-on-history-back.html @@ -0,0 +1,31 @@ + +beforeunload event fires on history navigation back + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/beforeunload-on-navigation-of-parent-1.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/beforeunload-on-navigation-of-parent-1.html new file mode 100644 index 0000000000..4f239dad1e --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/beforeunload-on-navigation-of-parent-1.html @@ -0,0 +1,2 @@ + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/beforeunload-on-navigation-of-parent-2.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/beforeunload-on-navigation-of-parent-2.html new file mode 100644 index 0000000000..a34b182e70 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/beforeunload-on-navigation-of-parent-2.html @@ -0,0 +1,4 @@ + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/beforeunload-on-navigation-of-parent.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/beforeunload-on-navigation-of-parent.html new file mode 100644 index 0000000000..96d49567f3 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/beforeunload-on-navigation-of-parent.html @@ -0,0 +1,31 @@ + +beforeunload in iframe on navigation of parent + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/beforeunload-sticky-activation-iframe.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/beforeunload-sticky-activation-iframe.html new file mode 100644 index 0000000000..212a10c005 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/beforeunload-sticky-activation-iframe.html @@ -0,0 +1,25 @@ + + +Beforeunload must be gated behind sticky activation: nested browsing context + + + +

If you happen to be running this test as a human, then be sure not to interact with any part of the page; that would invalidate the results! + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/beforeunload-sticky-activation-manual.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/beforeunload-sticky-activation-manual.html new file mode 100644 index 0000000000..55612bbfc4 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/beforeunload-sticky-activation-manual.html @@ -0,0 +1,17 @@ + + +Beforeunload must be gated behind sticky activation: normal top-level browsing context + +

This test is manual because we want to test non-popup, non-iframe situations. Sibling files contain automated tests for those situations. + +

In three seconds, this document will redirect itself to a new page. The test passes if the redirect succeeds. The test fails if a beforeunload dialog pops up asking for confirmation. + +

Be sure not to interact with any part of the page in the meantime. That would invalidate the results. + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/beforeunload-sticky-activation-popup.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/beforeunload-sticky-activation-popup.html new file mode 100644 index 0000000000..23bf8a440d --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/beforeunload-sticky-activation-popup.html @@ -0,0 +1,24 @@ + + +Beforeunload must be gated behind sticky activation: auxiliary browsing context + + + +

If you happen to be running this test as a human, then be sure not to interact with any part of the page; that would invalidate the results! + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/beforeunload-synchronous.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/beforeunload-synchronous.html new file mode 100644 index 0000000000..6806eaf7a3 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/beforeunload-synchronous.html @@ -0,0 +1,33 @@ + + +beforeunload event is emitted synchronously + + + + + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/navigation-within-beforeunload-1.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/navigation-within-beforeunload-1.html new file mode 100644 index 0000000000..b96234fba2 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/navigation-within-beforeunload-1.html @@ -0,0 +1,10 @@ + +004-1 + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/navigation-within-beforeunload-2.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/navigation-within-beforeunload-2.html new file mode 100644 index 0000000000..2dceaa6d6a --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/navigation-within-beforeunload-2.html @@ -0,0 +1,4 @@ + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/navigation-within-beforeunload.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/navigation-within-beforeunload.html new file mode 100644 index 0000000000..d6ecf5d52f --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/navigation-within-beforeunload.html @@ -0,0 +1,29 @@ + +Triggering navigation from within beforeunload event + + +

+ + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/pagehide-on-history-forward-1.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/pagehide-on-history-forward-1.html new file mode 100644 index 0000000000..a60c20ed80 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/pagehide-on-history-forward-1.html @@ -0,0 +1,2 @@ + +filler text diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/pagehide-on-history-forward.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/pagehide-on-history-forward.html new file mode 100644 index 0000000000..5e64b5ec66 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/pagehide-on-history-forward.html @@ -0,0 +1,19 @@ + +pagehide event fires on history navigation forward + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt-and-unload-script-closeable.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt-and-unload-script-closeable.html new file mode 100644 index 0000000000..b94789c40f --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt-and-unload-script-closeable.html @@ -0,0 +1,23 @@ + +beforeunload and unload events fire after window.close() in script-closeable browsing context + + + +
+ diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt-and-unload-script-uncloseable-1.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt-and-unload-script-uncloseable-1.html new file mode 100644 index 0000000000..3a557ce34e --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt-and-unload-script-uncloseable-1.html @@ -0,0 +1,10 @@ + +script-uncloseable-1 + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt-and-unload-script-uncloseable.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt-and-unload-script-uncloseable.html new file mode 100644 index 0000000000..f6a17d740b --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt-and-unload-script-uncloseable.html @@ -0,0 +1,24 @@ + +beforeunload and unload events do not fire after window.close() in script-uncloseable browsing context + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/001-1.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/001-1.html new file mode 100644 index 0000000000..b68afc49ec --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/001-1.html @@ -0,0 +1,10 @@ + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/001-2.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/001-2.html new file mode 100644 index 0000000000..9da0f9395c --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/001-2.html @@ -0,0 +1 @@ +001-2 diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/001.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/001.html new file mode 100644 index 0000000000..109dcc1393 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/001.html @@ -0,0 +1,14 @@ + +beforeunload event order + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/002-1.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/002-1.html new file mode 100644 index 0000000000..c5f57375da --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/002-1.html @@ -0,0 +1,7 @@ + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/002.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/002.html new file mode 100644 index 0000000000..d8f4fc60a9 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/002.html @@ -0,0 +1,20 @@ + +beforeunload event properties + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/003.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/003.html new file mode 100644 index 0000000000..5683f1b120 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/003.html @@ -0,0 +1,20 @@ + +beforeunload event in child frame for parent navigation + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/004-1.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/004-1.html new file mode 100644 index 0000000000..a3ca82f520 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/004-1.html @@ -0,0 +1,28 @@ + +004-1 + +// child frame with no onbeforeunload listener. Should leave the parent as unsalvageable. +// Adding the iframe prevents potential implementation bugs where the the recursive steps of #prompt-to-unload-a-document +// would overwrite the salvageable state of the parent. + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/004-2.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/004-2.html new file mode 100644 index 0000000000..1a605b1b3d --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/004-2.html @@ -0,0 +1,5 @@ + +004-2 + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/004.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/004.html new file mode 100644 index 0000000000..7076a4dd18 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/004.html @@ -0,0 +1,29 @@ + +salvagable state of document after setting beforeunload listener + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/manual-001.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/manual-001.html new file mode 100644 index 0000000000..3b7ef74b71 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/manual-001.html @@ -0,0 +1,9 @@ + +Prompt when beforeunload is canceled + +

When clicking the link below, you should get a prompt asking if you want to unload the document

+Click here diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/manual-002.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/manual-002.html new file mode 100644 index 0000000000..7be8a3301f --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/manual-002.html @@ -0,0 +1,9 @@ + +Prompt when beforeunload has returnValue set + +

When clicking the link below, you should get a prompt asking if you want to unload the document

+Click here diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/manual-003.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/manual-003.html new file mode 100644 index 0000000000..ff72b67055 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/manual-003.html @@ -0,0 +1,11 @@ + +Prompt when beforeunload is canceled + +

When clicking the button below, you should get a prompt asking if you want to unload the document

+
+ +
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/manual-004.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/manual-004.html new file mode 100644 index 0000000000..a4d2968922 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/manual-004.html @@ -0,0 +1,11 @@ + +Prompt on form submit + +

When clicking the button below, you should get a prompt asking if you want to unload the document

+
+ +
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/manual-005.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/manual-005.html new file mode 100644 index 0000000000..71ff0a241d --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/manual-005.html @@ -0,0 +1,22 @@ + +Event loop pause for beforeunload + +
    +
  • Click on the link below. When the prompt appears the counter at the bottom must stop incrementing. +
  • Opt not to leave the page. The counter must start incrementing again +
+

Click here +

diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/manual-006.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/manual-006.html new file mode 100644 index 0000000000..dae0340ad9 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/manual-006.html @@ -0,0 +1,9 @@ + +Prompt when beforeunload returns string value + +

When clicking the link below, you should get a prompt asking if you want to unload the document

+Click here diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/next.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/next.html new file mode 100644 index 0000000000..38e7cdd5e0 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/prompt/next.html @@ -0,0 +1,2 @@ + +

You should have seen a prompt asking you to unload the previous document diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/001-1.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/001-1.html new file mode 100644 index 0000000000..2a9cab4aa4 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/001-1.html @@ -0,0 +1,23 @@ + + + +

Follow this link to run the test. +

diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/001a.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/001a.html new file mode 100644 index 0000000000..36d4188b9e --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/001a.html @@ -0,0 +1,7 @@ + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/001b.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/001b.html new file mode 100644 index 0000000000..eaafc371a1 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/001b.html @@ -0,0 +1,5 @@ + + +

Inner frame \ No newline at end of file diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/002-1.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/002-1.html new file mode 100644 index 0000000000..017fbb964c --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/002-1.html @@ -0,0 +1,32 @@ + + + + +

diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/002a.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/002a.html new file mode 100644 index 0000000000..51ff3e37b6 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/002a.html @@ -0,0 +1,7 @@ + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/002b.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/002b.html new file mode 100644 index 0000000000..d08a7a8add --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/002b.html @@ -0,0 +1,5 @@ + + +

Inner frame \ No newline at end of file diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/003-1.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/003-1.html new file mode 100644 index 0000000000..b3a4754b85 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/003-1.html @@ -0,0 +1,23 @@ + + + +

Follow this link to run the test. +

diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/003a.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/003a.html new file mode 100644 index 0000000000..5393fa221e --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/003a.html @@ -0,0 +1,8 @@ + +

FAIL

+ diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/003b.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/003b.html new file mode 100644 index 0000000000..c8f1917b85 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/003b.html @@ -0,0 +1,5 @@ + + +

Inner frame \ No newline at end of file diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/004-1.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/004-1.html new file mode 100644 index 0000000000..06aba08af6 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/004-1.html @@ -0,0 +1,25 @@ + + + + +

diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/004a.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/004a.html new file mode 100644 index 0000000000..117e2b94ae --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/004a.html @@ -0,0 +1,8 @@ + +

FAIL

+ diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/004b.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/004b.html new file mode 100644 index 0000000000..788937a0b0 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/004b.html @@ -0,0 +1,18 @@ + + + +

Inner frame \ No newline at end of file diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/005-1.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/005-1.html new file mode 100644 index 0000000000..7b81a9f115 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/005-1.html @@ -0,0 +1,13 @@ + + + +

Follow this link to run the test. +

diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/005a.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/005a.html new file mode 100644 index 0000000000..5185d3b921 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/005a.html @@ -0,0 +1,8 @@ + +

FAIL

+ diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/005b.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/005b.html new file mode 100644 index 0000000000..476e8e38c4 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/005b.html @@ -0,0 +1,17 @@ + + + +

Inner frame diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/beforeunload-sticky-destination.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/beforeunload-sticky-destination.html new file mode 100644 index 0000000000..2edcf1a43b --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/beforeunload-sticky-destination.html @@ -0,0 +1,13 @@ + + +Beforeunload must be gated behind sticky activation: destination page + +

If you reached this page without clicking through a confirmation dialog, then the test has passed! + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/beforeunload-sticky-start.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/beforeunload-sticky-start.html new file mode 100644 index 0000000000..37109feafe --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/support/beforeunload-sticky-start.html @@ -0,0 +1,10 @@ + + +Beforeunload must be gated behind sticky activation: start page + +

This page will immediately navigate. If a beforeunload dialog pops up, the test fails.

+ + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/001-1.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/001-1.html new file mode 100644 index 0000000000..74ba43954b --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/001-1.html @@ -0,0 +1,4 @@ + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/001-2.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/001-2.html new file mode 100644 index 0000000000..90e28ab7fb --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/001-2.html @@ -0,0 +1,2 @@ + +Filler diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/001.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/001.html new file mode 100644 index 0000000000..444a2770c7 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/001.html @@ -0,0 +1,25 @@ + +pagehide event on unload + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/002-1.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/002-1.html new file mode 100644 index 0000000000..fd8e2b7262 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/002-1.html @@ -0,0 +1,4 @@ + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/002.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/002.html new file mode 100644 index 0000000000..d36011286c --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/002.html @@ -0,0 +1,36 @@ + +pagehide event properties + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/003-1.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/003-1.html new file mode 100644 index 0000000000..9838c79456 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/003-1.html @@ -0,0 +1,4 @@ + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/003.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/003.html new file mode 100644 index 0000000000..97821be484 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/003.html @@ -0,0 +1,33 @@ + +unload event properties + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/004-1.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/004-1.html new file mode 100644 index 0000000000..5d0497556b --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/004-1.html @@ -0,0 +1,5 @@ + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/004.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/004.html new file mode 100644 index 0000000000..301baa3b8e --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/004.html @@ -0,0 +1,28 @@ + +pagehide / unload event order + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/006-1.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/006-1.html new file mode 100644 index 0000000000..bc2e10bdc3 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/006-1.html @@ -0,0 +1,23 @@ + +006-1 + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/006-2.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/006-2.html new file mode 100644 index 0000000000..52365e55d8 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/006-2.html @@ -0,0 +1,5 @@ + +006-2 + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/006.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/006.html new file mode 100644 index 0000000000..c9e4d68a10 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/006.html @@ -0,0 +1,18 @@ + +salvagable state of document after setting pagehide listener + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/007-1.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/007-1.html new file mode 100644 index 0000000000..ed19f4498a --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/007-1.html @@ -0,0 +1,21 @@ + +007-1 + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/007-2.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/007-2.html new file mode 100644 index 0000000000..f74cd1e67e --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/007-2.html @@ -0,0 +1,5 @@ + +007-2 + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/007.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/007.html new file mode 100644 index 0000000000..4a2fed5fac --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/007.html @@ -0,0 +1,28 @@ + +salvagable state of document after setting unload listener + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/008-1.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/008-1.html new file mode 100644 index 0000000000..29de29c911 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/008-1.html @@ -0,0 +1,4 @@ + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/008.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/008.html new file mode 100644 index 0000000000..015507d817 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/008.html @@ -0,0 +1,16 @@ + +pagehide IDL attribute + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/009-1.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/009-1.html new file mode 100644 index 0000000000..d69a05914a --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/009-1.html @@ -0,0 +1,4 @@ + + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/009.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/009.html new file mode 100644 index 0000000000..0e93e04701 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/009.html @@ -0,0 +1,16 @@ + +unload IDL attribute + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/pagehide-manual-1.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/pagehide-manual-1.html new file mode 100644 index 0000000000..3da0a0de3e --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/pagehide-manual-1.html @@ -0,0 +1,2 @@ + +

Now go back. PASS should be displayed after a short pause diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/pagehide-manual.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/pagehide-manual.html new file mode 100644 index 0000000000..ba34c3087f --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/pagehide-manual.html @@ -0,0 +1,5 @@ + +Document salvagable state after setting pagehide handler + +

Click the link below then navigate back to this page. Shortly after returning you should see the text "PASS"

+

Click here diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/unload-main-frame-cross-origin.window.js b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/unload-main-frame-cross-origin.window.js new file mode 100644 index 0000000000..65b4e533f6 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/unload-main-frame-cross-origin.window.js @@ -0,0 +1,34 @@ +// META: title=Unload runs in main frame when navigating cross-origin. +// META: script=/common/dispatcher/dispatcher.js +// META: script=/common/get-host-info.sub.js +// META: script=/common/utils.js +// META: script=/html/browsers/browsing-the-web/remote-context-helper/resources/remote-context-helper.js + +promise_test(async t => { + const rcHelper = new RemoteContextHelper(); + + const rc1 = await rcHelper.addWindow(); + + t.add_cleanup(() => localStorage.removeItem('unload')); + + // Initialize storage and add "unload" event handler. + await rc1.executeScript(() => { + localStorage.setItem('unload', 'not yet'); + addEventListener('unload', () => { + localStorage.setItem('unload', 'ran'); + }); + }); + + // Navigate away. + const rc2 = await rc1.navigateToNew( + {extraRemoteContextConfig: {origin: 'HTTP_REMOTE_ORIGIN'}}); + + // Navigate back. + await rc2.historyBack(); + + // Test that the unload handler wrote to storage. + // Running it in the remote context after going back should ensure that the + // navigation (and therefore the unload handler) has completed. + assert_equals( + await rc1.executeScript(() => localStorage.getItem('unload')), 'ran'); +}); diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/unload-main-frame-same-origin.window.js b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/unload-main-frame-same-origin.window.js new file mode 100644 index 0000000000..5a95455c4c --- /dev/null +++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/unload/unload-main-frame-same-origin.window.js @@ -0,0 +1,33 @@ +// META: title=Unload runs in main frame when navigating same-origin. +// META: script=/common/dispatcher/dispatcher.js +// META: script=/common/get-host-info.sub.js +// META: script=/common/utils.js +// META: script=/html/browsers/browsing-the-web/remote-context-helper/resources/remote-context-helper.js + +promise_test(async t => { + const rcHelper = new RemoteContextHelper(); + + const rc1 = await rcHelper.addWindow(); + + t.add_cleanup(() => localStorage.removeItem('unload')); + + // Initialize storage and add "unload" event handler. + await rc1.executeScript(() => { + localStorage.setItem('unload', 'not yet'); + addEventListener('unload', () => { + localStorage.setItem('unload', 'ran'); + }); + }); + + // Navigate away. + const rc2 = await rc1.navigateToNew(); + + // Navigate back. + await rc2.historyBack(); + + // Test that the unload handler wrote to storage. + // Running it in the remote context after going back should ensure that the + // navigation (and therefore the unload handler) has completed. + assert_equals( + await rc1.executeScript(() => localStorage.getItem('unload')), 'ran'); +}); diff --git a/testing/web-platform/tests/html/browsers/history/joint-session-history/joint-session-history-child1.html b/testing/web-platform/tests/html/browsers/history/joint-session-history/joint-session-history-child1.html new file mode 100644 index 0000000000..22bb0b2980 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/joint-session-history/joint-session-history-child1.html @@ -0,0 +1,18 @@ + + Child1. + + + diff --git a/testing/web-platform/tests/html/browsers/history/joint-session-history/joint-session-history-child2.html b/testing/web-platform/tests/html/browsers/history/joint-session-history/joint-session-history-child2.html new file mode 100644 index 0000000000..24b4695166 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/joint-session-history/joint-session-history-child2.html @@ -0,0 +1,5 @@ +Child 2. + diff --git a/testing/web-platform/tests/html/browsers/history/joint-session-history/joint-session-history-filler.html b/testing/web-platform/tests/html/browsers/history/joint-session-history/joint-session-history-filler.html new file mode 100644 index 0000000000..b6d47c310b --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/joint-session-history/joint-session-history-filler.html @@ -0,0 +1 @@ +Filler diff --git a/testing/web-platform/tests/html/browsers/history/joint-session-history/joint-session-history-grandchild1.html b/testing/web-platform/tests/html/browsers/history/joint-session-history/joint-session-history-grandchild1.html new file mode 100644 index 0000000000..d05e152425 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/joint-session-history/joint-session-history-grandchild1.html @@ -0,0 +1,8 @@ + + Grandchild1. + + diff --git a/testing/web-platform/tests/html/browsers/history/joint-session-history/joint-session-history-grandchild2.html b/testing/web-platform/tests/html/browsers/history/joint-session-history/joint-session-history-grandchild2.html new file mode 100644 index 0000000000..b5c81e1fca --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/joint-session-history/joint-session-history-grandchild2.html @@ -0,0 +1,5 @@ +Grandchild2. + diff --git a/testing/web-platform/tests/html/browsers/history/joint-session-history/joint-session-history-iframe-state.html b/testing/web-platform/tests/html/browsers/history/joint-session-history/joint-session-history-iframe-state.html new file mode 100644 index 0000000000..ffa64c0b35 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/joint-session-history/joint-session-history-iframe-state.html @@ -0,0 +1,41 @@ + + +Joint session history should not override parent's state. + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/history/joint-session-history/joint-session-history-only-fully-active.html b/testing/web-platform/tests/html/browsers/history/joint-session-history/joint-session-history-only-fully-active.html new file mode 100644 index 0000000000..c42d160a21 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/joint-session-history/joint-session-history-only-fully-active.html @@ -0,0 +1,30 @@ + + +Do only fully active documents count for session history? + + + + + + diff --git a/testing/web-platform/tests/html/browsers/history/joint-session-history/joint-session-history-remove-iframe.html b/testing/web-platform/tests/html/browsers/history/joint-session-history/joint-session-history-remove-iframe.html new file mode 100644 index 0000000000..ee7aa368af --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/joint-session-history/joint-session-history-remove-iframe.html @@ -0,0 +1,24 @@ + + +Joint session history length does not include entries from a removed iframe. + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/001.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/001.html new file mode 100644 index 0000000000..16cb834c78 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/001.html @@ -0,0 +1,339 @@ + + + + history.pushState tests + + + + + + +

Enable JavaScript and reload

+

WARNING: This test should always be loaded in a new tab/window, to avoid browsers attempting to recover the state of frames, and history length. Do not reload the test.

+
Running test...
+

+

+

+

+ + + diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/002.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/002.html new file mode 100644 index 0000000000..8bce7e72ff --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/002.html @@ -0,0 +1,318 @@ + + + + history.replaceState tests + + + + + + + +

WARNING: This test should always be loaded in a new tab/window, to avoid browsers attempting to recover the state of frames, and history length. Do not reload the test.

+
Running test...
+

+

+

+

+ + + diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/004.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/004.html new file mode 100644 index 0000000000..e69889724f --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/004.html @@ -0,0 +1,62 @@ + + + + Final history position for history.go should be calculated when executing the task + + + + + + + +
+ + + diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/005.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/005.html new file mode 100644 index 0000000000..2152e85a3e --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/005.html @@ -0,0 +1,47 @@ + + + + Popstate event listener registration + + + + + + + +
+ + + diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/006.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/006.html new file mode 100644 index 0000000000..442b6f8f1e --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/006.html @@ -0,0 +1,53 @@ + + + + Firing popstate after onload, even if there is no pushed/replaced state + + + + + + + +
+ + + diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/007.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/007.html new file mode 100644 index 0000000000..decb197624 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/007.html @@ -0,0 +1,66 @@ + + + + Firing popstate after onload with pushed state + + + + + + + +
It looks like the browser stopped loading the page when encountering a .go(-1) command pointing to a pushed state. This will break the tests.
+ + + + + + + diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/008.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/008.html new file mode 100644 index 0000000000..c8071e3156 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/008.html @@ -0,0 +1,40 @@ + + + + + + + history.pushState/replaceState resolving + + + + + +

+ +
+ + + + diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/008.js b/testing/web-platform/tests/html/browsers/history/the-history-interface/008.js new file mode 100644 index 0000000000..96a1fe5d4a --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/008.js @@ -0,0 +1,11 @@ +var beforehref = location.href; + +test(function () { + history.pushState('','','/testing_ignore_me_404'); + assert_equals(location.href,beforehref.replace(/^(\w*:\/\/[^\/]*\/)[\w\W]*$/,'$1testing_ignore_me_404')); +}, 'history.pushState URL resolving should be done relative to the document, not the script'); + +test(function () { + history.replaceState('','','/testing_ignore_me_404_2'); + assert_equals(location.href,beforehref.replace(/^(\w*:\/\/[^\/]*\/)[\w\W]*$/,'$1testing_ignore_me_404_2')); +}, 'history.replaceState URL resolving should be done relative to the document, not the script'); diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/009-1.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/009-1.html new file mode 100644 index 0000000000..00b72e8ec6 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/009-1.html @@ -0,0 +1,20 @@ + + + + history.pushState/replaceState and referer headers + + + + +
+ + + + diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/009-3.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/009-3.html new file mode 100644 index 0000000000..e58b8fa5e7 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/009-3.html @@ -0,0 +1,28 @@ + + + + history.pushState/replaceState and referer headers + + + + +
+ + + + diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/009-5.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/009-5.html new file mode 100644 index 0000000000..068a089af4 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/009-5.html @@ -0,0 +1,23 @@ + + + + history.pushState/replaceState and referer headers + + + + +
+ + + + diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/009.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/009.html new file mode 100644 index 0000000000..c1ae0bbe03 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/009.html @@ -0,0 +1,22 @@ + + + + history.pushState/replaceState and referer headers + + + + + + +
+ + + + diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/010-1.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/010-1.html new file mode 100644 index 0000000000..683397745c --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/010-1.html @@ -0,0 +1,16 @@ + + + + history.pushState/replaceState and referer headers (before onload) + + + + +
+ + + + diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/010-3.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/010-3.html new file mode 100644 index 0000000000..b80f56c3dd --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/010-3.html @@ -0,0 +1,24 @@ + + + + history.pushState/replaceState and referer headers (before onload) + + + + +
+ + + + diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/010-5.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/010-5.html new file mode 100644 index 0000000000..d150449eb2 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/010-5.html @@ -0,0 +1,23 @@ + + + + history.pushState/replaceState and referer headers (before onload) + + + + +
+ + + + diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/010.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/010.html new file mode 100644 index 0000000000..ca109a744b --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/010.html @@ -0,0 +1,22 @@ + + + + history.pushState/replaceState and referer headers (before onload) + + + + + + +
+ + + + diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/011.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/011.html new file mode 100644 index 0000000000..4043aff7fd --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/011.html @@ -0,0 +1,32 @@ + + + + history.pushState before onload + + + + + + +
+ + + + diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/012.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/012.html new file mode 100644 index 0000000000..f5e6251671 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/012.html @@ -0,0 +1,32 @@ + + + + history.replaceState before onload + + + + + + +
+ + + + diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/blank-new.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/blank-new.html new file mode 100644 index 0000000000..2a545af0ed --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/blank-new.html @@ -0,0 +1,5 @@ + + + New page + +This is a new page. diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/blank-old.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/blank-old.html new file mode 100644 index 0000000000..a77c00fcc6 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/blank-old.html @@ -0,0 +1,5 @@ + + + Old page + +This is an old page. diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/blank.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/blank.html new file mode 100644 index 0000000000..89c8724c09 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/blank.html @@ -0,0 +1,8 @@ + + + + Dummy page 1 + + + + \ No newline at end of file diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/blank2.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/blank2.html new file mode 100644 index 0000000000..f79982e328 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/blank2.html @@ -0,0 +1,13 @@ + + + + Dummy page 2 + + + + + \ No newline at end of file diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/blank3.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/blank3.html new file mode 100644 index 0000000000..2a8989f272 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/blank3.html @@ -0,0 +1,11 @@ + + + + Dummy page 3 + + + + + \ No newline at end of file diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/combination_history_001.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/combination_history_001.html new file mode 100644 index 0000000000..21ba22f6fe --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/combination_history_001.html @@ -0,0 +1,20 @@ + + + + combination_history_001(Combine pushState and replaceSate methods.) + + + + +
+ + + diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/combination_history_002.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/combination_history_002.html new file mode 100644 index 0000000000..29e82f51be --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/combination_history_002.html @@ -0,0 +1,22 @@ + + + + combination_history_002(After calling of pushState method, check length.) + + + + +
+ + + diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/combination_history_003.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/combination_history_003.html new file mode 100644 index 0000000000..7467d9b294 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/combination_history_003.html @@ -0,0 +1,26 @@ + + + + combination_history_003(After calling of pushState and replaceState methods, check length.) + + + + +
+ + + diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/combination_history_004.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/combination_history_004.html new file mode 100644 index 0000000000..4e38b56205 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/combination_history_004.html @@ -0,0 +1,29 @@ + + + + combination_history_004(After calling of back method, check length.) + + + + +
+ + + diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/combination_history_005.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/combination_history_005.html new file mode 100644 index 0000000000..4487678015 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/combination_history_005.html @@ -0,0 +1,34 @@ + + + + combination_history_005(After calling of forward method, check length.) + + + + +
+ + + diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/combination_history_006.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/combination_history_006.html new file mode 100644 index 0000000000..305f593c09 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/combination_history_006.html @@ -0,0 +1,30 @@ + + + + combination_history_006(After calling of go method, check length.) + + + + +
+ + + diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/combination_history_007.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/combination_history_007.html new file mode 100644 index 0000000000..cec9ea0981 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/combination_history_007.html @@ -0,0 +1,32 @@ + + + + combination_history_007(After calling of back and pushState method, check length.) + + + + +
+ + + diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/history-associated-with-document.window.js b/testing/web-platform/tests/html/browsers/history/the-history-interface/history-associated-with-document.window.js new file mode 100644 index 0000000000..94c1b2cf6b --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/history-associated-with-document.window.js @@ -0,0 +1,6 @@ +// META: title=the History object must be associated with the Document object, not the Window object +// META: script=/common/object-association.js + +// See https://github.com/whatwg/html/issues/2566. + +testIsPerDocument("history"); diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/history-state-after-bfcache.window.js b/testing/web-platform/tests/html/browsers/history/the-history-interface/history-state-after-bfcache.window.js new file mode 100644 index 0000000000..5f04890a72 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/history-state-after-bfcache.window.js @@ -0,0 +1,43 @@ +// META: title=Navigating back to a bfcached page does not reset history.state +// META: script=/common/dispatcher/dispatcher.js +// META: script=/common/utils.js +// META: script=/html/browsers/browsing-the-web/remote-context-helper/resources/remote-context-helper.js + +// See https://github.com/whatwg/html/issues/6652. + +'use strict'; + +promise_test(async t => { + const rcHelper = new RemoteContextHelper(); + + // Open a window with noopener so that BFCache will work. + const rc = await rcHelper.addWindow(null, { features: "noopener" }); + + // Add a pageshow listener to stash the event, and set history.state using replaceState(). + await rc.executeScript(() => { + window.addEventListener('pageshow', (event) => { + window.pageshowEvent = event; + }); + + history.replaceState({ foo: 'bar' }, '', ''); + window.stashedHistoryState = history.state; + }); + + const rc2 = await rc.navigateToNew(); + await rc2.historyBack(); + + assert_implements_optional( + await rc.executeScript(() => window.pageshowEvent.persisted), + 'precondition: document was bfcached' + ); + + assert_equals( + await rc.executeScript(() => history.state.foo), + 'bar', + 'history.state was restored correctly' + ); + + assert_true( + await rc.executeScript(() => window.stashedHistoryState === history.state), + 'history.state did not get serialized and deserialized'); +}); diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/history.js b/testing/web-platform/tests/html/browsers/history/the-history-interface/history.js new file mode 100644 index 0000000000..bb5ee6dde0 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/history.js @@ -0,0 +1,35 @@ +function parse_query() { + var query = location.search.slice(1); + var vars = query.split("&"); + var fields = {}; + vars.forEach( + function (x) { + var split = x.split("="); + return fields[split[0]] = split.slice(1).join("="); + }); + return fields; +} + +var query_parts = parse_query(); +var id = "id" in query_parts ? parseInt(query_parts.id) : 1; +var urls_to_load = query_parts.urls.split(","); + +document.write(id); + +onunload = function() {}; + +function queue_next() { + t = opener.t; + setTimeout(t.step_func( + function() { +// opener.assert_equals(history.length, id); + if (urls_to_load[0]) { + var next_page = urls_to_load[0]; + (next_page.indexOf("?") > -1) ? (next_page += "&") : (next_page += "?"); + next_page += "urls=" + urls_to_load.slice(1).join(","); + next_page += "&id=" + ++id; + location = next_page; + } + } + ), 100); +} diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/history_back-1.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_back-1.html new file mode 100644 index 0000000000..5487786fc0 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_back-1.html @@ -0,0 +1,15 @@ + + + diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/history_back.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_back.html new file mode 100644 index 0000000000..042da4e61b --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_back.html @@ -0,0 +1,27 @@ + + + + history_back + + + + +
+ + + diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/history_back_1.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_back_1.html new file mode 100644 index 0000000000..0af3206643 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_back_1.html @@ -0,0 +1,26 @@ + +history.back() with session history + + +
+ diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/history_back_cross_realm_method.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_back_cross_realm_method.html new file mode 100644 index 0000000000..47937ef583 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_back_cross_realm_method.html @@ -0,0 +1,22 @@ + + +history.back() uses this's associated document's browsing context to determine if navigation is allowed + + + + + + diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/history_entry.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_entry.html new file mode 100644 index 0000000000..308371c57d --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_entry.html @@ -0,0 +1,11 @@ + + + diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/history_forward-1.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_forward-1.html new file mode 100644 index 0000000000..1bf7d6ee3b --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_forward-1.html @@ -0,0 +1,14 @@ + + + diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/history_forward-2.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_forward-2.html new file mode 100644 index 0000000000..cf8a8d20cd --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_forward-2.html @@ -0,0 +1,15 @@ + + + diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/history_forward.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_forward.html new file mode 100644 index 0000000000..6c37f25215 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_forward.html @@ -0,0 +1,32 @@ + + + + history_forward + + + + +
+ + + diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/history_forward_1.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_forward_1.html new file mode 100644 index 0000000000..7817649f3a --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_forward_1.html @@ -0,0 +1,26 @@ + +history.forward() with session history + + +
+ diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/history_forward_cross_realm_method.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_forward_cross_realm_method.html new file mode 100644 index 0000000000..7456099b8f --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_forward_cross_realm_method.html @@ -0,0 +1,28 @@ + + +history.forward() uses this's associated document's browsing context to determine if navigation is allowed + + + + + + diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/history_go_cross_realm_method.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_go_cross_realm_method.html new file mode 100644 index 0000000000..d8852b9f6f --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_go_cross_realm_method.html @@ -0,0 +1,23 @@ + + +history.go() uses this's associated document's browsing context to determine if navigation is allowed + + + + + + diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/history_go_minus.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_go_minus.html new file mode 100644 index 0000000000..b8fe75573d --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_go_minus.html @@ -0,0 +1,27 @@ + + + + history_go_minus + + + + +
+ + + diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/history_go_no_argument-1.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_go_no_argument-1.html new file mode 100644 index 0000000000..6a2212f34b --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_go_no_argument-1.html @@ -0,0 +1,17 @@ + + + diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/history_go_no_argument.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_go_no_argument.html new file mode 100644 index 0000000000..11f41614bd --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_go_no_argument.html @@ -0,0 +1,27 @@ + +history.go() + + +
+ diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/history_go_plus.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_go_plus.html new file mode 100644 index 0000000000..74d4c588ca --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_go_plus.html @@ -0,0 +1,33 @@ + + + + history_go_plus + + + + +
+ + + diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/history_go_to_uri-1.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_go_to_uri-1.html new file mode 100644 index 0000000000..49249ff000 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_go_to_uri-1.html @@ -0,0 +1,22 @@ + + + diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/history_go_to_uri.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_go_to_uri.html new file mode 100644 index 0000000000..e0a891a5a2 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_go_to_uri.html @@ -0,0 +1,30 @@ + +history.go() negative tests + + + + + +
+ diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/history_go_undefined-1.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_go_undefined-1.html new file mode 100644 index 0000000000..1bf7d6ee3b --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_go_undefined-1.html @@ -0,0 +1,14 @@ + + + diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/history_go_undefined.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_go_undefined.html new file mode 100644 index 0000000000..ddc0f588b5 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_go_undefined.html @@ -0,0 +1,26 @@ + +history.forward() with session history + + +
+ diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/history_go_zero-1.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_go_zero-1.html new file mode 100644 index 0000000000..17e520a810 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_go_zero-1.html @@ -0,0 +1,17 @@ + + + diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/history_go_zero.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_go_zero.html new file mode 100644 index 0000000000..b071b580c3 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_go_zero.html @@ -0,0 +1,27 @@ + +history.go(0) + + +
+ diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/history_go_zero_which_document.window.js b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_go_zero_which_document.window.js new file mode 100644 index 0000000000..f697783f3e --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_go_zero_which_document.window.js @@ -0,0 +1,27 @@ +// META: title=history.go(0) on an iframe must reload the iframe's document, not the parent document +// META: script=/common/dispatcher/dispatcher.js +// META: script=/common/utils.js +// META: script=/html/browsers/browsing-the-web/remote-context-helper/resources/remote-context-helper.js + +promise_test(async () => { + const rcHelper = new RemoteContextHelper(); + const main = await rcHelper.addWindow(); + await main.addIframe(); + + await main.executeScript(() => { + window.didNotGetReloaded = true; + + const iframe = document.querySelector("iframe"); + + // This goes beyond the original test case in https://github.com/whatwg/html/issues/2436, and + // tests where current realm != relevant realm. The spec says to use relevant realm so the + // result is still, iframe must reload, not parent. + History.prototype.go.call(iframe.contentWindow.history, 0); + + return new Promise(resolve => { + iframe.addEventListener("load", resolve); + }); + }); + + assert_true(await main.executeScript(() => window.didNotGetReloaded)); +}); diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/history_properties_only_fully_active.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_properties_only_fully_active.html new file mode 100644 index 0000000000..2b2c308526 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_properties_only_fully_active.html @@ -0,0 +1,23 @@ + +history properties should throw SecurityError when not in a fully active Document + + + + + + diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/history_pushstate.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_pushstate.html new file mode 100644 index 0000000000..5180a3f6e5 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_pushstate.html @@ -0,0 +1,19 @@ + + + + history_pushState + + + + +
+ + + diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/history_pushstate_err.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_pushstate_err.html new file mode 100644 index 0000000000..6fa0a8589d --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_pushstate_err.html @@ -0,0 +1,18 @@ + + + + history_pushState SECURITY_ERR + + + + +
+ + + diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/history_pushstate_nooptionalparam.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_pushstate_nooptionalparam.html new file mode 100644 index 0000000000..8e4b049a19 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_pushstate_nooptionalparam.html @@ -0,0 +1,20 @@ + + + + history_pushState_NoOptionalParam + + + + +
+ + + diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/history_pushstate_url.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_pushstate_url.html new file mode 100644 index 0000000000..cfbca35bfd --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_pushstate_url.html @@ -0,0 +1,24 @@ + + + + +History pushState sets the url + + + + +
+ + + diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/history_pushstate_url_rewriting.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_pushstate_url_rewriting.html new file mode 100644 index 0000000000..03c2afe8ea --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_pushstate_url_rewriting.html @@ -0,0 +1,176 @@ + + +URL rewriting allowed/disallowed for history.pushState() + + + + + + diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/history_replacestate.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_replacestate.html new file mode 100644 index 0000000000..794c2f3713 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_replacestate.html @@ -0,0 +1,20 @@ + + + + history_replaceState + + + + +
+ + + diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/history_replacestate_err.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_replacestate_err.html new file mode 100644 index 0000000000..15d2181820 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_replacestate_err.html @@ -0,0 +1,18 @@ + + + + history_replaceState SECURITY_ERR + + + + +
+ + + diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/history_replacestate_nooptionalparam.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_replacestate_nooptionalparam.html new file mode 100644 index 0000000000..838467d782 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_replacestate_nooptionalparam.html @@ -0,0 +1,20 @@ + + + + history_replaceStateNoOptionalParam + + + + +
+ + + diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/history_state.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_state.html new file mode 100644 index 0000000000..2ee2356b1a --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_state.html @@ -0,0 +1,24 @@ + + + + history_state + + + + +
+ + + diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/iframe_history_go_0.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/iframe_history_go_0.html new file mode 100644 index 0000000000..f93f4c864e --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/iframe_history_go_0.html @@ -0,0 +1,40 @@ + + + iframe_history_go_0 + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/joint_session_history/001-1.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/joint_session_history/001-1.html new file mode 100644 index 0000000000..9aa5d30d16 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/joint_session_history/001-1.html @@ -0,0 +1,72 @@ + + + + diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/joint_session_history/001.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/joint_session_history/001.html new file mode 100644 index 0000000000..c9d1c6416d --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/joint_session_history/001.html @@ -0,0 +1,18 @@ + +Joint session history with single iframe + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/joint_session_history/002-1.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/joint_session_history/002-1.html new file mode 100644 index 0000000000..ed69d679da --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/joint_session_history/002-1.html @@ -0,0 +1,35 @@ + + + + diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/joint_session_history/002.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/joint_session_history/002.html new file mode 100644 index 0000000000..b08c19e52d --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/joint_session_history/002.html @@ -0,0 +1,18 @@ + +Joint session history with single iframe + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/joint_session_history/filler.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/joint_session_history/filler.html new file mode 100644 index 0000000000..93e3c7ccfc --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/joint_session_history/filler.html @@ -0,0 +1,5 @@ + + diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/non-automated/history.js b/testing/web-platform/tests/html/browsers/history/the-history-interface/non-automated/history.js new file mode 100644 index 0000000000..bb5ee6dde0 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/non-automated/history.js @@ -0,0 +1,35 @@ +function parse_query() { + var query = location.search.slice(1); + var vars = query.split("&"); + var fields = {}; + vars.forEach( + function (x) { + var split = x.split("="); + return fields[split[0]] = split.slice(1).join("="); + }); + return fields; +} + +var query_parts = parse_query(); +var id = "id" in query_parts ? parseInt(query_parts.id) : 1; +var urls_to_load = query_parts.urls.split(","); + +document.write(id); + +onunload = function() {}; + +function queue_next() { + t = opener.t; + setTimeout(t.step_func( + function() { +// opener.assert_equals(history.length, id); + if (urls_to_load[0]) { + var next_page = urls_to_load[0]; + (next_page.indexOf("?") > -1) ? (next_page += "&") : (next_page += "?"); + next_page += "urls=" + urls_to_load.slice(1).join(","); + next_page += "&id=" + ++id; + location = next_page; + } + } + ), 100); +} diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/non-automated/history_entry.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/non-automated/history_entry.html new file mode 100644 index 0000000000..e5929ddbe8 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/non-automated/history_entry.html @@ -0,0 +1,12 @@ + + + diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/non-automated/traverse_the_history_unload_prompt_1-1.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/non-automated/traverse_the_history_unload_prompt_1-1.html new file mode 100644 index 0000000000..8c4401836a --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/non-automated/traverse_the_history_unload_prompt_1-1.html @@ -0,0 +1,18 @@ + + + +

You should see/have seen a prompt asking if you want to leave the page.

+

Opt to stay on the page

+ diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/non-automated/traverse_the_history_unload_prompt_1-manual.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/non-automated/traverse_the_history_unload_prompt_1-manual.html new file mode 100644 index 0000000000..587cdfb124 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/non-automated/traverse_the_history_unload_prompt_1-manual.html @@ -0,0 +1,31 @@ + +Traversing the history, prompt in before unload, navigation denied + + +
+ diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/non-automated/traverse_the_history_unload_prompt_2-1.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/non-automated/traverse_the_history_unload_prompt_2-1.html new file mode 100644 index 0000000000..608a579e69 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/non-automated/traverse_the_history_unload_prompt_2-1.html @@ -0,0 +1,18 @@ + + + +

You should see/have seen a prompt asking if you want to leave the page.

+

Opt to leave the page

+

If you weren't navigated away after opting to leave the page, that's a FAIL

diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/non-automated/traverse_the_history_unload_prompt_2-manual.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/non-automated/traverse_the_history_unload_prompt_2-manual.html new file mode 100644 index 0000000000..94b66f8b55 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/non-automated/traverse_the_history_unload_prompt_2-manual.html @@ -0,0 +1,31 @@ + +Traversing the history, prompt in before unload, navigation allowed + + +
+ diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/non-automated/traverse_the_session_history_unload_prompt_1-1.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/non-automated/traverse_the_session_history_unload_prompt_1-1.html new file mode 100644 index 0000000000..c0079b6bec --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/non-automated/traverse_the_session_history_unload_prompt_1-1.html @@ -0,0 +1,17 @@ + + + diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/non-automated/traverse_the_session_history_unload_prompt_1-manual.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/non-automated/traverse_the_session_history_unload_prompt_1-manual.html new file mode 100644 index 0000000000..7f96a39240 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/non-automated/traverse_the_session_history_unload_prompt_1-manual.html @@ -0,0 +1,30 @@ + +Traversing the history, unload event is fired on doucment + + +
+ diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/pushstate-replacestate-empty-string/pushstate-base.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/pushstate-replacestate-empty-string/pushstate-base.html new file mode 100644 index 0000000000..ea95d812d7 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/pushstate-replacestate-empty-string/pushstate-base.html @@ -0,0 +1,18 @@ + + +history.pushState() with an empty string URL and base URL different from document's URL + + + + + + diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/pushstate-replacestate-empty-string/pushstate-whitespace.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/pushstate-replacestate-empty-string/pushstate-whitespace.html new file mode 100644 index 0000000000..72d9be6a9c --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/pushstate-replacestate-empty-string/pushstate-whitespace.html @@ -0,0 +1,20 @@ + + +history.pushState() with a whitespace URL + + + + + diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/pushstate-replacestate-empty-string/pushstate.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/pushstate-replacestate-empty-string/pushstate.html new file mode 100644 index 0000000000..1953709269 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/pushstate-replacestate-empty-string/pushstate.html @@ -0,0 +1,17 @@ + + +history.pushState() with an empty string URL + + + + + diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/pushstate-replacestate-empty-string/replacestate-base.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/pushstate-replacestate-empty-string/replacestate-base.html new file mode 100644 index 0000000000..224e928de6 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/pushstate-replacestate-empty-string/replacestate-base.html @@ -0,0 +1,18 @@ + + +history.replaceState() with an empty string URL and base URL different from document's URL + + + + + + diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/pushstate-replacestate-empty-string/replacestate-whitespace.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/pushstate-replacestate-empty-string/replacestate-whitespace.html new file mode 100644 index 0000000000..7261cdf3fa --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/pushstate-replacestate-empty-string/replacestate-whitespace.html @@ -0,0 +1,20 @@ + + +history.replaceState() with a whitespace URL + + + + + diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/pushstate-replacestate-empty-string/replacestate.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/pushstate-replacestate-empty-string/replacestate.html new file mode 100644 index 0000000000..66b4cc6f82 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/pushstate-replacestate-empty-string/replacestate.html @@ -0,0 +1,17 @@ + + +history.replaceState() with an empty string URL + + + + + diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/resources/message-opener.sub.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/resources/message-opener.sub.html new file mode 100644 index 0000000000..441c08c0ea --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/resources/message-opener.sub.html @@ -0,0 +1,8 @@ + + + + diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/resources/traverse-during-beforeunload.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/resources/traverse-during-beforeunload.html new file mode 100644 index 0000000000..53a4a1886e --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/resources/traverse-during-beforeunload.html @@ -0,0 +1,12 @@ + + + + diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/resources/traverse-during-unload.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/resources/traverse-during-unload.html new file mode 100644 index 0000000000..d5ffb7abae --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/resources/traverse-during-unload.html @@ -0,0 +1,12 @@ + + + + diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/resources/url-rewriting-helper.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/resources/url-rewriting-helper.html new file mode 100644 index 0000000000..847d16cd1a --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/resources/url-rewriting-helper.html @@ -0,0 +1,12 @@ + + diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse-during-beforeunload.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse-during-beforeunload.html new file mode 100644 index 0000000000..cb8cdca7ff --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse-during-beforeunload.html @@ -0,0 +1,28 @@ + + +Traversing the history during beforeunload + + + + + diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse-during-unload.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse-during-unload.html new file mode 100644 index 0000000000..6f6e984402 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse-during-unload.html @@ -0,0 +1,28 @@ + + +Traversing the history during unload + + + + + diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_1-1.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_1-1.html new file mode 100644 index 0000000000..13e89e7bc0 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_1-1.html @@ -0,0 +1,16 @@ + +4 + diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_1.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_1.html new file mode 100644 index 0000000000..9b59bb0587 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_1.html @@ -0,0 +1,25 @@ + +Multiple history traversals from the same task + + +
+ diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_2-1.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_2-1.html new file mode 100644 index 0000000000..fecf060eb7 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_2-1.html @@ -0,0 +1,15 @@ + + + diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_2.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_2.html new file mode 100644 index 0000000000..429a97d835 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_2.html @@ -0,0 +1,26 @@ + +Multiple history traversals, last would be aborted + + +
+ diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_3-1.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_3-1.html new file mode 100644 index 0000000000..e7836fedbe --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_3-1.html @@ -0,0 +1,15 @@ + + + diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_3.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_3.html new file mode 100644 index 0000000000..429a97d835 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_3.html @@ -0,0 +1,26 @@ + +Multiple history traversals, last would be aborted + + +
+ diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_4-1.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_4-1.html new file mode 100644 index 0000000000..9211da1172 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_4-1.html @@ -0,0 +1,15 @@ + + + diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_4.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_4.html new file mode 100644 index 0000000000..136093a2c1 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_4.html @@ -0,0 +1,26 @@ + +Multiple history traversals, last would be aborted + + +
+ diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_5-1.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_5-1.html new file mode 100644 index 0000000000..6a28a85683 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_5-1.html @@ -0,0 +1,15 @@ + + + diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_5.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_5.html new file mode 100644 index 0000000000..4d3d643425 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_5.html @@ -0,0 +1,26 @@ + +Multiple history traversals, last would be aborted + + +
+ diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_unload_1-1.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_unload_1-1.html new file mode 100644 index 0000000000..b9d8a0c694 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_unload_1-1.html @@ -0,0 +1,15 @@ + + + diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_unload_1.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_unload_1.html new file mode 100644 index 0000000000..4ef0ea583d --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_unload_1.html @@ -0,0 +1,28 @@ + +Traversing the history, unload event is fired on doucment + + +
+ diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_write_after_load_1-1.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_write_after_load_1-1.html new file mode 100644 index 0000000000..945c8d81f8 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_write_after_load_1-1.html @@ -0,0 +1,12 @@ + +2 + diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_write_after_load_1.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_write_after_load_1.html new file mode 100644 index 0000000000..404d61d0cf --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_write_after_load_1.html @@ -0,0 +1,29 @@ + +Traverse the history after document.write after the load event + + +
+ diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_write_after_load_2-1.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_write_after_load_2-1.html new file mode 100644 index 0000000000..922e1832a6 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_write_after_load_2-1.html @@ -0,0 +1,9 @@ + +3 + diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_write_after_load_2.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_write_after_load_2.html new file mode 100644 index 0000000000..7372e9f4ae --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_write_after_load_2.html @@ -0,0 +1,24 @@ + +Traverse the history back and forward when a history entry is written after the load event + + +
+ diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_write_onload_1-1.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_write_onload_1-1.html new file mode 100644 index 0000000000..70d946c818 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_write_onload_1-1.html @@ -0,0 +1,9 @@ + +2 + diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_write_onload_1.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_write_onload_1.html new file mode 100644 index 0000000000..febb4334da --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_write_onload_1.html @@ -0,0 +1,27 @@ + +Traverse the history when a history entry is written in the load event + + +
+ diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_write_onload_2-1.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_write_onload_2-1.html new file mode 100644 index 0000000000..2716514109 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_write_onload_2-1.html @@ -0,0 +1,9 @@ + +3 + diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_write_onload_2.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_write_onload_2.html new file mode 100644 index 0000000000..aa97d22c02 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/traverse_the_history_write_onload_2.html @@ -0,0 +1,27 @@ + +Traverse the history back and forward when a history entry is written in the load event + + +
+ diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/allow_prototype_cycle_through_location.sub.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/allow_prototype_cycle_through_location.sub.html new file mode 100644 index 0000000000..f72ed1eaf2 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/allow_prototype_cycle_through_location.sub.html @@ -0,0 +1,197 @@ + + + + + + Location objects' custom [[GetPrototypeOf]] trap permit [[Prototype]] chain cycles to be created through them + + + + + + + + + +
+ +
+ + + + + + + diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/assign_after_load-1.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/assign_after_load-1.html new file mode 100644 index 0000000000..3d2b897221 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/assign_after_load-1.html @@ -0,0 +1,9 @@ + +1 + diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/assign_after_load-2.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/assign_after_load-2.html new file mode 100644 index 0000000000..94679571be --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/assign_after_load-2.html @@ -0,0 +1,7 @@ + +2 + diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/assign_after_load.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/assign_after_load.html new file mode 100644 index 0000000000..00dc931d4e --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/assign_after_load.html @@ -0,0 +1,23 @@ + +Assignment to location after document is completely loaded + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/assign_before_load-1.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/assign_before_load-1.html new file mode 100644 index 0000000000..2549867c8f --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/assign_before_load-1.html @@ -0,0 +1,7 @@ + +1 + diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/assign_before_load-2.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/assign_before_load-2.html new file mode 100644 index 0000000000..94679571be --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/assign_before_load-2.html @@ -0,0 +1,7 @@ + +2 + diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/assign_before_load.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/assign_before_load.html new file mode 100644 index 0000000000..62a2aa7c60 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/assign_before_load.html @@ -0,0 +1,23 @@ + +Assignment to location before document is completely loaded + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/cross_origin_joined_frame.sub.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/cross_origin_joined_frame.sub.html new file mode 100644 index 0000000000..a3ffdd005a --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/cross_origin_joined_frame.sub.html @@ -0,0 +1,15 @@ + + + + + Cross-origin subframe for Location cyclic [[Prototype]] test + + + + + +

Cross-origin iframe with joined document.domain

+ + diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/document_location.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/document_location.html new file mode 100644 index 0000000000..3bdb028212 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/document_location.html @@ -0,0 +1,39 @@ + +document.location + + +
+ diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/location-non-configurable-toString-valueOf.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/location-non-configurable-toString-valueOf.html new file mode 100644 index 0000000000..80760ac9e4 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/location-non-configurable-toString-valueOf.html @@ -0,0 +1,42 @@ + + +Same-origin Location objects have non-configurable "toString" and "valueOf" properties + + + + + + diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/location-origin-idna.sub.window.js b/testing/web-platform/tests/html/browsers/history/the-location-interface/location-origin-idna.sub.window.js new file mode 100644 index 0000000000..83b030f886 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/location-origin-idna.sub.window.js @@ -0,0 +1,11 @@ +async_test(t => { + const frame = document.createElement("iframe"), + asciiOrigin = location.protocol + "//{{domains[天気の良い日]}}:" + location.port, + path = new URL("resources/post-your-origin.html", location).pathname; + frame.src = asciiOrigin + path; + self.onmessage = t.step_func_done(e => { + assert_equals(e.data.origin, asciiOrigin); + }); + document.body.appendChild(frame); + t.add_cleanup(() => frame.remove()); +}, "Test that location.origin returns ASCII"); diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/location-pathname-setter-question-mark.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/location-pathname-setter-question-mark.html new file mode 100644 index 0000000000..09546020f7 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/location-pathname-setter-question-mark.html @@ -0,0 +1,16 @@ + +Set location.pathname to ? + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/location-prevent-extensions.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/location-prevent-extensions.html new file mode 100644 index 0000000000..a8c777aded --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/location-prevent-extensions.html @@ -0,0 +1,21 @@ + + +[[PreventExtensions]] on a Location object should return false + + + + + + diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/location-protocol-setter-non-broken-weird.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/location-protocol-setter-non-broken-weird.html new file mode 100644 index 0000000000..544eb4ad9a --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/location-protocol-setter-non-broken-weird.html @@ -0,0 +1,35 @@ + +Set location.protocol from an HTTP URL + + + +
+ + + + + + + diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/location-protocol-setter-non-broken.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/location-protocol-setter-non-broken.html new file mode 100644 index 0000000000..585016eae9 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/location-protocol-setter-non-broken.html @@ -0,0 +1,63 @@ + +Set location.protocol to a non-broken-non-functioning scheme + + + +
+ diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/location-protocol-setter-sameish.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/location-protocol-setter-sameish.html new file mode 100644 index 0000000000..c581ae35aa --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/location-protocol-setter-sameish.html @@ -0,0 +1,26 @@ + +Set location.protocol to the scheme it already was + + +
+ + + + + diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/location-protocol-setter-with-colon.sub.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/location-protocol-setter-with-colon.sub.html new file mode 100644 index 0000000000..0612b5c709 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/location-protocol-setter-with-colon.sub.html @@ -0,0 +1,52 @@ + + + + + +
+ + + + diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/location-protocol-setter.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/location-protocol-setter.html new file mode 100644 index 0000000000..3d051e8cfb --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/location-protocol-setter.html @@ -0,0 +1,104 @@ + +Set location.protocol to schemes that throw + + +
+ + + diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/location-prototype-no-toString-valueOf.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/location-prototype-no-toString-valueOf.html new file mode 100644 index 0000000000..56316320af --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/location-prototype-no-toString-valueOf.html @@ -0,0 +1,55 @@ + + +Location.prototype objects don't have own "toString" and "valueOf" properties + + + + + diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/location-prototype-setting-cross-origin-domain.sub.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/location-prototype-setting-cross-origin-domain.sub.html new file mode 100644 index 0000000000..1e677b0365 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/location-prototype-setting-cross-origin-domain.sub.html @@ -0,0 +1,31 @@ + + +[[SetPrototypeOf]] on a Location object should not allow changing its value: cross-origin via document.domain + + + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/location-prototype-setting-cross-origin.sub.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/location-prototype-setting-cross-origin.sub.html new file mode 100644 index 0000000000..7bb6a27e21 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/location-prototype-setting-cross-origin.sub.html @@ -0,0 +1,28 @@ + + +[[SetPrototypeOf]] on a Location object should not allow changing its value: cross-origin + + + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/location-prototype-setting-goes-cross-origin-domain.sub.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/location-prototype-setting-goes-cross-origin-domain.sub.html new file mode 100644 index 0000000000..8966a814c5 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/location-prototype-setting-goes-cross-origin-domain.sub.html @@ -0,0 +1,39 @@ + + +[[SetPrototypeOf]] on a Location object should not allow changing its value: cross-origin via document.domain after initially getting the object + + + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/location-prototype-setting-same-origin-domain.sub.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/location-prototype-setting-same-origin-domain.sub.html new file mode 100644 index 0000000000..8ec7585daa --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/location-prototype-setting-same-origin-domain.sub.html @@ -0,0 +1,30 @@ + + +[[SetPrototypeOf]] on a Location object should not allow changing its value: cross-origin, but same-origin-domain + + + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/location-prototype-setting-same-origin.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/location-prototype-setting-same-origin.html new file mode 100644 index 0000000000..f912004f73 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/location-prototype-setting-same-origin.html @@ -0,0 +1,21 @@ + + +[[SetPrototypeOf]] on a location object should not allow changing its value: same-origin + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/location-stringifier.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/location-stringifier.html new file mode 100644 index 0000000000..48bad7af0e --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/location-stringifier.html @@ -0,0 +1,24 @@ + +Location stringifier + + + + + +
+ diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/location-symbol-toprimitive.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/location-symbol-toprimitive.html new file mode 100644 index 0000000000..e666a3e703 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/location-symbol-toprimitive.html @@ -0,0 +1,14 @@ + +Location Symbol.toPrimitive + + +
+ diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/location-tojson.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/location-tojson.html new file mode 100644 index 0000000000..5f20a6e15c --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/location-tojson.html @@ -0,0 +1,13 @@ + +Location has no toJSON + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/location-valueof.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/location-valueof.html new file mode 100644 index 0000000000..978bbb63a0 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/location-valueof.html @@ -0,0 +1,15 @@ + +Location valueOf + + +
+ diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/location_assign.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/location_assign.html new file mode 100644 index 0000000000..55f26d5660 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/location_assign.html @@ -0,0 +1,26 @@ + + + + location_assign + + + + +
+ + + diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/location_assign_about_blank-1.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/location_assign_about_blank-1.html new file mode 100644 index 0000000000..b43598f2cd --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/location_assign_about_blank-1.html @@ -0,0 +1,2 @@ + +Filler text diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/location_assign_about_blank.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/location_assign_about_blank.html new file mode 100644 index 0000000000..f3f7cf26b8 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/location_assign_about_blank.html @@ -0,0 +1,24 @@ + +location.assign with initial about:blank browsing context + + +
+ + + diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/location_hash.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/location_hash.html new file mode 100644 index 0000000000..c063e285ea --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/location_hash.html @@ -0,0 +1,62 @@ + + + + location_hash + + + + +
+ + + + diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/location_host.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/location_host.html new file mode 100644 index 0000000000..d93bf47e50 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/location_host.html @@ -0,0 +1,28 @@ + + + + location_host + + + + +
+ + + diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/location_hostname.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/location_hostname.html new file mode 100644 index 0000000000..2ffa0e5fc8 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/location_hostname.html @@ -0,0 +1,33 @@ + + + + location_hostname + + + + +
+ + + diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/location_href.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/location_href.html new file mode 100644 index 0000000000..1aa85dcdc8 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/location_href.html @@ -0,0 +1,19 @@ + + + + location_href + + + + +
+ + + diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/location_origin.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/location_origin.html new file mode 100644 index 0000000000..2325f4018a --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/location_origin.html @@ -0,0 +1,14 @@ + + + + + + diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/location_pathname.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/location_pathname.html new file mode 100644 index 0000000000..dea05d2f37 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/location_pathname.html @@ -0,0 +1,22 @@ + + + + location_pathname + + + + +
+ + + diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/location_port.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/location_port.html new file mode 100644 index 0000000000..fa1308ca5d --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/location_port.html @@ -0,0 +1,31 @@ + + + + location_port + + + + +
+ + + diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/location_protocol.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/location_protocol.html new file mode 100644 index 0000000000..d28bd56393 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/location_protocol.html @@ -0,0 +1,25 @@ + + + + location_protocol + + + + +
+ + + diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/location_reload-iframe.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/location_reload-iframe.html new file mode 100644 index 0000000000..f08cf5de3e --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/location_reload-iframe.html @@ -0,0 +1,4 @@ + diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/location_reload.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/location_reload.html new file mode 100644 index 0000000000..0a2d21d8d2 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/location_reload.html @@ -0,0 +1,43 @@ + + + + location_reload + + + + +
+ + + + + + + diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/location_reload_javascript_url.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/location_reload_javascript_url.html new file mode 100644 index 0000000000..737cafbcd3 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/location_reload_javascript_url.html @@ -0,0 +1,60 @@ + + + + location_reload_javascript_url + + + + +
+ + + + + + + diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/location_replace.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/location_replace.html new file mode 100644 index 0000000000..0593420d40 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/location_replace.html @@ -0,0 +1,26 @@ + + + + location_replace + + + + +
+ + + diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/location_search.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/location_search.html new file mode 100644 index 0000000000..f9db757841 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/location_search.html @@ -0,0 +1,20 @@ + + + + location_search + + + + +
+ + + diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/no-browsing-context.window.js b/testing/web-platform/tests/html/browsers/history/the-location-interface/no-browsing-context.window.js new file mode 100644 index 0000000000..4077d90971 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/no-browsing-context.window.js @@ -0,0 +1,86 @@ +test(() => { + const frame = document.body.appendChild(document.createElement("iframe")), + win = frame.contentWindow, + loc = win.location; + frame.remove(); + assert_equals(win.location, loc); +}, "Window and Location are 1:1 after browsing context removal"); + +function bcLessLocation() { + const frame = document.body.appendChild(document.createElement("iframe")), + win = frame.contentWindow, + loc = win.location; + frame.remove(); + return loc; +} + +[ + { + "property": "href", + "expected": "about:blank", + "values": ["https://example.com/", "/", "http://test:test/", "test test", "test:test", "chrome:fail"] + }, + { + "property": "protocol", + "expected": "about:", + "values": ["http", "about", "test"] + }, + { + "property": "host", + "expected": "", + "values": ["example.com", "test test", "()"] + }, + { + "property": "hostname", + "expected": "", + "values": ["example.com"] + }, + { + "property": "port", + "expected": "", + "values": ["80", "", "443", "notaport"] + }, + { + "property": "pathname", + "expected": "blank", + "values": ["/", "x"] + }, + { + "property": "search", + "expected": "", + "values": ["test"] + }, + { + "property": "hash", + "expected": "", + "values": ["test", "#"] + } +].forEach(testSetup => { + testSetup.values.forEach(value => { + test(() => { + const loc = bcLessLocation(); + loc[testSetup.property] = value; + assert_equals(loc[testSetup.property], testSetup.expected); + }, "Setting `" + testSetup.property + "` to `" + value + "` of a `Location` object sans browsing context is a no-op"); + }); +}); + +test(() => { + const loc = bcLessLocation(); + assert_equals(loc.origin, "null"); +}, "Getting `origin` of a `Location` object sans browsing context should be \"null\""); + +["assign", "replace", "reload"].forEach(method => { + ["about:blank", "https://example.com/", "/", "http://test:test/", "test test", "test:test", "chrome:fail"].forEach(value => { + test(() => { + const loc = bcLessLocation(); + loc[method](value); + assert_equals(loc.href, "about:blank"); + }, "Invoking `" + method + "` with `" + value + "` on a `Location` object sans browsing context is a no-op"); + }); +}); + +test(() => { + const loc = bcLessLocation(); + assert_array_equals(loc.ancestorOrigins, []); +}, "Getting `ancestorOrigins` of a `Location` object sans browsing context should be []"); diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/non-automated/manual_click_assign_during_load-1.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/non-automated/manual_click_assign_during_load-1.html new file mode 100644 index 0000000000..c762ece3bc --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/non-automated/manual_click_assign_during_load-1.html @@ -0,0 +1,7 @@ + + +Click Here +

Filler image to keep the page loading:

+ diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/non-automated/manual_click_assign_during_load-2.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/non-automated/manual_click_assign_during_load-2.html new file mode 100644 index 0000000000..1bf7f41e00 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/non-automated/manual_click_assign_during_load-2.html @@ -0,0 +1,7 @@ + +

This window should close itself and the test result appear in the original window + diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/non-automated/manual_click_assign_during_load-manual.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/non-automated/manual_click_assign_during_load-manual.html new file mode 100644 index 0000000000..45a0e3e2fd --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/non-automated/manual_click_assign_during_load-manual.html @@ -0,0 +1,17 @@ + +Assignment to location with click during load + + +

The popup blocker must be disabled for this test

+
+ diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/non-automated/manual_click_location_replace_during_load-1.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/non-automated/manual_click_location_replace_during_load-1.html new file mode 100644 index 0000000000..e9d03e9364 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/non-automated/manual_click_location_replace_during_load-1.html @@ -0,0 +1,10 @@ + + +Click Here +

Filler image to keep the page loading:

+ + diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/non-automated/manual_click_location_replace_during_load-2.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/non-automated/manual_click_location_replace_during_load-2.html new file mode 100644 index 0000000000..1bf7f41e00 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/non-automated/manual_click_location_replace_during_load-2.html @@ -0,0 +1,7 @@ + +

This window should close itself and the test result appear in the original window + diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/non-automated/manual_click_location_replace_during_load-manual.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/non-automated/manual_click_location_replace_during_load-manual.html new file mode 100644 index 0000000000..a453de34bf --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/non-automated/manual_click_location_replace_during_load-manual.html @@ -0,0 +1,17 @@ + +location.replace with click during load + + +

The popup blocker must be disabled for this test

+
+ diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/non-automated/manual_click_replace_during_load-manual.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/non-automated/manual_click_replace_during_load-manual.html new file mode 100644 index 0000000000..482858bcd7 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/non-automated/manual_click_replace_during_load-manual.html @@ -0,0 +1,17 @@ + +Assignment to location with click during load + + +

The popup blocker must be disabled for this test

+
+ diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/non-automated/manual_form_submit_assign_during_load-1.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/non-automated/manual_form_submit_assign_during_load-1.html new file mode 100644 index 0000000000..08f7e2dd68 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/non-automated/manual_form_submit_assign_during_load-1.html @@ -0,0 +1,9 @@ + + +
+ +
+

Filler image to keep the page loading:

+ diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/non-automated/manual_form_submit_assign_during_load-2.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/non-automated/manual_form_submit_assign_during_load-2.html new file mode 100644 index 0000000000..1bf7f41e00 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/non-automated/manual_form_submit_assign_during_load-2.html @@ -0,0 +1,7 @@ + +

This window should close itself and the test result appear in the original window + diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/non-automated/manual_form_submit_assign_during_load-manual.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/non-automated/manual_form_submit_assign_during_load-manual.html new file mode 100644 index 0000000000..d71b206ac5 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/non-automated/manual_form_submit_assign_during_load-manual.html @@ -0,0 +1,17 @@ + +Assignment to location with form submit during load + + +

The popup blocker must be disabled for this test

+
+ diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/non-automated/reload_in_resize-1.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/non-automated/reload_in_resize-1.html new file mode 100644 index 0000000000..05b44f4c40 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/non-automated/reload_in_resize-1.html @@ -0,0 +1,15 @@ + +

Resize this window. FAIL if the window doesn't close shortly afterwards.

+ diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/non-automated/reload_in_resize-manual.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/non-automated/reload_in_resize-manual.html new file mode 100644 index 0000000000..5cb3fac964 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/non-automated/reload_in_resize-manual.html @@ -0,0 +1,26 @@ + +Reload called from resize event + + +

Resize the popup window. That window should then close and the result be presented here. If that window doesn't close after resize that's a FAIL.

+
+ + diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/per-global.window.js b/testing/web-platform/tests/html/browsers/history/the-location-interface/per-global.window.js new file mode 100644 index 0000000000..b2956fd21f --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/per-global.window.js @@ -0,0 +1,3 @@ +// META: script=/common/object-association.js + +testIsPerWindow("location"); diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/reload_document_open_write-1.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/reload_document_open_write-1.html new file mode 100644 index 0000000000..e1a2e811c9 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/reload_document_open_write-1.html @@ -0,0 +1,19 @@ + +1 + diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/reload_document_open_write.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/reload_document_open_write.html new file mode 100644 index 0000000000..905ef88743 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/reload_document_open_write.html @@ -0,0 +1,26 @@ + +Reload document with document.open and document.written content + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/reload_document_write-1.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/reload_document_write-1.html new file mode 100644 index 0000000000..9a08433920 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/reload_document_write-1.html @@ -0,0 +1,4 @@ + diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/reload_document_write.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/reload_document_write.html new file mode 100644 index 0000000000..fb5fddc7da --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/reload_document_write.html @@ -0,0 +1,21 @@ + +Reload document with document.written content + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/reload_document_write_onload-1.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/reload_document_write_onload-1.html new file mode 100644 index 0000000000..36445af3c8 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/reload_document_write_onload-1.html @@ -0,0 +1,9 @@ + diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/reload_document_write_onload.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/reload_document_write_onload.html new file mode 100644 index 0000000000..b2cf31147a --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/reload_document_write_onload.html @@ -0,0 +1,26 @@ + +Reload document with document.written content written in load event + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/reload_post_1-manual.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/reload_post_1-manual.html new file mode 100644 index 0000000000..95ef660559 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/reload_post_1-manual.html @@ -0,0 +1,27 @@ + +Reload document with POST + + +
+ diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/resources/post-your-origin.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/resources/post-your-origin.html new file mode 100644 index 0000000000..a8a614c182 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/resources/post-your-origin.html @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/resources/post-your-protocol.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/resources/post-your-protocol.html new file mode 100644 index 0000000000..c50d623893 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/resources/post-your-protocol.html @@ -0,0 +1,4 @@ + diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/resources/reload_post_1-1.py b/testing/web-platform/tests/html/browsers/history/the-location-interface/resources/reload_post_1-1.py new file mode 100644 index 0000000000..56397f07b4 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/resources/reload_post_1-1.py @@ -0,0 +1,13 @@ +def main(request, response): + headers = [(b"Content-Type", b"text/html")] + return headers, u''' + +
+ + +
+ + ''' diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/same-hash.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/same-hash.html new file mode 100644 index 0000000000..430a57662a --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/same-hash.html @@ -0,0 +1,101 @@ + + +Using the location interface to navigate to the same hash as the current one + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/same_origin_frame.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/same_origin_frame.html new file mode 100644 index 0000000000..953e696b2a --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/same_origin_frame.html @@ -0,0 +1,12 @@ + + + + + Same-origin subframe for Location cyclic [[Prototype]] test + + + + +

Same-origin iframe

+ + diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/scripted_click_assign_during_load-1.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/scripted_click_assign_during_load-1.html new file mode 100644 index 0000000000..9561cabdd1 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/scripted_click_assign_during_load-1.html @@ -0,0 +1,10 @@ + + +Click Here + +

Filler image to keep the page loading:

+ diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/scripted_click_assign_during_load-2.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/scripted_click_assign_during_load-2.html new file mode 100644 index 0000000000..1bf7f41e00 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/scripted_click_assign_during_load-2.html @@ -0,0 +1,7 @@ + +

This window should close itself and the test result appear in the original window + diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/scripted_click_assign_during_load.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/scripted_click_assign_during_load.html new file mode 100644 index 0000000000..7ccc6cdc09 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/scripted_click_assign_during_load.html @@ -0,0 +1,17 @@ + +Assignment to location with click during load + + +

The popup blocker must be disabled for this test

+
+ diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/scripted_click_location_assign_during_load-1.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/scripted_click_location_assign_during_load-1.html new file mode 100644 index 0000000000..05bb42f967 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/scripted_click_location_assign_during_load-1.html @@ -0,0 +1,13 @@ + + +Click Here + +

Filler image to keep the page loading:

+ + diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/scripted_click_location_assign_during_load-2.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/scripted_click_location_assign_during_load-2.html new file mode 100644 index 0000000000..1bf7f41e00 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/scripted_click_location_assign_during_load-2.html @@ -0,0 +1,7 @@ + +

This window should close itself and the test result appear in the original window + diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/scripted_click_location_assign_during_load.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/scripted_click_location_assign_during_load.html new file mode 100644 index 0000000000..64f3ff942f --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/scripted_click_location_assign_during_load.html @@ -0,0 +1,16 @@ + +location.assign with click during load + + +

The popup blocker must be disabled for this test

+
+ diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/scripted_form_submit_assign_during_load-1.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/scripted_form_submit_assign_during_load-1.html new file mode 100644 index 0000000000..ae07ac5cfc --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/scripted_form_submit_assign_during_load-1.html @@ -0,0 +1,12 @@ + + +
+ +
+ +

Filler image to keep the page loading:

+ diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/scripted_form_submit_assign_during_load-2.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/scripted_form_submit_assign_during_load-2.html new file mode 100644 index 0000000000..1bf7f41e00 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/scripted_form_submit_assign_during_load-2.html @@ -0,0 +1,7 @@ + +

This window should close itself and the test result appear in the original window + diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/scripted_form_submit_assign_during_load.html b/testing/web-platform/tests/html/browsers/history/the-location-interface/scripted_form_submit_assign_during_load.html new file mode 100644 index 0000000000..2a6eba63ab --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/scripted_form_submit_assign_during_load.html @@ -0,0 +1,17 @@ + +Assignment to location with form submit during load + + +

The popup blocker must be disabled for this test

+
+ diff --git a/testing/web-platform/tests/html/browsers/history/the-location-interface/security_location_0.htm b/testing/web-platform/tests/html/browsers/history/the-location-interface/security_location_0.htm new file mode 100644 index 0000000000..f509c23b18 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/security_location_0.htm @@ -0,0 +1,27 @@ + + + + Location interface Security + + + + + + + +

Access location object from different origins doesn't raise SECURITY_ERR exception

+
+ + + + + + diff --git a/testing/web-platform/tests/html/browsers/history/the-session-history-of-browsing-contexts/navigation-in-onload.html b/testing/web-platform/tests/html/browsers/history/the-session-history-of-browsing-contexts/navigation-in-onload.html new file mode 100644 index 0000000000..367d7eea3e --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-session-history-of-browsing-contexts/navigation-in-onload.html @@ -0,0 +1,37 @@ + + + +Navigation in onload handler + + + + diff --git a/testing/web-platform/tests/html/browsers/history/the-session-history-of-browsing-contexts/navigation-in-onload_form-submission-1.html b/testing/web-platform/tests/html/browsers/history/the-session-history-of-browsing-contexts/navigation-in-onload_form-submission-1.html new file mode 100644 index 0000000000..2079224467 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-session-history-of-browsing-contexts/navigation-in-onload_form-submission-1.html @@ -0,0 +1,15 @@ + + + + + Navigation in onload handler through form submission + + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/history/the-session-history-of-browsing-contexts/navigation-in-onload_form-submission-2.html b/testing/web-platform/tests/html/browsers/history/the-session-history-of-browsing-contexts/navigation-in-onload_form-submission-2.html new file mode 100644 index 0000000000..11fbe2a2ba --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-session-history-of-browsing-contexts/navigation-in-onload_form-submission-2.html @@ -0,0 +1,22 @@ + + + + + Navigation in onload handler through form submission + + + + + diff --git a/testing/web-platform/tests/html/browsers/history/the-session-history-of-browsing-contexts/navigation-in-onload_form-submission-dynamic-iframe.html b/testing/web-platform/tests/html/browsers/history/the-session-history-of-browsing-contexts/navigation-in-onload_form-submission-dynamic-iframe.html new file mode 100644 index 0000000000..aabae3d770 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-session-history-of-browsing-contexts/navigation-in-onload_form-submission-dynamic-iframe.html @@ -0,0 +1,16 @@ + + + + + Navigation in onload handler through form submission in a dynamically created iframe + + + + + diff --git a/testing/web-platform/tests/html/browsers/history/the-session-history-of-browsing-contexts/navigation-in-onload_form-submission-iframe.html b/testing/web-platform/tests/html/browsers/history/the-session-history-of-browsing-contexts/navigation-in-onload_form-submission-iframe.html new file mode 100644 index 0000000000..5fa786d1f5 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-session-history-of-browsing-contexts/navigation-in-onload_form-submission-iframe.html @@ -0,0 +1,10 @@ + + + + + Navigation in onload handler through form submission in an iframe + + + + + diff --git a/testing/web-platform/tests/html/browsers/offline/application-cache-api/api_status_checking-manual.html b/testing/web-platform/tests/html/browsers/offline/application-cache-api/api_status_checking-manual.html new file mode 100644 index 0000000000..a4a3b41a7d --- /dev/null +++ b/testing/web-platform/tests/html/browsers/offline/application-cache-api/api_status_checking-manual.html @@ -0,0 +1,23 @@ + + + + Offline Application Cache - API_status_CHECKING + + + + +
    +
  1. Refresh the page.
  2. +
+ +
+ + + diff --git a/testing/web-platform/tests/html/browsers/offline/application-cache-api/api_status_downloading-manual.html b/testing/web-platform/tests/html/browsers/offline/application-cache-api/api_status_downloading-manual.html new file mode 100644 index 0000000000..c09d11d787 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/offline/application-cache-api/api_status_downloading-manual.html @@ -0,0 +1,24 @@ + + + + Offline Application Cache - API_status_DOWNLOADING + + + + +
    +
  1. Modify the commented part in the manifest file (manifest/clock.manifest) on the server.
  2. +
  3. Refresh the page.
  4. +
+
+ + + + diff --git a/testing/web-platform/tests/html/browsers/offline/application-cache-api/api_status_obsolete-manual.html b/testing/web-platform/tests/html/browsers/offline/application-cache-api/api_status_obsolete-manual.html new file mode 100644 index 0000000000..77005644a2 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/offline/application-cache-api/api_status_obsolete-manual.html @@ -0,0 +1,24 @@ + + + + Offline Application Cache - API_status_OBSOLETE + + + + +
    +
  1. Remove the manifest file (manifest/clock.manifest) from the server.
  2. +
  3. Refresh the page.
  4. +
+
+ + + + diff --git a/testing/web-platform/tests/html/browsers/offline/application-cache-api/api_status_updateready-manual.html b/testing/web-platform/tests/html/browsers/offline/application-cache-api/api_status_updateready-manual.html new file mode 100644 index 0000000000..7e1533374b --- /dev/null +++ b/testing/web-platform/tests/html/browsers/offline/application-cache-api/api_status_updateready-manual.html @@ -0,0 +1,25 @@ + + + + Offline Application Cache - API_status_UPDATEREADY + + + + +
    +
  1. Modify the commented part in the manifest file (manifest/clock.manifest) on the server.
  2. +
  3. Refresh the page.
  4. +
+ +
+ + + + diff --git a/testing/web-platform/tests/html/browsers/offline/application-cache-api/api_swapcache-manual.html b/testing/web-platform/tests/html/browsers/offline/application-cache-api/api_swapcache-manual.html new file mode 100644 index 0000000000..6649d980f6 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/offline/application-cache-api/api_swapcache-manual.html @@ -0,0 +1,30 @@ + + + + Offline Application Cache - API_swapCache + + + + +
    +
  1. Modify the part of comment in manifest file of server.
  2. +
  3. Refresh the page.
  4. +
+ +
+ + + + diff --git a/testing/web-platform/tests/html/browsers/offline/browser-state/navigator_online_event-manual.https.html b/testing/web-platform/tests/html/browsers/offline/browser-state/navigator_online_event-manual.https.html new file mode 100644 index 0000000000..81cad4f4fe --- /dev/null +++ b/testing/web-platform/tests/html/browsers/offline/browser-state/navigator_online_event-manual.https.html @@ -0,0 +1,46 @@ + + + + Offline Application Cache + + + +

navigator_online_event

+ +
    +
  1. Change the 'work offline' mode.
  2. +
  3. If actual result and expected result are same, then test is Pass, otherwise Fail.
  4. +
+ +
+ +

Actual Result

+
+ +
+ +

Expected Result

+
+ apply 'work offline': offline event is raised.

release 'work offline': online event is raised. +

+ + + diff --git a/testing/web-platform/tests/html/browsers/offline/browser-state/navigator_online_online.https.html b/testing/web-platform/tests/html/browsers/offline/browser-state/navigator_online_online.https.html new file mode 100644 index 0000000000..81547c3fb9 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/offline/browser-state/navigator_online_online.https.html @@ -0,0 +1,17 @@ + + + + Offline Application Cache - navigator_online_online + + + + +
+ + + + diff --git a/testing/web-platform/tests/html/browsers/offline/changestonetworkingmodel/original-id.json b/testing/web-platform/tests/html/browsers/offline/changestonetworkingmodel/original-id.json new file mode 100644 index 0000000000..2f77367c8f --- /dev/null +++ b/testing/web-platform/tests/html/browsers/offline/changestonetworkingmodel/original-id.json @@ -0,0 +1 @@ +{"original_id":"changesToNetworkingModel"} \ No newline at end of file diff --git a/testing/web-platform/tests/html/browsers/offline/introduction-4/event_downloading-manual.html b/testing/web-platform/tests/html/browsers/offline/introduction-4/event_downloading-manual.html new file mode 100644 index 0000000000..26b003f06e --- /dev/null +++ b/testing/web-platform/tests/html/browsers/offline/introduction-4/event_downloading-manual.html @@ -0,0 +1,23 @@ + + + + Offline Application Cache - Event_downloading + + + + +
    +
  1. Modify the commented part of the manifest file (manifest/clock.manifest) on the server.
  2. +
  3. Refresh the page.
  4. +
+ +
+ + + + diff --git a/testing/web-platform/tests/html/browsers/offline/introduction-4/event_error-manual.html b/testing/web-platform/tests/html/browsers/offline/introduction-4/event_error-manual.html new file mode 100644 index 0000000000..19abb3d6bf --- /dev/null +++ b/testing/web-platform/tests/html/browsers/offline/introduction-4/event_error-manual.html @@ -0,0 +1,23 @@ + + + + Offline Application Cache - Event_error + + + + +
    +
  1. Add a dummy file in the manifest file (manifest/clock.manifest).
  2. +
  3. Refresh the page.
  4. +
+ +
+ + + + diff --git a/testing/web-platform/tests/html/browsers/offline/introduction-4/event_obsolete-manual.html b/testing/web-platform/tests/html/browsers/offline/introduction-4/event_obsolete-manual.html new file mode 100644 index 0000000000..cab5e01cc7 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/offline/introduction-4/event_obsolete-manual.html @@ -0,0 +1,23 @@ + + + + Offline Application Cache - Event_obsolete + + + + +
    +
  1. Remove the manifest file (manifest/clock.manifest) from the server.
  2. +
  3. Refresh the page.
  4. +
+ +
+ + + + diff --git a/testing/web-platform/tests/html/browsers/offline/introduction-4/event_updateready-manual.html b/testing/web-platform/tests/html/browsers/offline/introduction-4/event_updateready-manual.html new file mode 100644 index 0000000000..4de435144d --- /dev/null +++ b/testing/web-platform/tests/html/browsers/offline/introduction-4/event_updateready-manual.html @@ -0,0 +1,22 @@ + + + + Offline Application Cache - Event_updateready + + + + +
    +
  1. Modify the commented part in the manifest file (manifest/clock.manifest) on the server.
  2. +
  3. Refresh the page.
  4. +
+
+ + + + diff --git a/testing/web-platform/tests/html/browsers/offline/introduction-4/event_updateready_swapcache-manual.html b/testing/web-platform/tests/html/browsers/offline/introduction-4/event_updateready_swapcache-manual.html new file mode 100644 index 0000000000..da6cead026 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/offline/introduction-4/event_updateready_swapcache-manual.html @@ -0,0 +1,30 @@ + + + + Offline Application Cache - Event_updateready_swapCache + + + + +
    +
  1. Modify the commented part in manifest file (manifest/clock.manifest) on the server.
  2. +
  3. Refresh the page.
  4. +
+ +
+ + + + diff --git a/testing/web-platform/tests/html/browsers/offline/manifest_main_empty-manual.https.html b/testing/web-platform/tests/html/browsers/offline/manifest_main_empty-manual.https.html new file mode 100644 index 0000000000..317aaa1137 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/offline/manifest_main_empty-manual.https.html @@ -0,0 +1,14 @@ + + + + Offline Application Cache - manifest_main_empty + + + +
    +
  1. Disable the network connection.
  2. +
  3. Refresh the page.
  4. +
  5. If the page is normally displayed, then test is PASS, otherwise FAIL.
  6. +
+ + diff --git a/testing/web-platform/tests/html/browsers/offline/manifest_notchanged_online-manual.https.html b/testing/web-platform/tests/html/browsers/offline/manifest_notchanged_online-manual.https.html new file mode 100644 index 0000000000..a464b426a7 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/offline/manifest_notchanged_online-manual.https.html @@ -0,0 +1,19 @@ + + + + Offline Application Cache - manifest_notchanged_online + + + + + + +
    +
  1. Remove time element of this html document and not change manifest file.
  2. +
  3. Refresh the page.
  4. +
  5. If the page is normally displayed, then test is PASS, otherwise FAIL.
  6. +
+ +

The time is:

+ + diff --git a/testing/web-platform/tests/html/browsers/offline/manifest_section_empty-manual.https.html b/testing/web-platform/tests/html/browsers/offline/manifest_section_empty-manual.https.html new file mode 100644 index 0000000000..eea2dbba35 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/offline/manifest_section_empty-manual.https.html @@ -0,0 +1,19 @@ + + + + Offline Application Cache - manifest_section_empty + + + + + + +
    +
  1. Disable the network connection.
  2. +
  3. Refresh the page.
  4. +
  5. If the time element and colors of result elements are normally displayed, then test is PASS, otherwise FAIL.
  6. +
+ +

The time is:

+ + diff --git a/testing/web-platform/tests/html/browsers/offline/manifest_section_many-manual.https.html b/testing/web-platform/tests/html/browsers/offline/manifest_section_many-manual.https.html new file mode 100644 index 0000000000..9378df1b40 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/offline/manifest_section_many-manual.https.html @@ -0,0 +1,19 @@ + + + + Offline Application Cache - manifest_section_many + + + + + + +
    +
  1. Disable the network connection.
  2. +
  3. Refresh the page.
  4. +
  5. If the time element and colors of result elements are normally displayed, then test is PASS, otherwise FAIL.
  6. +
+ +

The time is:

+ + diff --git a/testing/web-platform/tests/html/browsers/offline/resources/css/clock.css b/testing/web-platform/tests/html/browsers/offline/resources/css/clock.css new file mode 100644 index 0000000000..fa406d0fbe --- /dev/null +++ b/testing/web-platform/tests/html/browsers/offline/resources/css/clock.css @@ -0,0 +1 @@ +output { font: 1em sans-serif; } \ No newline at end of file diff --git a/testing/web-platform/tests/html/browsers/offline/resources/css/offline.css b/testing/web-platform/tests/html/browsers/offline/resources/css/offline.css new file mode 100644 index 0000000000..76b7f39853 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/offline/resources/css/offline.css @@ -0,0 +1,5 @@ +.connectivity { + color: #fff; + background: red; + padding: 20px; +} \ No newline at end of file diff --git a/testing/web-platform/tests/html/browsers/offline/resources/css/online.css b/testing/web-platform/tests/html/browsers/offline/resources/css/online.css new file mode 100644 index 0000000000..39efcb2ab4 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/offline/resources/css/online.css @@ -0,0 +1,5 @@ +.connectivity { + color: #fff; + background: blue; + padding: 20px; +} \ No newline at end of file diff --git a/testing/web-platform/tests/html/browsers/offline/resources/css/result.css b/testing/web-platform/tests/html/browsers/offline/resources/css/result.css new file mode 100644 index 0000000000..7d784b8ab5 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/offline/resources/css/result.css @@ -0,0 +1,11 @@ +.manualpass { + color: green; +} +.manualfail { + color: red; +}.pass { + color: green; +} +.fail { + color: red; +} diff --git a/testing/web-platform/tests/html/browsers/offline/resources/html/clock.html b/testing/web-platform/tests/html/browsers/offline/resources/html/clock.html new file mode 100644 index 0000000000..6b8949a6b1 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/offline/resources/html/clock.html @@ -0,0 +1,12 @@ + + + + + Clock + + + + +

The time is:

+ + \ No newline at end of file diff --git a/testing/web-platform/tests/html/browsers/offline/resources/js/clock.js b/testing/web-platform/tests/html/browsers/offline/resources/js/clock.js new file mode 100644 index 0000000000..1ac0dca539 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/offline/resources/js/clock.js @@ -0,0 +1,3 @@ +setTimeout(function () { + document.getElementById('clock').value = new Date(); +}, 1000); \ No newline at end of file diff --git a/testing/web-platform/tests/html/browsers/offline/resources/manifest/clock.manifest b/testing/web-platform/tests/html/browsers/offline/resources/manifest/clock.manifest new file mode 100644 index 0000000000..a61aae6c61 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/offline/resources/manifest/clock.manifest @@ -0,0 +1,17 @@ +CACHE MANIFEST + +# Version 1 + +CACHE: +../css/clock.css +../js/clock.js +../css/result.css +../css/offline.css +/resources/testharness.js +/resources/testharnessreport.js + +NETWORK: +../html/clock.html + +FALLBACK: +../css/online.css ../css/offline.css \ No newline at end of file diff --git a/testing/web-platform/tests/html/browsers/offline/resources/manifest/section_empty.manifest b/testing/web-platform/tests/html/browsers/offline/resources/manifest/section_empty.manifest new file mode 100644 index 0000000000..a23b9013be --- /dev/null +++ b/testing/web-platform/tests/html/browsers/offline/resources/manifest/section_empty.manifest @@ -0,0 +1,10 @@ +CACHE MANIFEST + +# Version 1 + +../css/clock.css +../js/clock.js +../css/result.css +../css/online.css +/resources/testharness.js +/resources/testharnessreport.js \ No newline at end of file diff --git a/testing/web-platform/tests/html/browsers/offline/resources/manifest/section_many.manifest b/testing/web-platform/tests/html/browsers/offline/resources/manifest/section_many.manifest new file mode 100644 index 0000000000..7e5e5e9995 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/offline/resources/manifest/section_many.manifest @@ -0,0 +1,19 @@ +CACHE MANIFEST + +# Version 1 + +CACHE: +../css/clock.css +../js/clock.js + +CACHE: +../css/result.css +../css/offline.css +/resources/testharness.js +/resources/testharnessreport.js + +NETWORK: +../html/clock.html + +FALLBACK: +../css/online.css ../css/offline.css \ No newline at end of file diff --git a/testing/web-platform/tests/html/browsers/offline/resources/manifest/url_check.manifest b/testing/web-platform/tests/html/browsers/offline/resources/manifest/url_check.manifest new file mode 100644 index 0000000000..041df5e55f --- /dev/null +++ b/testing/web-platform/tests/html/browsers/offline/resources/manifest/url_check.manifest @@ -0,0 +1,17 @@ +CACHE MANIFEST + +# Version 1 + +CACHE: +../css/cl#ock.css +../js/clock.js +../css/result.css +../css/offline.css +/resources/testharness.js +/resources/testharnessreport.js + +NETWORK: +../html/clock.html + +FALLBACK: +../css/online.css ../css/offline.css \ No newline at end of file diff --git a/testing/web-platform/tests/html/browsers/offline/section_network_offline-manual.https.html b/testing/web-platform/tests/html/browsers/offline/section_network_offline-manual.https.html new file mode 100644 index 0000000000..c4121f5bc5 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/offline/section_network_offline-manual.https.html @@ -0,0 +1,17 @@ + + + + Offline Application Cache - Section_network_offline + + + +
    +
  1. Disable the network connection.
  2. +
  3. Refresh the page.
  4. +
  5. If only the frame element can't be loaded, then test is PASS, otherwise FAIL.
  6. +
+ + + + diff --git a/testing/web-platform/tests/html/browsers/offline/section_network_online-manual.https.html b/testing/web-platform/tests/html/browsers/offline/section_network_online-manual.https.html new file mode 100644 index 0000000000..a5d8e59406 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/offline/section_network_online-manual.https.html @@ -0,0 +1,16 @@ + + + + Offline Application Cache - Section_network_online + + + +
    +
  1. Refresh the page.
  2. +
  3. If the frame element is loaded, then test is PASS, otherwise FAIL.
  4. +
+ + + + diff --git a/testing/web-platform/tests/html/browsers/origin/cross-origin-objects/cross-origin-due-to-document-domain-only.html b/testing/web-platform/tests/html/browsers/origin/cross-origin-objects/cross-origin-due-to-document-domain-only.html new file mode 100644 index 0000000000..425374faec --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/cross-origin-objects/cross-origin-due-to-document-domain-only.html @@ -0,0 +1,33 @@ + +Cross-origin due to document.domain + + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-function-caching.html b/testing/web-platform/tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-function-caching.html new file mode 100644 index 0000000000..a8af18d106 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-function-caching.html @@ -0,0 +1,49 @@ + + +Cross-origin methods and accessors are cached per Realm via[[CrossOriginPropertyDescriptorMap]] + + + + + +
+ diff --git a/testing/web-platform/tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-function-common.js b/testing/web-platform/tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-function-common.js new file mode 100644 index 0000000000..3b93b498a2 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-function-common.js @@ -0,0 +1,34 @@ +"use strict"; + +const crossOriginWindowMethods = [ + {key: "close", length: 0}, + {key: "focus", length: 0}, + {key: "blur", length: 0}, + {key: "postMessage", length: 1}, +]; + +const crossOriginWindowAccessors = [ + "window", + "self", + "location", + "closed", + "frames", + "length", + "top", + "opener", + "parent", +].map(key => ({key})); + +const makeCrossOriginWindow = t => { + const iframe = document.createElement("iframe"); + const path = location.pathname.slice(0, location.pathname.lastIndexOf("/")) + "/frame.html"; + iframe.src = get_host_info().HTTP_REMOTE_ORIGIN + path; + + return new Promise((resolve, reject) => { + iframe.onload = () => { resolve(iframe.contentWindow); }; + iframe.onerror = reject; + + document.body.append(iframe); + t.add_cleanup(() => { iframe.remove(); }); + }); +}; diff --git a/testing/web-platform/tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-function-length.html b/testing/web-platform/tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-function-length.html new file mode 100644 index 0000000000..466915a461 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-function-length.html @@ -0,0 +1,45 @@ + + +Cross-origin methods and accessors are created with correct 'length' property + + + + + +
+ diff --git a/testing/web-platform/tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-function-name.html b/testing/web-platform/tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-function-name.html new file mode 100644 index 0000000000..167c30e8f3 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-function-name.html @@ -0,0 +1,45 @@ + + +Cross-origin methods and accessors are created with correct 'name' property + + + + + +
+ diff --git a/testing/web-platform/tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-on-new-window.html b/testing/web-platform/tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-on-new-window.html new file mode 100644 index 0000000000..3ad0de6a3a --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-on-new-window.html @@ -0,0 +1,25 @@ + + + +Cross-origin behavior of Window and Location on new Window + + + + + +
+ diff --git a/testing/web-platform/tests/html/browsers/origin/cross-origin-objects/cross-origin-objects.html b/testing/web-platform/tests/html/browsers/origin/cross-origin-objects/cross-origin-objects.html new file mode 100644 index 0000000000..d1b6cabc0f --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/cross-origin-objects/cross-origin-objects.html @@ -0,0 +1,718 @@ + + + +Cross-origin behavior of Window and Location + + + + + + +
+ + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/origin/cross-origin-objects/frame-with-then.html b/testing/web-platform/tests/html/browsers/origin/cross-origin-objects/frame-with-then.html new file mode 100644 index 0000000000..3eedeca38a --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/cross-origin-objects/frame-with-then.html @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/origin/cross-origin-objects/frame.html b/testing/web-platform/tests/html/browsers/origin/cross-origin-objects/frame.html new file mode 100644 index 0000000000..ca2dd8ebf8 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/cross-origin-objects/frame.html @@ -0,0 +1,51 @@ + + + + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/origin/cross-origin-objects/location-properties-smoke-test.window.js b/testing/web-platform/tests/html/browsers/origin/cross-origin-objects/location-properties-smoke-test.window.js new file mode 100644 index 0000000000..45b61d07f5 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/cross-origin-objects/location-properties-smoke-test.window.js @@ -0,0 +1,51 @@ +// META: variant=?assign +// META: variant=?customproperty +// META: variant=?hash +// META: variant=?host +// META: variant=?hostname +// META: variant=?pathname +// META: variant=?port +// META: variant=?protocol +// META: variant=?reload +// META: variant=?search +// META: variant=?toString +// META: variant=?valueOf +// META: script=/common/get-host-info.sub.js +// META: script=/common/utils.js +// META: script=/common/dispatcher/dispatcher.js + +const property = window.location.search.substr(1); + +promise_test(async t => { + const iframeContext = new RemoteContext(token()); + const iframe = document.createElement("iframe"); + iframe.src = get_host_info().REMOTE_ORIGIN + + "/common/dispatcher/remote-executor.html?uuid=" + iframeContext.context_id; + document.body.appendChild(iframe); + + // Wait for the cross-origin document to be loaded inside the iframe. + assert_equals( + await iframeContext.execute_script(() => "Document loaded") , + "Document loaded" + ); + + assert_throws_dom("SecurityError", () => { + const unused = iframe.contentWindow.location[property]; + }, "Cross origin get of a location property should throw a security error"); + + assert_throws_dom("SecurityError", () => { + iframe.contentWindow.location[property] = "Random string"; + }, "Cross origin set of a location property should throw a security error"); + + // Verify that the property was indeed not modified. + assert_not_equals( + await iframeContext.execute_script(property => location[property], + [property]), + "Random string", + ); + + assert_throws_dom("SecurityError", () => { + const unused = Object.getOwnPropertyDescriptor( + iframe.contentWindow.location, property); + }, "Cross origin get of descriptors should throw a security error"); +}, `Verifying that cross-origin access of '${property}' is restricted`); diff --git a/testing/web-platform/tests/html/browsers/origin/cross-origin-objects/resources/cross-origin-due-to-document-domain-only-helper.html b/testing/web-platform/tests/html/browsers/origin/cross-origin-objects/resources/cross-origin-due-to-document-domain-only-helper.html new file mode 100644 index 0000000000..10ac8ece0e --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/cross-origin-objects/resources/cross-origin-due-to-document-domain-only-helper.html @@ -0,0 +1,9 @@ + + + diff --git a/testing/web-platform/tests/html/browsers/origin/cross-origin-objects/win-documentdomain.sub.html b/testing/web-platform/tests/html/browsers/origin/cross-origin-objects/win-documentdomain.sub.html new file mode 100644 index 0000000000..a315e21208 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/cross-origin-objects/win-documentdomain.sub.html @@ -0,0 +1,63 @@ + + + + + + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/origin/cross-origin-objects/window-location-and-location-href-cross-realm-set.html b/testing/web-platform/tests/html/browsers/origin/cross-origin-objects/window-location-and-location-href-cross-realm-set.html new file mode 100644 index 0000000000..f03550a141 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/cross-origin-objects/window-location-and-location-href-cross-realm-set.html @@ -0,0 +1,106 @@ + + +Cross-realm [[Set]] to window.location and location.href throws an error of correct realm + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/origin/inheritance/about-blank-iframe.html b/testing/web-platform/tests/html/browsers/origin/inheritance/about-blank-iframe.html new file mode 100644 index 0000000000..fabde327a1 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/inheritance/about-blank-iframe.html @@ -0,0 +1,28 @@ + + + + about:blank in child browsing context aliases security origin + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/origin/inheritance/about-blank-window.html b/testing/web-platform/tests/html/browsers/origin/inheritance/about-blank-window.html new file mode 100644 index 0000000000..cc3177f943 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/inheritance/about-blank-window.html @@ -0,0 +1,25 @@ + + + + about:blank in auxiliary browsing context aliases security origin + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/origin/inheritance/about-srcdoc.html b/testing/web-platform/tests/html/browsers/origin/inheritance/about-srcdoc.html new file mode 100644 index 0000000000..971811ee66 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/inheritance/about-srcdoc.html @@ -0,0 +1,29 @@ + + + + about:srcdoc aliases security origin + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/origin/inheritance/document-write.https.window.js b/testing/web-platform/tests/html/browsers/origin/inheritance/document-write.https.window.js new file mode 100644 index 0000000000..39dc3b1cc2 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/inheritance/document-write.https.window.js @@ -0,0 +1,10 @@ +// META: script=/common/get-host-info.sub.js + +// To use document.domain, we need to start from a subdomain. +// +// For document.domain setter to work, some web browser require the +// |Origin-Agent-Cluster: ?0| header to be set uniformly on the origin. +const origin = get_host_info().OTHER_ORIGIN; +const openee = window.open( + origin + '/html/browsers/origin/inheritance/resources/document-write.html') +fetch_tests_from_window(openee); diff --git a/testing/web-platform/tests/html/browsers/origin/inheritance/document-write.https.window.js.headers b/testing/web-platform/tests/html/browsers/origin/inheritance/document-write.https.window.js.headers new file mode 100644 index 0000000000..e007de4d7b --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/inheritance/document-write.https.window.js.headers @@ -0,0 +1 @@ +Origin-Agent-Cluster: ?0 diff --git a/testing/web-platform/tests/html/browsers/origin/inheritance/javascript-url.html b/testing/web-platform/tests/html/browsers/origin/inheritance/javascript-url.html new file mode 100644 index 0000000000..7dfb1130ce --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/inheritance/javascript-url.html @@ -0,0 +1,33 @@ + + + + javascript: aliases security origin + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/origin/inheritance/resources/document-write.html b/testing/web-platform/tests/html/browsers/origin/inheritance/resources/document-write.html new file mode 100644 index 0000000000..7a6ff3118e --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/inheritance/resources/document-write.html @@ -0,0 +1,40 @@ + + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/origin/inheritance/resources/document-write.html.headers b/testing/web-platform/tests/html/browsers/origin/inheritance/resources/document-write.html.headers new file mode 100644 index 0000000000..e007de4d7b --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/inheritance/resources/document-write.html.headers @@ -0,0 +1 @@ +Origin-Agent-Cluster: ?0 diff --git a/testing/web-platform/tests/html/browsers/origin/inheritance/resources/iframe-with-about-blank-iframe.html b/testing/web-platform/tests/html/browsers/origin/inheritance/resources/iframe-with-about-blank-iframe.html new file mode 100644 index 0000000000..b3f5125233 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/inheritance/resources/iframe-with-about-blank-iframe.html @@ -0,0 +1,7 @@ + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/origin/inheritance/resources/iframe-with-about-blank-iframe.html.headers b/testing/web-platform/tests/html/browsers/origin/inheritance/resources/iframe-with-about-blank-iframe.html.headers new file mode 100644 index 0000000000..e007de4d7b --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/inheritance/resources/iframe-with-about-blank-iframe.html.headers @@ -0,0 +1 @@ +Origin-Agent-Cluster: ?0 diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/1-iframe/parent-no-child-bad-subdomain.sub.https.html b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/1-iframe/parent-no-child-bad-subdomain.sub.https.html new file mode 100644 index 0000000000..3a45ee6d6a --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/1-iframe/parent-no-child-bad-subdomain.sub.https.html @@ -0,0 +1,27 @@ + + +Parent is site-keyed, child attempts to origin-key but uses a bad header value, child is a subdomain of the parent + + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/1-iframe/parent-no-child-yes-port.sub.https.html b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/1-iframe/parent-no-child-yes-port.sub.https.html new file mode 100644 index 0000000000..85fb1f64e0 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/1-iframe/parent-no-child-yes-port.sub.https.html @@ -0,0 +1,27 @@ + + +Parent is site-keyed, child is origin-keyed, child is different-origin to the parent because of a port mismatch + + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/1-iframe/parent-no-child-yes-same.sub.https.html b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/1-iframe/parent-no-child-yes-same.sub.https.html new file mode 100644 index 0000000000..7ece02c81a --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/1-iframe/parent-no-child-yes-same.sub.https.html @@ -0,0 +1,27 @@ + + +Parent is site-keyed, child is origin-keyed, child is same-origin to the parent + + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/1-iframe/parent-no-child-yes-subdomain-with-redirect.sub.https.html b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/1-iframe/parent-no-child-yes-subdomain-with-redirect.sub.https.html new file mode 100644 index 0000000000..994f80876d --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/1-iframe/parent-no-child-yes-subdomain-with-redirect.sub.https.html @@ -0,0 +1,27 @@ + + +Parent is site-keyed, child is reached via a redirect response with no header, child final response does have the header + + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/1-iframe/parent-no-child-yes-subdomain.sub.https.html b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/1-iframe/parent-no-child-yes-subdomain.sub.https.html new file mode 100644 index 0000000000..5fc2fa29f3 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/1-iframe/parent-no-child-yes-subdomain.sub.https.html @@ -0,0 +1,27 @@ + + +Parent is site-keyed, child is origin-keyed, child is a subdomain of the parent + + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/1-iframe/parent-no-child-yeswithparams-subdomain.sub.https.html b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/1-iframe/parent-no-child-yeswithparams-subdomain.sub.https.html new file mode 100644 index 0000000000..3e7c8419b3 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/1-iframe/parent-no-child-yeswithparams-subdomain.sub.https.html @@ -0,0 +1,27 @@ + + +Parent is site-keyed, child is origin-keyed using parameters on its structured header, child is a subdomain of the parent + + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/1-iframe/parent-yes-child-no-port.sub.https.html b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/1-iframe/parent-yes-child-no-port.sub.https.html new file mode 100644 index 0000000000..f00814cfbf --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/1-iframe/parent-yes-child-no-port.sub.https.html @@ -0,0 +1,27 @@ + + +Parent is origin-keyed, child is site-keyed, child is is different-origin to the parent because of a port mismatch + + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/1-iframe/parent-yes-child-no-port.sub.https.html.headers b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/1-iframe/parent-yes-child-no-port.sub.https.html.headers new file mode 100644 index 0000000000..79a20f30fc --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/1-iframe/parent-yes-child-no-port.sub.https.html.headers @@ -0,0 +1 @@ +Origin-Agent-Cluster: ?1 diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/1-iframe/parent-yes-child-no-same.sub.https.html b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/1-iframe/parent-yes-child-no-same.sub.https.html new file mode 100644 index 0000000000..307f8c48d7 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/1-iframe/parent-yes-child-no-same.sub.https.html @@ -0,0 +1,26 @@ + + +Parent is origin-keyed, child is site-keyed, child is same-origin to the parent + + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/1-iframe/parent-yes-child-no-same.sub.https.html.headers b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/1-iframe/parent-yes-child-no-same.sub.https.html.headers new file mode 100644 index 0000000000..79a20f30fc --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/1-iframe/parent-yes-child-no-same.sub.https.html.headers @@ -0,0 +1 @@ +Origin-Agent-Cluster: ?1 diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/1-iframe/parent-yes-child-no-subdomain.sub.https.html b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/1-iframe/parent-yes-child-no-subdomain.sub.https.html new file mode 100644 index 0000000000..8c823fa36f --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/1-iframe/parent-yes-child-no-subdomain.sub.https.html @@ -0,0 +1,27 @@ + + +Parent is origin-keyed, child is site-keyed, child is a subdomain of the parent + + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/1-iframe/parent-yes-child-no-subdomain.sub.https.html.headers b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/1-iframe/parent-yes-child-no-subdomain.sub.https.html.headers new file mode 100644 index 0000000000..79a20f30fc --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/1-iframe/parent-yes-child-no-subdomain.sub.https.html.headers @@ -0,0 +1 @@ +Origin-Agent-Cluster: ?1 diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/1-iframe/parent-yes-child-yes-port.sub.https.html b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/1-iframe/parent-yes-child-yes-port.sub.https.html new file mode 100644 index 0000000000..5e431e6e41 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/1-iframe/parent-yes-child-yes-port.sub.https.html @@ -0,0 +1,27 @@ + + +Parent is origin-keyed, child is site-keyed, child is different-origin to the parent because of a port mismatch + + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/1-iframe/parent-yes-child-yes-port.sub.https.html.headers b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/1-iframe/parent-yes-child-yes-port.sub.https.html.headers new file mode 100644 index 0000000000..79a20f30fc --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/1-iframe/parent-yes-child-yes-port.sub.https.html.headers @@ -0,0 +1 @@ +Origin-Agent-Cluster: ?1 diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/1-iframe/parent-yes-child-yes-same.sub.https.html b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/1-iframe/parent-yes-child-yes-same.sub.https.html new file mode 100644 index 0000000000..3b8c214a61 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/1-iframe/parent-yes-child-yes-same.sub.https.html @@ -0,0 +1,26 @@ + + +Parent is origin-keyed, child is site-keyed, child is same-origin to the parent + + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/1-iframe/parent-yes-child-yes-same.sub.https.html.headers b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/1-iframe/parent-yes-child-yes-same.sub.https.html.headers new file mode 100644 index 0000000000..79a20f30fc --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/1-iframe/parent-yes-child-yes-same.sub.https.html.headers @@ -0,0 +1 @@ +Origin-Agent-Cluster: ?1 diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/1-iframe/parent-yes-child-yes-subdomain.sub.https.html b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/1-iframe/parent-yes-child-yes-subdomain.sub.https.html new file mode 100644 index 0000000000..136a3a0bba --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/1-iframe/parent-yes-child-yes-subdomain.sub.https.html @@ -0,0 +1,27 @@ + + +Parent is origin-keyed, child is site-keyed, child is a subdomain of the parent + + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/1-iframe/parent-yes-child-yes-subdomain.sub.https.html.headers b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/1-iframe/parent-yes-child-yes-subdomain.sub.https.html.headers new file mode 100644 index 0000000000..79a20f30fc --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/1-iframe/parent-yes-child-yes-subdomain.sub.https.html.headers @@ -0,0 +1 @@ +Origin-Agent-Cluster: ?1 diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-no-child1-no-subdomain-child2-yes-subdomain.sub.https.html b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-no-child1-no-subdomain-child2-yes-subdomain.sub.https.html new file mode 100644 index 0000000000..1bb252f0ab --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-no-child1-no-subdomain-child2-yes-subdomain.sub.https.html @@ -0,0 +1,36 @@ + + +Parent is site-keyed, subdomain child 1 is site-keyed, same-subdomain child 2 is origin-keyed + + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-no-child1-no-subdomain-child2-yes-subdomainport.sub.https.html b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-no-child1-no-subdomain-child2-yes-subdomainport.sub.https.html new file mode 100644 index 0000000000..5b80c528f0 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-no-child1-no-subdomain-child2-yes-subdomainport.sub.https.html @@ -0,0 +1,37 @@ + + +Parent is site-keyed, subdomain child 1 is site-keyed, different-port-same-subdomain child 2 is origin-keyed + + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-no-child1-no-subdomain1-child2-yes-subdomain2.sub.https.html b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-no-child1-no-subdomain1-child2-yes-subdomain2.sub.https.html new file mode 100644 index 0000000000..bba13b82a4 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-no-child1-no-subdomain1-child2-yes-subdomain2.sub.https.html @@ -0,0 +1,37 @@ + + +Parent is site-keyed, subdomain child 1 is site-keyed, different-subdomain child 2 is origin-keyed + + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-no-child1-yes-subdomain-child2-no-port.sub.https.html b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-no-child1-yes-subdomain-child2-no-port.sub.https.html new file mode 100644 index 0000000000..d01d180213 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-no-child1-yes-subdomain-child2-no-port.sub.https.html @@ -0,0 +1,37 @@ + + +Parent is site-keyed, subdomain child 1 is origin-keyed, non-subdomain but different-port child 2 is site-keyed + + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-no-child1-yes-subdomain-child2-no-subdomain.sub.https.html b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-no-child1-yes-subdomain-child2-no-subdomain.sub.https.html new file mode 100644 index 0000000000..9a245b3ace --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-no-child1-yes-subdomain-child2-no-subdomain.sub.https.html @@ -0,0 +1,38 @@ + + +Parent is site-keyed, subdomain child 1 is origin-keyed, same-subdomain child 2 is site-keyed + + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-yes-child1-no-subdomain-child2-no-subdomain.sub.https.html b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-yes-child1-no-subdomain-child2-no-subdomain.sub.https.html new file mode 100644 index 0000000000..c308b9a17a --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-yes-child1-no-subdomain-child2-no-subdomain.sub.https.html @@ -0,0 +1,38 @@ + + +Parent is origin-keyed, subdomain child 1 is site-keyed, same-subdomain child 2 is site-keyed + + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-yes-child1-no-subdomain-child2-no-subdomain.sub.https.html.headers b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-yes-child1-no-subdomain-child2-no-subdomain.sub.https.html.headers new file mode 100644 index 0000000000..79a20f30fc --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-yes-child1-no-subdomain-child2-no-subdomain.sub.https.html.headers @@ -0,0 +1 @@ +Origin-Agent-Cluster: ?1 diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-yes-child1-no-subdomain-child2-no-subdomain2.sub.https.html b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-yes-child1-no-subdomain-child2-no-subdomain2.sub.https.html new file mode 100644 index 0000000000..767d908c21 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-yes-child1-no-subdomain-child2-no-subdomain2.sub.https.html @@ -0,0 +1,38 @@ + + +Parent is origin-keyed, subdomain child 1 is site-keyed, different-subdomain child 2 is site-keyed + + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-yes-child1-no-subdomain-child2-no-subdomain2.sub.https.html.headers b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-yes-child1-no-subdomain-child2-no-subdomain2.sub.https.html.headers new file mode 100644 index 0000000000..79a20f30fc --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-yes-child1-no-subdomain-child2-no-subdomain2.sub.https.html.headers @@ -0,0 +1 @@ +Origin-Agent-Cluster: ?1 diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-yes-child1-no-subdomain-child2-yes-subdomain.sub.https.html b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-yes-child1-no-subdomain-child2-yes-subdomain.sub.https.html new file mode 100644 index 0000000000..45047f3ae1 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-yes-child1-no-subdomain-child2-yes-subdomain.sub.https.html @@ -0,0 +1,38 @@ + + +Parent is origin-keyed, subdomain child 1 is site-keyed, same-subdomain child 2 is origin-keyed + + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-yes-child1-no-subdomain-child2-yes-subdomain.sub.https.html.headers b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-yes-child1-no-subdomain-child2-yes-subdomain.sub.https.html.headers new file mode 100644 index 0000000000..79a20f30fc --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-yes-child1-no-subdomain-child2-yes-subdomain.sub.https.html.headers @@ -0,0 +1 @@ +Origin-Agent-Cluster: ?1 diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-yes-child1-no-subdomain-child2-yes-subdomain2.sub.https.html b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-yes-child1-no-subdomain-child2-yes-subdomain2.sub.https.html new file mode 100644 index 0000000000..202b916767 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-yes-child1-no-subdomain-child2-yes-subdomain2.sub.https.html @@ -0,0 +1,38 @@ + + +Parent is origin-keyed, subdomain child 1 is site-keyed, different-subdomain child 2 is origin-keyed + + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-yes-child1-no-subdomain-child2-yes-subdomain2.sub.https.html.headers b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-yes-child1-no-subdomain-child2-yes-subdomain2.sub.https.html.headers new file mode 100644 index 0000000000..79a20f30fc --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-yes-child1-no-subdomain-child2-yes-subdomain2.sub.https.html.headers @@ -0,0 +1 @@ +Origin-Agent-Cluster: ?1 diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-yes-child1-no-subdomain-child2-yes-subdomainport.sub.https.html b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-yes-child1-no-subdomain-child2-yes-subdomainport.sub.https.html new file mode 100644 index 0000000000..a1316731ac --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-yes-child1-no-subdomain-child2-yes-subdomainport.sub.https.html @@ -0,0 +1,38 @@ + + +Parent is origin-keyed, subdomain child 1 is site-keyed, different-port-same-subdomain child 2 is origin-keyed + + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-yes-child1-no-subdomain-child2-yes-subdomainport.sub.https.html.headers b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-yes-child1-no-subdomain-child2-yes-subdomainport.sub.https.html.headers new file mode 100644 index 0000000000..79a20f30fc --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-yes-child1-no-subdomain-child2-yes-subdomainport.sub.https.html.headers @@ -0,0 +1 @@ +Origin-Agent-Cluster: ?1 diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-yes-child1-yes-subdomain-child2-no-port.sub.https.html b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-yes-child1-yes-subdomain-child2-no-port.sub.https.html new file mode 100644 index 0000000000..46bef4b9a9 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-yes-child1-yes-subdomain-child2-no-port.sub.https.html @@ -0,0 +1,36 @@ + + +Parent is origin-keyed, subdomain child 1 is origin-keyed, non-subdomain but different-port child 2 is site-keyed + + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-yes-child1-yes-subdomain-child2-no-port.sub.https.html.headers b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-yes-child1-yes-subdomain-child2-no-port.sub.https.html.headers new file mode 100644 index 0000000000..79a20f30fc --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-yes-child1-yes-subdomain-child2-no-port.sub.https.html.headers @@ -0,0 +1 @@ +Origin-Agent-Cluster: ?1 diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-yes-child1-yes-subdomain-child2-no-subdomain.sub.https.html b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-yes-child1-yes-subdomain-child2-no-subdomain.sub.https.html new file mode 100644 index 0000000000..39dcfc04b0 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-yes-child1-yes-subdomain-child2-no-subdomain.sub.https.html @@ -0,0 +1,38 @@ + + +Parent is origin-keyed, subdomain child 1 is origin-keyed, same-subdomain child 2 is site-keyed + + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-yes-child1-yes-subdomain-child2-no-subdomain.sub.https.html.headers b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-yes-child1-yes-subdomain-child2-no-subdomain.sub.https.html.headers new file mode 100644 index 0000000000..79a20f30fc --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-yes-child1-yes-subdomain-child2-no-subdomain.sub.https.html.headers @@ -0,0 +1 @@ +Origin-Agent-Cluster: ?1 diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-yes-child1-yes-subdomain-child2-yes-subdomain.sub.https.html b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-yes-child1-yes-subdomain-child2-yes-subdomain.sub.https.html new file mode 100644 index 0000000000..b6daf91b54 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-yes-child1-yes-subdomain-child2-yes-subdomain.sub.https.html @@ -0,0 +1,39 @@ + + +Parent is origin-keyed, subdomain child 1 is origin-keyed, same-subdomain child 2 is site-keyed + + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-yes-child1-yes-subdomain-child2-yes-subdomain.sub.https.html.headers b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-yes-child1-yes-subdomain-child2-yes-subdomain.sub.https.html.headers new file mode 100644 index 0000000000..79a20f30fc --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-yes-child1-yes-subdomain-child2-yes-subdomain.sub.https.html.headers @@ -0,0 +1 @@ +Origin-Agent-Cluster: ?1 diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-yes-child1-yes-subdomain-child2-yes-subdomain2.sub.https.html b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-yes-child1-yes-subdomain-child2-yes-subdomain2.sub.https.html new file mode 100644 index 0000000000..b94f9392d4 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-yes-child1-yes-subdomain-child2-yes-subdomain2.sub.https.html @@ -0,0 +1,38 @@ + + +Parent is origin-keyed, subdomain child 1 is origin-keyed, different-subdomain child 2 is origin-keyed + + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-yes-child1-yes-subdomain-child2-yes-subdomain2.sub.https.html.headers b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-yes-child1-yes-subdomain-child2-yes-subdomain2.sub.https.html.headers new file mode 100644 index 0000000000..79a20f30fc --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-yes-child1-yes-subdomain-child2-yes-subdomain2.sub.https.html.headers @@ -0,0 +1 @@ +Origin-Agent-Cluster: ?1 diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-yes-child1-yes-subdomain-child2-yes-subdomainport.sub.https.html b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-yes-child1-yes-subdomain-child2-yes-subdomainport.sub.https.html new file mode 100644 index 0000000000..fb3fda1bf2 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-yes-child1-yes-subdomain-child2-yes-subdomainport.sub.https.html @@ -0,0 +1,38 @@ + + +Parent is origin-keyed, subdomain child 1 is origin-keyed, different-port-same-subdomain child 2 is origin-keyed + + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-yes-child1-yes-subdomain-child2-yes-subdomainport.sub.https.html.headers b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-yes-child1-yes-subdomain-child2-yes-subdomainport.sub.https.html.headers new file mode 100644 index 0000000000..79a20f30fc --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/2-iframes/parent-yes-child1-yes-subdomain-child2-yes-subdomainport.sub.https.html.headers @@ -0,0 +1 @@ +Origin-Agent-Cluster: ?1 diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/META.yml b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/META.yml new file mode 100644 index 0000000000..f21ce69f6a --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/META.yml @@ -0,0 +1,5 @@ +spec: https://html.spec.whatwg.org/multipage/#origin-keyed-agent-clusters +suggested_reviewers: + - domenic + - annevk + - wjmaclean diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/README.md b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/README.md new file mode 100644 index 0000000000..85ba3bce7f --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/README.md @@ -0,0 +1,30 @@ +# Origin-keyed agent clusters tests + +These are tests for the [origin-keyed agent clusters](https://html.spec.whatwg.org/multipage/origin.html#origin-keyed-agent-clusters) +feature. + +## Test filenames + +The tests in `2-iframes` follow the file naming pattern + +``` +parent-[yes|no]-child1-[yes|no]-[designator]-child2-[yes|no]-[designator] +``` + +Here: + +* `yes` or `no` refers to whether the `Origin-Agent-Cluster` header is set or + unset. +* `designator` explains how the child differs from the parent: e.g. by being a + subdomain, or having a different port, or both. There's also `same` if it's + same-origin. + +Other directories have variations on this, e.g. `1-iframe/` does the same thing +but for a single `child` instead of `child1` and `child2`, and `navigation/` +uses `1` and `2` to represent the two different locations the single iframe will +be navigated to. + +## Coverage + +Header parsing is covered by a few tests in the `1-iframe/` subdirectory, and +not duplicated to all other scenarios. diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/about-blank.https.sub.html b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/about-blank.https.sub.html new file mode 100644 index 0000000000..556d528aa0 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/about-blank.https.sub.html @@ -0,0 +1,63 @@ + + +The initial about:blank respects origin isolation + + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/about-blank.https.sub.html.headers b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/about-blank.https.sub.html.headers new file mode 100644 index 0000000000..79a20f30fc --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/about-blank.https.sub.html.headers @@ -0,0 +1 @@ +Origin-Agent-Cluster: ?1 diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/document-domain.sub.https.html b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/document-domain.sub.https.html new file mode 100644 index 0000000000..b4535d9e54 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/document-domain.sub.https.html @@ -0,0 +1,52 @@ + + +Setting document.domain does not change same-originness when origin-keyed + + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/document-domain.sub.https.html.headers b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/document-domain.sub.https.html.headers new file mode 100644 index 0000000000..79a20f30fc --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/document-domain.sub.https.html.headers @@ -0,0 +1 @@ +Origin-Agent-Cluster: ?1 diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/cross-origin-isolated.sub.https.html b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/cross-origin-isolated.sub.https.html new file mode 100644 index 0000000000..a521934cc9 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/cross-origin-isolated.sub.https.html @@ -0,0 +1,28 @@ + + +window.originAgentCluster must be implied by cross-origin isolation + + + + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/cross-origin-isolated.sub.https.html.headers b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/cross-origin-isolated.sub.https.html.headers new file mode 100644 index 0000000000..5f8621ef83 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/cross-origin-isolated.sub.https.html.headers @@ -0,0 +1,2 @@ +Cross-Origin-Embedder-Policy: require-corp +Cross-Origin-Opener-Policy: same-origin diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/csp-sandbox-no.https.html b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/csp-sandbox-no.https.html new file mode 100644 index 0000000000..e0b5f92376 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/csp-sandbox-no.https.html @@ -0,0 +1,15 @@ + + +window.originAgentCluster for a top-level frame sandboxed by CSP with no Origin-Agent-Cluster header + + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/csp-sandbox-no.https.html.headers b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/csp-sandbox-no.https.html.headers new file mode 100644 index 0000000000..4705ce9ded --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/csp-sandbox-no.https.html.headers @@ -0,0 +1 @@ +Content-Security-Policy: sandbox allow-scripts; diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/csp-sandbox-yes.https.html b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/csp-sandbox-yes.https.html new file mode 100644 index 0000000000..a2220c5acc --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/csp-sandbox-yes.https.html @@ -0,0 +1,15 @@ + + +window.originAgentCluster for a top-level frame sandboxed by CSP with an Origin-Agent-Cluster header + + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/csp-sandbox-yes.https.html.headers b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/csp-sandbox-yes.https.html.headers new file mode 100644 index 0000000000..a52bf50900 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/csp-sandbox-yes.https.html.headers @@ -0,0 +1,2 @@ +Content-Security-Policy: sandbox allow-scripts; +Origin-Agent-Cluster: ?1 diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/data-to-javascript-no.https.html b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/data-to-javascript-no.https.html new file mode 100644 index 0000000000..06149cda8a --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/data-to-javascript-no.https.html @@ -0,0 +1,12 @@ + + +window.originAgentCluster for a javascript: URL navigated to from a data: URL on a site-keyed page + + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/data-to-javascript-yes.https.html b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/data-to-javascript-yes.https.html new file mode 100644 index 0000000000..af6fea0ad9 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/data-to-javascript-yes.https.html @@ -0,0 +1,12 @@ + + +window.originAgentCluster for a javascript: URL navigated to from a data: URL on an origin-keyed page + + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/data-to-javascript-yes.https.html.headers b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/data-to-javascript-yes.https.html.headers new file mode 100644 index 0000000000..79a20f30fc --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/data-to-javascript-yes.https.html.headers @@ -0,0 +1 @@ +Origin-Agent-Cluster: ?1 diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/data-url-no.https.html b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/data-url-no.https.html new file mode 100644 index 0000000000..8ae564a072 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/data-url-no.https.html @@ -0,0 +1,12 @@ + + +window.originAgentCluster for a data: URL on a site-keyed page + + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/data-url-yes.https.html b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/data-url-yes.https.html new file mode 100644 index 0000000000..bcbf098a66 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/data-url-yes.https.html @@ -0,0 +1,12 @@ + + +window.originAgentCluster for a data: URL on an origin-keyed page + + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/data-url-yes.https.html.headers b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/data-url-yes.https.html.headers new file mode 100644 index 0000000000..79a20f30fc --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/data-url-yes.https.html.headers @@ -0,0 +1 @@ +Origin-Agent-Cluster: ?1 diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/javascript-url-no.https.html b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/javascript-url-no.https.html new file mode 100644 index 0000000000..1b54ad42a4 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/javascript-url-no.https.html @@ -0,0 +1,12 @@ + + +window.originAgentCluster for a javascript: URL on a site-keyed page + + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/javascript-url-yes.https.html b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/javascript-url-yes.https.html new file mode 100644 index 0000000000..e2b7730dd2 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/javascript-url-yes.https.html @@ -0,0 +1,12 @@ + + +window.originAgentCluster for a javascript: URL on an origin-keyed page + + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/javascript-url-yes.https.html.headers b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/javascript-url-yes.https.html.headers new file mode 100644 index 0000000000..79a20f30fc --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/javascript-url-yes.https.html.headers @@ -0,0 +1 @@ +Origin-Agent-Cluster: ?1 diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/removed-iframe.sub.https.html b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/removed-iframe.sub.https.html new file mode 100644 index 0000000000..fcf5068908 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/removed-iframe.sub.https.html @@ -0,0 +1,27 @@ + + +window.originAgentCluster for a removed frame + + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/removed-iframe.sub.https.html.headers b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/removed-iframe.sub.https.html.headers new file mode 100644 index 0000000000..79a20f30fc --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/removed-iframe.sub.https.html.headers @@ -0,0 +1 @@ +Origin-Agent-Cluster: ?1 diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/resources/data-to-javascript-test.mjs b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/resources/data-to-javascript-test.mjs new file mode 100644 index 0000000000..3a88253ee3 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/resources/data-to-javascript-test.mjs @@ -0,0 +1,33 @@ +import { insertCustomIframe, testSupportScript } from "./helpers.mjs"; +import { waitForIframe, testGetter } from "../../resources/helpers.mjs"; + +const testSupportScriptSuitableForNesting = + testSupportScript.replace('', ''); + +export default () => { + promise_setup(async () => { + const jsURL = `javascript:'${testSupportScript}'`; + const iframe = await insertCustomIframe(`data:text/html, + Start page + + `); + + const waitPromise = waitForIframe(iframe, "javascript: URL"); + + // Kick off the navigation. We can't do it directly because only same-origin + // pages can navigate to a javascript: URL, and we're not same-origin with + // a data: URL. + iframe.contentWindow.postMessage(undefined, "*"); + + await waitPromise; + }); + + // The javascript: URL iframe inherits its origin from the previous occupant + // of the iframe, which is a data: URL, so it should always be true. + + testGetter(0, true); +}; diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/resources/data-url-test.mjs b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/resources/data-url-test.mjs new file mode 100644 index 0000000000..1a9b3be47f --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/resources/data-url-test.mjs @@ -0,0 +1,13 @@ +import { insertCustomIframe, testSupportScript } from "./helpers.mjs"; +import { testGetter } from "../../resources/helpers.mjs"; + +export default () => { + promise_setup(() => { + return insertCustomIframe(`data:text/html,${testSupportScript}`); + }); + + // The data: URL iframe has an opaque origin, so it should return true, since + // for them site === origin so they are always origin-keyed. + + testGetter(0, true, "data: URL child"); +}; diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/resources/helpers.mjs b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/resources/helpers.mjs new file mode 100644 index 0000000000..4610ffcad0 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/resources/helpers.mjs @@ -0,0 +1,28 @@ +import { waitForIframe } from "../../resources/helpers.mjs"; + +/** + * Inserts an iframe, not specialized for origin-keyed agent cluster testing, + * pointing to a custom URL. This is just a wrapper to remove some boilerplate. + * @param {string} src - The src="" value for the iframe + */ +export async function insertCustomIframe(src) { + const iframe = document.createElement("iframe"); + iframe.src = src; + + const waitPromise = waitForIframe(iframe); + document.body.append(iframe); + await waitPromise; + + return iframe; +} + +/** + * This is the part of send-oac-header.py that allows us to reuse testGetter. + */ +export const testSupportScript = ` + +`; diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/resources/javascript-url-test.mjs b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/resources/javascript-url-test.mjs new file mode 100644 index 0000000000..de474d8caf --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/resources/javascript-url-test.mjs @@ -0,0 +1,14 @@ +import { insertCustomIframe, testSupportScript } from "./helpers.mjs"; +import { testGetter } from "../../resources/helpers.mjs"; + +export default ({ expected }) => { + promise_setup(() => { + return insertCustomIframe(`javascript:'${testSupportScript}'`); + }); + + // The javascript: URL iframe inherits its origin from the previous occupant + // of the iframe, which is about:blank, which in turn inherits from the + // parent. So, the caller needs to tell us what to expect. + + testGetter(0, expected); +}; diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/resources/sandboxed-iframe-test.sub.mjs b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/resources/sandboxed-iframe-test.sub.mjs new file mode 100644 index 0000000000..9357df00c5 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/resources/sandboxed-iframe-test.sub.mjs @@ -0,0 +1,20 @@ +import { + navigateIframe, + testGetter +} from "../../resources/helpers.mjs"; + +export default () => { + // We do this manually instead of using insertIframe because we want to add a + // sandbox="" attribute and we don't want to set both document.domains. + promise_setup(() => { + const iframe = document.createElement("iframe"); + iframe.sandbox = "allow-scripts"; + const navigatePromise = navigateIframe(iframe, "{{hosts[][]}}", "?1"); + document.body.append(iframe); + return navigatePromise; + }); + + // Sandboxed iframes have an opaque origin, so it should return true, since + // for them site === origin so they are always origin-keyed. + testGetter(0, true); +}; diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/resources/sandboxed-same-origin-iframe-test.sub.mjs b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/resources/sandboxed-same-origin-iframe-test.sub.mjs new file mode 100644 index 0000000000..272f805870 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/resources/sandboxed-same-origin-iframe-test.sub.mjs @@ -0,0 +1,20 @@ +import { + navigateIframe, + testGetter +} from "../../resources/helpers.mjs"; + +export default ({ expected }) => { + // We do this manually instead of using insertIframe because we want to add a + // sandbox="" attribute and we don't want to set both document.domains. + promise_setup(() => { + const iframe = document.createElement("iframe"); + iframe.sandbox = "allow-scripts allow-same-origin"; + const navigatePromise = navigateIframe(iframe, "{{hosts[][]}}", "?1"); + document.body.append(iframe); + return navigatePromise; + }); + + // Since the allow-same-origin token is set, this should behave like a normal + // iframe, and follow the embedder. + testGetter(0, expected); +}; diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/sandboxed-iframe-no.https.html b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/sandboxed-iframe-no.https.html new file mode 100644 index 0000000000..29758a17b8 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/sandboxed-iframe-no.https.html @@ -0,0 +1,12 @@ + + +window.originAgentCluster for a sandboxed iframe on a site-keyed page + + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/sandboxed-iframe-yes.https.html b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/sandboxed-iframe-yes.https.html new file mode 100644 index 0000000000..5eb5d08d10 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/sandboxed-iframe-yes.https.html @@ -0,0 +1,12 @@ + + +window.originAgentCluster for a sandboxed iframe on an origin-keyed page + + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/sandboxed-iframe-yes.https.html.headers b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/sandboxed-iframe-yes.https.html.headers new file mode 100644 index 0000000000..79a20f30fc --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/sandboxed-iframe-yes.https.html.headers @@ -0,0 +1 @@ +Origin-Agent-Cluster: ?1 diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/sandboxed-same-origin-iframe-no.https.html b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/sandboxed-same-origin-iframe-no.https.html new file mode 100644 index 0000000000..3ed4096f39 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/sandboxed-same-origin-iframe-no.https.html @@ -0,0 +1,12 @@ + + +window.originAgentCluster for a sandboxed, but same-origin, iframe on a site-keyed page + + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/sandboxed-same-origin-iframe-yes.https.html b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/sandboxed-same-origin-iframe-yes.https.html new file mode 100644 index 0000000000..c7ea5f0693 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/sandboxed-same-origin-iframe-yes.https.html @@ -0,0 +1,12 @@ + + +window.originAgentCluster for a sandboxed, but same-origin, iframe on an origin-keyed page + + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/sandboxed-same-origin-iframe-yes.https.html.headers b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/sandboxed-same-origin-iframe-yes.https.html.headers new file mode 100644 index 0000000000..79a20f30fc --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/getter-special-cases/sandboxed-same-origin-iframe-yes.https.html.headers @@ -0,0 +1 @@ +Origin-Agent-Cluster: ?1 diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/going-back.sub.https.html b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/going-back.sub.https.html new file mode 100644 index 0000000000..a593619ea6 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/going-back.sub.https.html @@ -0,0 +1,62 @@ + + +Parent is origin-keyed, child1 is site-keyed, child1 navigates to a different site, child2 gets inserted and is origin-keyed, child1 navigates back + + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/going-back.sub.https.html.headers b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/going-back.sub.https.html.headers new file mode 100644 index 0000000000..79a20f30fc --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/going-back.sub.https.html.headers @@ -0,0 +1 @@ +Origin-Agent-Cluster: ?1 diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/iframe-navigation/parent-no-1-no-same-2-yes-port.sub.https.html b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/iframe-navigation/parent-no-1-no-same-2-yes-port.sub.https.html new file mode 100644 index 0000000000..8237f2f23f --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/iframe-navigation/parent-no-1-no-same-2-yes-port.sub.https.html @@ -0,0 +1,41 @@ + + +Parent is site-keyed, navigate a frame from same-origin site-keyed to different-origin (different-port) origin-keyed + + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/iframe-navigation/parent-no-1-no-same-2-yes-subdomain.sub.https.html b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/iframe-navigation/parent-no-1-no-same-2-yes-subdomain.sub.https.html new file mode 100644 index 0000000000..00d8c3164a --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/iframe-navigation/parent-no-1-no-same-2-yes-subdomain.sub.https.html @@ -0,0 +1,41 @@ + + +Parent is site-keyed, navigate a frame from same-origin site-keyed to different-origin (subdomain) origin-keyed + + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/iframe-navigation/parent-no-1-no-subdomain-2-yes-subdomain.sub.https.html b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/iframe-navigation/parent-no-1-no-subdomain-2-yes-subdomain.sub.https.html new file mode 100644 index 0000000000..803e684e1c --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/iframe-navigation/parent-no-1-no-subdomain-2-yes-subdomain.sub.https.html @@ -0,0 +1,40 @@ + + +Parent is site-keyed, navigate a frame from a subdomain site-keyed to the same subdomain origin-keyed + + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/iframe-navigation/parent-no-1-no-subdomain-2-yes-subdomain2.sub.https.html b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/iframe-navigation/parent-no-1-no-subdomain-2-yes-subdomain2.sub.https.html new file mode 100644 index 0000000000..b96d10afd1 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/iframe-navigation/parent-no-1-no-subdomain-2-yes-subdomain2.sub.https.html @@ -0,0 +1,41 @@ + + +Parent is site-keyed, navigate a frame from a subdomain site-keyed to a second-subdomain origin-keyed + + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/iframe-navigation/parent-no-1-subdomain-yes-2-subdomain2-no.sub.https.html b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/iframe-navigation/parent-no-1-subdomain-yes-2-subdomain2-no.sub.https.html new file mode 100644 index 0000000000..a70ed56670 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/iframe-navigation/parent-no-1-subdomain-yes-2-subdomain2-no.sub.https.html @@ -0,0 +1,43 @@ + + +Parent is site-keyed, navigate a frame from a subdomain origin-keyed to a second-subdomain site-keyed + + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/iframe-navigation/parent-no-1-yes-subdomain-2-no-subdomain.sub.https.html b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/iframe-navigation/parent-no-1-yes-subdomain-2-no-subdomain.sub.https.html new file mode 100644 index 0000000000..38e2630128 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/iframe-navigation/parent-no-1-yes-subdomain-2-no-subdomain.sub.https.html @@ -0,0 +1,41 @@ + + +Parent is site-keyed, navigate a frame from a subdomain origin-keyed to the same subdomain site-keyed + + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/iframe-navigation/parent-yes-1-no-same-2-no-port.sub.https.html b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/iframe-navigation/parent-yes-1-no-same-2-no-port.sub.https.html new file mode 100644 index 0000000000..6211845be1 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/iframe-navigation/parent-yes-1-no-same-2-no-port.sub.https.html @@ -0,0 +1,41 @@ + + +Parent is origin-keyed, navigate a frame from same-origin site-keyed to different-origin (different-port) origin-keyed + + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/iframe-navigation/parent-yes-1-no-same-2-no-port.sub.https.html.headers b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/iframe-navigation/parent-yes-1-no-same-2-no-port.sub.https.html.headers new file mode 100644 index 0000000000..79a20f30fc --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/iframe-navigation/parent-yes-1-no-same-2-no-port.sub.https.html.headers @@ -0,0 +1 @@ +Origin-Agent-Cluster: ?1 diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/iframe-navigation/parent-yes-1-no-same-2-no-subdomain.sub.https.html b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/iframe-navigation/parent-yes-1-no-same-2-no-subdomain.sub.https.html new file mode 100644 index 0000000000..ead56754a7 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/iframe-navigation/parent-yes-1-no-same-2-no-subdomain.sub.https.html @@ -0,0 +1,41 @@ + + +Parent is origin-keyed, navigate a frame from same-origin site-keyed to different-origin (subdomain) origin-keyed + + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/iframe-navigation/parent-yes-1-no-same-2-no-subdomain.sub.https.html.headers b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/iframe-navigation/parent-yes-1-no-same-2-no-subdomain.sub.https.html.headers new file mode 100644 index 0000000000..79a20f30fc --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/iframe-navigation/parent-yes-1-no-same-2-no-subdomain.sub.https.html.headers @@ -0,0 +1 @@ +Origin-Agent-Cluster: ?1 diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/insecure-http.sub.html b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/insecure-http.sub.html new file mode 100644 index 0000000000..6f9e5d8b73 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/insecure-http.sub.html @@ -0,0 +1,26 @@ + + +Parent requests origin-keying, child requests origin-keying, child is a subdomain of the parent, but all over insecure HTTP + + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/insecure-http.sub.html.headers b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/insecure-http.sub.html.headers new file mode 100644 index 0000000000..79a20f30fc --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/insecure-http.sub.html.headers @@ -0,0 +1 @@ +Origin-Agent-Cluster: ?1 diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/popups-crash.https.html b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/popups-crash.https.html new file mode 100644 index 0000000000..dcfb5eb277 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/popups-crash.https.html @@ -0,0 +1,9 @@ + + +Crash test for https://crbug.com/1099718 + +
+ + diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/popups/opener-no-openee-yes-port.sub.https.html b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/popups/opener-no-openee-yes-port.sub.https.html new file mode 100644 index 0000000000..a0bf569b12 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/popups/opener-no-openee-yes-port.sub.https.html @@ -0,0 +1,28 @@ + + +Opener is site-keyed, openee is origin-keyed, openee is different-origin to the opener because of a port mismatch + + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/popups/opener-no-openee-yes-same.sub.https.html b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/popups/opener-no-openee-yes-same.sub.https.html new file mode 100644 index 0000000000..196dff1449 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/popups/opener-no-openee-yes-same.sub.https.html @@ -0,0 +1,27 @@ + + +Opener is site-keyed, openee is origin-keyed, openee is same-origin to the opener + + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/popups/opener-no-openee-yes-subdomain.sub.https.html b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/popups/opener-no-openee-yes-subdomain.sub.https.html new file mode 100644 index 0000000000..f96d2273d5 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/popups/opener-no-openee-yes-subdomain.sub.https.html @@ -0,0 +1,28 @@ + + +Opener is site-keyed, openee is origin-keyed, openee is a subdomain of the opener + + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/popups/opener-yes-openee-no-port.sub.https.html b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/popups/opener-yes-openee-no-port.sub.https.html new file mode 100644 index 0000000000..51c5a208c5 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/popups/opener-yes-openee-no-port.sub.https.html @@ -0,0 +1,28 @@ + + +Opener is origin-keyed, openee is site-keyed, openee is different-origin to the opener because of a port mismatch + + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/popups/opener-yes-openee-no-port.sub.https.html.headers b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/popups/opener-yes-openee-no-port.sub.https.html.headers new file mode 100644 index 0000000000..79a20f30fc --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/popups/opener-yes-openee-no-port.sub.https.html.headers @@ -0,0 +1 @@ +Origin-Agent-Cluster: ?1 diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/popups/opener-yes-openee-no-same.sub.https.html b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/popups/opener-yes-openee-no-same.sub.https.html new file mode 100644 index 0000000000..562ab40c68 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/popups/opener-yes-openee-no-same.sub.https.html @@ -0,0 +1,27 @@ + + +Opener is origin-keyed, openee is site-keyed, openee is same-origin to the opener + + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/popups/opener-yes-openee-no-same.sub.https.html.headers b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/popups/opener-yes-openee-no-same.sub.https.html.headers new file mode 100644 index 0000000000..79a20f30fc --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/popups/opener-yes-openee-no-same.sub.https.html.headers @@ -0,0 +1 @@ +Origin-Agent-Cluster: ?1 diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/popups/opener-yes-openee-no-subdomain.sub.https.html b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/popups/opener-yes-openee-no-subdomain.sub.https.html new file mode 100644 index 0000000000..d7d4791459 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/popups/opener-yes-openee-no-subdomain.sub.https.html @@ -0,0 +1,28 @@ + + +Opener is origin-keyed, openee is site-keyed, openee is a subdomain of the opener + + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/popups/opener-yes-openee-no-subdomain.sub.https.html.headers b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/popups/opener-yes-openee-no-subdomain.sub.https.html.headers new file mode 100644 index 0000000000..79a20f30fc --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/popups/opener-yes-openee-no-subdomain.sub.https.html.headers @@ -0,0 +1 @@ +Origin-Agent-Cluster: ?1 diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/popups/opener-yes-openee-yes-port.sub.https.html b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/popups/opener-yes-openee-yes-port.sub.https.html new file mode 100644 index 0000000000..32a5066d2e --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/popups/opener-yes-openee-yes-port.sub.https.html @@ -0,0 +1,28 @@ + + +Opener is origin-keyed, openee is origin-keyed, openee is different-origin to the opener because of a port mismatch + + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/popups/opener-yes-openee-yes-port.sub.https.html.headers b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/popups/opener-yes-openee-yes-port.sub.https.html.headers new file mode 100644 index 0000000000..79a20f30fc --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/popups/opener-yes-openee-yes-port.sub.https.html.headers @@ -0,0 +1 @@ +Origin-Agent-Cluster: ?1 diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/popups/opener-yes-openee-yes-same.sub.https.html b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/popups/opener-yes-openee-yes-same.sub.https.html new file mode 100644 index 0000000000..a85decac3c --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/popups/opener-yes-openee-yes-same.sub.https.html @@ -0,0 +1,27 @@ + + +Opener is origin-keyed, openee is origin-keyed, openee is same-origin to the opener + + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/popups/opener-yes-openee-yes-same.sub.https.html.headers b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/popups/opener-yes-openee-yes-same.sub.https.html.headers new file mode 100644 index 0000000000..79a20f30fc --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/popups/opener-yes-openee-yes-same.sub.https.html.headers @@ -0,0 +1 @@ +Origin-Agent-Cluster: ?1 diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/popups/opener-yes-openee-yes-subdomain.sub.https.html b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/popups/opener-yes-openee-yes-subdomain.sub.https.html new file mode 100644 index 0000000000..148b39af23 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/popups/opener-yes-openee-yes-subdomain.sub.https.html @@ -0,0 +1,28 @@ + + +Opener is origin-keyed, openee is origin-keyed, openee is a subdomain of the opener + + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/popups/opener-yes-openee-yes-subdomain.sub.https.html.headers b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/popups/opener-yes-openee-yes-subdomain.sub.https.html.headers new file mode 100644 index 0000000000..79a20f30fc --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/popups/opener-yes-openee-yes-subdomain.sub.https.html.headers @@ -0,0 +1 @@ +Origin-Agent-Cluster: ?1 diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/regression-1399759.https.sub.html b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/regression-1399759.https.sub.html new file mode 100644 index 0000000000..d0b09f335d --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/regression-1399759.https.sub.html @@ -0,0 +1,100 @@ + + + + + +Origin-Isolation after navigating about:blank. + + + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/removing-iframes.sub.https.html b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/removing-iframes.sub.https.html new file mode 100644 index 0000000000..b83aa9f5be --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/removing-iframes.sub.https.html @@ -0,0 +1,46 @@ + + +A site-keyed child at a given origin causes future children to also be site-keyed even after the iframe is removed + + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/removing-iframes.sub.https.html.headers b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/removing-iframes.sub.https.html.headers new file mode 100644 index 0000000000..79a20f30fc --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/removing-iframes.sub.https.html.headers @@ -0,0 +1 @@ +Origin-Agent-Cluster: ?1 diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/resources/README.md b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/resources/README.md new file mode 100644 index 0000000000..9292fe3894 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/resources/README.md @@ -0,0 +1,6 @@ +Why are there `.headers` files here for the `.mjs` scripts? + +Because `../getter-special-cases/sandboxed-iframe.sub.https.html` is testing an +opaque origin, which is cross-origin with these scripts. Since +` diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/resources/coep-frame.html.headers b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/resources/coep-frame.html.headers new file mode 100644 index 0000000000..4e798cd9f5 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/resources/coep-frame.html.headers @@ -0,0 +1,2 @@ +Cross-Origin-Embedder-Policy: require-corp +Cross-Origin-Resource-Policy: cross-origin diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/resources/crashy-popup.sub.html b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/resources/crashy-popup.sub.html new file mode 100644 index 0000000000..45c8d5074d --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/resources/crashy-popup.sub.html @@ -0,0 +1,6 @@ + + +This page helps exhibit a crash bug when window.open()ed (see ../popups-crash.https.html) + + + diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/resources/crashy-popup.sub.html.headers b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/resources/crashy-popup.sub.html.headers new file mode 100644 index 0000000000..79a20f30fc --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/resources/crashy-popup.sub.html.headers @@ -0,0 +1 @@ +Origin-Agent-Cluster: ?1 diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/resources/frame.html b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/resources/frame.html new file mode 100644 index 0000000000..537de07b14 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/resources/frame.html @@ -0,0 +1,12 @@ + + +A frame included by a test page + + diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/resources/frame.html.headers b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/resources/frame.html.headers new file mode 100644 index 0000000000..79a20f30fc --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/resources/frame.html.headers @@ -0,0 +1 @@ +Origin-Agent-Cluster: ?1 diff --git a/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/resources/helpers.mjs b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/resources/helpers.mjs new file mode 100644 index 0000000000..6bad76e3d9 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/origin-keyed-agent-clusters/resources/helpers.mjs @@ -0,0 +1,390 @@ +/** + * Inserts an iframe usable for origin-keyed agent cluster testing, and returns + * a promise fulfilled when the iframe is loaded and its document.domain is set. + * The iframe will point to the send-oac-header.py file, on the designated + * host. + * @param {string} host - The host used to calculate the iframe's src="" + * @param {string=} header - The value of the Origin-Agent-Cluster header that + * the iframe will set. Omit this to set no header. + * @param {object=} options - Rarely-used options. + * @param {boolean=} options.redirectFirst - Whether to do a 302 redirect first + * before arriving at the page that sets the header. The redirecting page will + * not set the Origin-Agent-Cluster header. + * @returns {HTMLIFrameElement} The created iframe element + */ +export async function insertIframe(host, header, { redirectFirst = false } = {}) { + const iframe = document.createElement("iframe"); + const navigatePromise = navigateIframe(iframe, host, header, { redirectFirst }); + document.body.append(iframe); + await navigatePromise; + await setBothDocumentDomains(iframe.contentWindow); + return iframe; +} + +/** + * Navigates an iframe to a page for origin-keyed agent cluster testing, similar + * to insertIframe but operating on an existing iframe. + * @param {HTMLIFrameElement} iframeEl - The + + + diff --git a/testing/web-platform/tests/html/browsers/origin/relaxing-the-same-origin-restriction/document_domain_setter_srcdoc.html b/testing/web-platform/tests/html/browsers/origin/relaxing-the-same-origin-restriction/document_domain_setter_srcdoc.html new file mode 100644 index 0000000000..65a7f5c898 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/relaxing-the-same-origin-restriction/document_domain_setter_srcdoc.html @@ -0,0 +1,84 @@ + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/origin/relaxing-the-same-origin-restriction/sandboxed-document_domain.html b/testing/web-platform/tests/html/browsers/origin/relaxing-the-same-origin-restriction/sandboxed-document_domain.html new file mode 100644 index 0000000000..ae1a0ccd56 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/relaxing-the-same-origin-restriction/sandboxed-document_domain.html @@ -0,0 +1,21 @@ + +Sandboxed document.domain + + + diff --git a/testing/web-platform/tests/html/browsers/origin/relaxing-the-same-origin-restriction/sandboxed-document_domain.html.headers b/testing/web-platform/tests/html/browsers/origin/relaxing-the-same-origin-restriction/sandboxed-document_domain.html.headers new file mode 100644 index 0000000000..82e8023d0b --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/relaxing-the-same-origin-restriction/sandboxed-document_domain.html.headers @@ -0,0 +1 @@ +Content-Security-Policy: sandbox allow-scripts allow-same-origin diff --git a/testing/web-platform/tests/html/browsers/origin/relaxing-the-same-origin-restriction/support/document_domain_frame.html b/testing/web-platform/tests/html/browsers/origin/relaxing-the-same-origin-restriction/support/document_domain_frame.html new file mode 100644 index 0000000000..61f54af359 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/relaxing-the-same-origin-restriction/support/document_domain_frame.html @@ -0,0 +1,52 @@ + + + diff --git a/testing/web-platform/tests/html/browsers/origin/relaxing-the-same-origin-restriction/support/document_domain_frame.sub.js b/testing/web-platform/tests/html/browsers/origin/relaxing-the-same-origin-restriction/support/document_domain_frame.sub.js new file mode 100644 index 0000000000..b6631ea4f1 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/relaxing-the-same-origin-restriction/support/document_domain_frame.sub.js @@ -0,0 +1,65 @@ +/** + * Utilities to be used with document_domain_frame.html. + */ + +/** + * Send a message to the frame and resolve a promise when a response is received. + * + * Supported messages: + * + * 1) { domain: something }. Has the subframe try to set document.domain to the + * given value, and message back 'Done' if that succeeds or an error name if it + * fails. + * + * 2) 'poke-at-parent'. Has the subframe try to synchronously attempt to access + * the parent's DOM, read out a string value, and message it back to the parent. + * Again, sends back the error name if that fails. + * + * 3) { 'poke-at-sibling': name }. Has the subframe try to synchronously + * attempt to access the DOM of the sibling with the given name, read out a + * string value, and message it back to the parent. + */ +function postMessageToFrame(frame, message) { + return new Promise(resolve => { + var c = new MessageChannel(); + c.port1.onmessage = e => { + resolve({ data: e.data, frame: frame }) + }; + frame.contentWindow.postMessage(message, '*', [c.port2]); + }); +} + +/** + * Create a frame that loads document_domain_frame.html and resolves a promise + * when the frame is loaded enough to be sending and receiving messages. + * + * If a "name" argument is provided, that name is used for the iframe, so + * + * If a "hostname" argument is provided, that hostname is used for the load, to + * allow testing details of the behavior when different sorts of hostnames are + * used. + */ +function createFrame(t, name, hostname) { + return new Promise(resolve => { + var i = document.createElement('iframe'); + if (hostname) { + i.src = `//${hostname}:{{location[port]}}/html/browsers/origin/relaxing-the-same-origin-restriction/support/document_domain_frame.html`; + } else { + i.src = "support/document_domain_frame.html"; + } + if (name) { + i.name = name; + } + var listener = m => { + if (m.source == i.contentWindow) + resolve(i); + } + window.addEventListener('message', listener); + t.add_cleanup(() => { + i.remove(); + window.removeEventListener('message', listener); + }); + document.body.appendChild(i); + }); +} + diff --git a/testing/web-platform/tests/html/browsers/origin/relaxing-the-same-origin-restriction/support/document_domain_setter_iframe.html b/testing/web-platform/tests/html/browsers/origin/relaxing-the-same-origin-restriction/support/document_domain_setter_iframe.html new file mode 100644 index 0000000000..d3d5260af3 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/relaxing-the-same-origin-restriction/support/document_domain_setter_iframe.html @@ -0,0 +1,12 @@ + + + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/sandboxing/inner-iframe.html b/testing/web-platform/tests/html/browsers/sandboxing/inner-iframe.html new file mode 100644 index 0000000000..229f6b3d85 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/sandboxing/inner-iframe.html @@ -0,0 +1,13 @@ + + + + + + +
foo
+ + diff --git a/testing/web-platform/tests/html/browsers/sandboxing/noscript-iframe.html b/testing/web-platform/tests/html/browsers/sandboxing/noscript-iframe.html new file mode 100644 index 0000000000..677b5fc83a --- /dev/null +++ b/testing/web-platform/tests/html/browsers/sandboxing/noscript-iframe.html @@ -0,0 +1,3 @@ + + + diff --git a/testing/web-platform/tests/html/browsers/sandboxing/popup-from-initial-empty-sandboxed-document.window.js b/testing/web-platform/tests/html/browsers/sandboxing/popup-from-initial-empty-sandboxed-document.window.js new file mode 100644 index 0000000000..1ae4fad0cb --- /dev/null +++ b/testing/web-platform/tests/html/browsers/sandboxing/popup-from-initial-empty-sandboxed-document.window.js @@ -0,0 +1,46 @@ +// META: timeout=long +// META: script=/common/utils.js +// META: script=/common/dispatcher/dispatcher.js + +// Regression test for: https://crbug.com/1256822. +// +// From a sandboxed iframe allowing popups, scripts, and same-origin. Open a +// popup using the WindowProxy of a new iframe that is still on the initial +// empty document. Check that the sandbox flags are properly inherited. + +// Return true if the execution context is sandboxed. +const isSandboxed = () => { + try { + // Setting document.domain in sandboxed document throw errors. + document.domain = document.domain; + return false; + } catch (error) { + return true; + } +} + +promise_test(async test => { + // 1. Create a sandboxed iframe, allowing popups, same-origin and scripts. + const iframe_token = token(); + const iframe_document = new RemoteContext(iframe_token); + const iframe_url = remoteExecutorUrl(iframe_token); + const iframe = document.createElement("iframe"); + iframe.sandbox = "allow-same-origin allow-scripts allow-popups"; + iframe.src = iframe_url; + document.body.appendChild(iframe); + assert_true(await iframe_document.execute_script(isSandboxed), + "iframe is sandboxed"); + + // 2. From the sandboxed iframe, create an empty iframe, and open a popup + // using it's WindowProxy. The popup must inherit sandbox flags. + const popup_token = token(); + const popup_document = new RemoteContext(popup_token); + const popup_url = remoteExecutorUrl(popup_token); + iframe_document.execute_script((popup_url) => { + let iframe = document.createElement("iframe"); + iframe.name = "iframe_name"; + document.body.appendChild(iframe); + iframe_name.open(popup_url); + }, [popup_url.href]); + assert_true(await popup_document.execute_script(isSandboxed), "popup is sandboxed"); +}); diff --git a/testing/web-platform/tests/html/browsers/sandboxing/resources/check-sandbox-flags.html b/testing/web-platform/tests/html/browsers/sandboxing/resources/check-sandbox-flags.html new file mode 100644 index 0000000000..0dc95315f1 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/sandboxing/resources/check-sandbox-flags.html @@ -0,0 +1,8 @@ + diff --git a/testing/web-platform/tests/html/browsers/sandboxing/resources/document-open.html b/testing/web-platform/tests/html/browsers/sandboxing/resources/document-open.html new file mode 100644 index 0000000000..136c494d5a --- /dev/null +++ b/testing/web-platform/tests/html/browsers/sandboxing/resources/document-open.html @@ -0,0 +1,14 @@ + diff --git a/testing/web-platform/tests/html/browsers/sandboxing/resources/execute-postmessage.html b/testing/web-platform/tests/html/browsers/sandboxing/resources/execute-postmessage.html new file mode 100644 index 0000000000..89bd268f9c --- /dev/null +++ b/testing/web-platform/tests/html/browsers/sandboxing/resources/execute-postmessage.html @@ -0,0 +1,5 @@ + diff --git a/testing/web-platform/tests/html/browsers/sandboxing/resources/post-done-to-opener.html b/testing/web-platform/tests/html/browsers/sandboxing/resources/post-done-to-opener.html new file mode 100644 index 0000000000..b47f0f274e --- /dev/null +++ b/testing/web-platform/tests/html/browsers/sandboxing/resources/post-done-to-opener.html @@ -0,0 +1,3 @@ + diff --git a/testing/web-platform/tests/html/browsers/sandboxing/resources/sandbox-inherited-from-initiator-response-helper.html b/testing/web-platform/tests/html/browsers/sandboxing/resources/sandbox-inherited-from-initiator-response-helper.html new file mode 100644 index 0000000000..29c7f12441 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/sandboxing/resources/sandbox-inherited-from-initiator-response-helper.html @@ -0,0 +1,15 @@ + diff --git a/testing/web-platform/tests/html/browsers/sandboxing/resources/sandbox-inherited-from-initiator-response-helper.html.headers b/testing/web-platform/tests/html/browsers/sandboxing/resources/sandbox-inherited-from-initiator-response-helper.html.headers new file mode 100644 index 0000000000..82e8023d0b --- /dev/null +++ b/testing/web-platform/tests/html/browsers/sandboxing/resources/sandbox-inherited-from-initiator-response-helper.html.headers @@ -0,0 +1 @@ +Content-Security-Policy: sandbox allow-scripts allow-same-origin diff --git a/testing/web-platform/tests/html/browsers/sandboxing/resources/sandbox-javascript-window-open.html b/testing/web-platform/tests/html/browsers/sandboxing/resources/sandbox-javascript-window-open.html new file mode 100644 index 0000000000..909956a54f --- /dev/null +++ b/testing/web-platform/tests/html/browsers/sandboxing/resources/sandbox-javascript-window-open.html @@ -0,0 +1,18 @@ + diff --git a/testing/web-platform/tests/html/browsers/sandboxing/sandbox-allow-same-origin.html b/testing/web-platform/tests/html/browsers/sandboxing/sandbox-allow-same-origin.html new file mode 100644 index 0000000000..d6b3b099f2 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/sandboxing/sandbox-allow-same-origin.html @@ -0,0 +1,30 @@ + + + + DOM access in sandbox="allow-same-origin" iframe + + + + + + + +

DOM access in sandbox="allow-same-origin" iframe

+ + + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/sandboxing/sandbox-allow-scripts.html b/testing/web-platform/tests/html/browsers/sandboxing/sandbox-allow-scripts.html new file mode 100644 index 0000000000..6cf3f5a4a8 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/sandboxing/sandbox-allow-scripts.html @@ -0,0 +1,29 @@ + + + + Script execution in sandbox="allow-scripts" iframe + + + + + + + +

Script execution in sandbox="allow-scripts" iframe

+ + + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/sandboxing/sandbox-disallow-popups.html b/testing/web-platform/tests/html/browsers/sandboxing/sandbox-disallow-popups.html new file mode 100644 index 0000000000..8e4b34eb8b --- /dev/null +++ b/testing/web-platform/tests/html/browsers/sandboxing/sandbox-disallow-popups.html @@ -0,0 +1,39 @@ + + +window.open in sandbox iframe + + + + + diff --git a/testing/web-platform/tests/html/browsers/sandboxing/sandbox-disallow-same-origin.html b/testing/web-platform/tests/html/browsers/sandboxing/sandbox-disallow-same-origin.html new file mode 100644 index 0000000000..0dae0137ac --- /dev/null +++ b/testing/web-platform/tests/html/browsers/sandboxing/sandbox-disallow-same-origin.html @@ -0,0 +1,35 @@ + + + + Access to sandbox iframe + + + + + + + + +

Access to sandbox iframe

+ + + + + +
+ diff --git a/testing/web-platform/tests/html/browsers/sandboxing/sandbox-disallow-scripts-via-unsandboxed-popup.tentative.html b/testing/web-platform/tests/html/browsers/sandboxing/sandbox-disallow-scripts-via-unsandboxed-popup.tentative.html new file mode 100644 index 0000000000..3c8c0b346a --- /dev/null +++ b/testing/web-platform/tests/html/browsers/sandboxing/sandbox-disallow-scripts-via-unsandboxed-popup.tentative.html @@ -0,0 +1,33 @@ + + + + + + diff --git a/testing/web-platform/tests/html/browsers/sandboxing/sandbox-disallow-scripts.html b/testing/web-platform/tests/html/browsers/sandboxing/sandbox-disallow-scripts.html new file mode 100644 index 0000000000..1bc116ada4 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/sandboxing/sandbox-disallow-scripts.html @@ -0,0 +1,29 @@ + + + + Script execution in sandbox iframe + + + + + + + +

Script execution in sandbox iframe

+ + + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/sandboxing/sandbox-document-open-mutation.window.js b/testing/web-platform/tests/html/browsers/sandboxing/sandbox-document-open-mutation.window.js new file mode 100644 index 0000000000..713ca612c5 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/sandboxing/sandbox-document-open-mutation.window.js @@ -0,0 +1,37 @@ +// Return whether the current context is sandboxed or not. The implementation do +// not matter much, but might have to change over time depending on what side +// effect sandbox flag have. Feel free to update as needed. +const is_sandboxed = () => { + try { + document.domain = document.domain; + return "not sandboxed"; + } catch (error) { + return "sandboxed"; + } +}; + +promise_test(async test => { + const message = new Promise(r => window.addEventListener("message", r)); + + const iframe_unsandboxed = document.createElement("iframe"); + document.body.appendChild(iframe_unsandboxed); + + const iframe_sandboxed = document.createElement("iframe"); + iframe_sandboxed.sandbox = "allow-same-origin allow-scripts"; + document.body.appendChild(iframe_sandboxed); + + iframe_sandboxed.srcdoc = ` + + + + + + diff --git a/testing/web-platform/tests/html/browsers/sandboxing/sandbox-inherited-from-initiator-frame.html b/testing/web-platform/tests/html/browsers/sandboxing/sandbox-inherited-from-initiator-frame.html new file mode 100644 index 0000000000..ab87fce5e0 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/sandboxing/sandbox-inherited-from-initiator-frame.html @@ -0,0 +1,64 @@ + + +Inherit sandbox flags from the initiator's frame + + + + diff --git a/testing/web-platform/tests/html/browsers/sandboxing/sandbox-inherited-from-initiator-response.html b/testing/web-platform/tests/html/browsers/sandboxing/sandbox-inherited-from-initiator-response.html new file mode 100644 index 0000000000..638f1ba783 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/sandboxing/sandbox-inherited-from-initiator-response.html @@ -0,0 +1,46 @@ + + +Inherit sandbox flags from the initiator's response + + + + diff --git a/testing/web-platform/tests/html/browsers/sandboxing/sandbox-inherited-from-required-csp.html b/testing/web-platform/tests/html/browsers/sandboxing/sandbox-inherited-from-required-csp.html new file mode 100644 index 0000000000..04f485cc66 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/sandboxing/sandbox-inherited-from-required-csp.html @@ -0,0 +1,154 @@ + + +Inherit sandbox from CSP embedded enforcement + + + + + diff --git a/testing/web-platform/tests/html/browsers/sandboxing/sandbox-initial-empty-document-toward-same-origin.html b/testing/web-platform/tests/html/browsers/sandboxing/sandbox-initial-empty-document-toward-same-origin.html new file mode 100644 index 0000000000..d1306c9703 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/sandboxing/sandbox-initial-empty-document-toward-same-origin.html @@ -0,0 +1,30 @@ + + + + Check sandbox-flags inheritance in case of javascript window reuse. + + + + + diff --git a/testing/web-platform/tests/html/browsers/sandboxing/sandbox-javascript-window-open.html b/testing/web-platform/tests/html/browsers/sandboxing/sandbox-javascript-window-open.html new file mode 100644 index 0000000000..fd21e9bb02 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/sandboxing/sandbox-javascript-window-open.html @@ -0,0 +1,19 @@ + + +window.open in sandbox iframe + + + + + diff --git a/testing/web-platform/tests/html/browsers/sandboxing/sandbox-navigation-timing-iframe.tentative.html b/testing/web-platform/tests/html/browsers/sandboxing/sandbox-navigation-timing-iframe.tentative.html new file mode 100644 index 0000000000..43726e7720 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/sandboxing/sandbox-navigation-timing-iframe.tentative.html @@ -0,0 +1,16 @@ + + + \ No newline at end of file diff --git a/testing/web-platform/tests/html/browsers/sandboxing/sandbox-navigation-timing.tentative.html b/testing/web-platform/tests/html/browsers/sandboxing/sandbox-navigation-timing.tentative.html new file mode 100644 index 0000000000..686f1c0c9f --- /dev/null +++ b/testing/web-platform/tests/html/browsers/sandboxing/sandbox-navigation-timing.tentative.html @@ -0,0 +1,29 @@ + + +Sandbox Navigation Timing + + + + diff --git a/testing/web-platform/tests/html/browsers/sandboxing/sandbox-new-execution-context-iframe.html b/testing/web-platform/tests/html/browsers/sandboxing/sandbox-new-execution-context-iframe.html new file mode 100644 index 0000000000..801e78f9c0 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/sandboxing/sandbox-new-execution-context-iframe.html @@ -0,0 +1,5 @@ + + + diff --git a/testing/web-platform/tests/html/browsers/sandboxing/sandbox-new-execution-context.html b/testing/web-platform/tests/html/browsers/sandboxing/sandbox-new-execution-context.html new file mode 100644 index 0000000000..dc1953aee6 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/sandboxing/sandbox-new-execution-context.html @@ -0,0 +1,39 @@ + + + + Reuse of iframe about:blank document execution context + + + + + + + +

Reuse of iframe about:blank document execution context in sandbox="allow-scripts" iframe

+ +
+ + diff --git a/testing/web-platform/tests/html/browsers/sandboxing/sandbox-parse-noscript-ref.html b/testing/web-platform/tests/html/browsers/sandboxing/sandbox-parse-noscript-ref.html new file mode 100644 index 0000000000..9cf92768f7 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/sandboxing/sandbox-parse-noscript-ref.html @@ -0,0 +1,6 @@ + + +noscript parsing when sandbox disables scripting + + + diff --git a/testing/web-platform/tests/html/browsers/sandboxing/sandbox-parse-noscript.html b/testing/web-platform/tests/html/browsers/sandboxing/sandbox-parse-noscript.html new file mode 100644 index 0000000000..bb7ced0a14 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/sandboxing/sandbox-parse-noscript.html @@ -0,0 +1,7 @@ + + +noscript parsing when sandbox disables scripting + + + + diff --git a/testing/web-platform/tests/html/browsers/sandboxing/sandbox-window-open-srcdoc.html b/testing/web-platform/tests/html/browsers/sandboxing/sandbox-window-open-srcdoc.html new file mode 100644 index 0000000000..6fbff6df82 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/sandboxing/sandbox-window-open-srcdoc.html @@ -0,0 +1,52 @@ + + +window.open("about:srcdoc") from a sandboxed iframe + + + + diff --git a/testing/web-platform/tests/html/browsers/sandboxing/window-open-blank-from-different-initiator.html b/testing/web-platform/tests/html/browsers/sandboxing/window-open-blank-from-different-initiator.html new file mode 100644 index 0000000000..91817c3db4 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/sandboxing/window-open-blank-from-different-initiator.html @@ -0,0 +1,90 @@ + + + + + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/BarProp.window.js b/testing/web-platform/tests/html/browsers/the-window-object/BarProp.window.js new file mode 100644 index 0000000000..266779ee0b --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/BarProp.window.js @@ -0,0 +1,59 @@ +function assert_barProps(barPropObjects, visible) { + let lastBarProp = undefined; + for (const currentBarProp of barPropObjects) { + assert_not_equals(currentBarProp, lastBarProp, "BarBrop objects of different properties are identical"); + assert_equals(currentBarProp.visible, visible, "a BarProp's visible is wrong"); + lastBarProp = currentBarProp; + } +} + +function assert_identical_barProps(barProps, w, oldBarPropObjects, visible) { + barProps.map(val => w[val]).map((val, index) => { + assert_equals(val, oldBarPropObjects[index], "BarProp identity not preserved"); + }); + assert_barProps(oldBarPropObjects, visible); +} + +async_test(t => { + const frame = document.body.appendChild(document.createElement("iframe")), + frameW = frame.contentWindow, + barProps = ["locationbar", "menubar", "personalbar", "scrollbars", "statusbar", "toolbar"], + barPropObjects = barProps.map(val => frameW[val]); + + assert_barProps(barPropObjects, true); + frame.remove(); + assert_identical_barProps(barProps, frameW, barPropObjects, false); + t.step_timeout(() => { + assert_identical_barProps(barProps, frameW, barPropObjects, false); + t.done(); + }, 0); +}, "BarBrop objects of a nested Window"); + +async_test(t => { + const openee = window.open("/common/blank.html"), + barProps = ["locationbar", "menubar", "personalbar", "scrollbars", "statusbar", "toolbar"], + barPropObjects = barProps.map(val => openee[val]); + + // This is used to demonstrate that the Document is replaced while the global object (not the + // global this object) stays the same + openee.tiedToGlobalObject = openee.document; + + assert_barProps(barPropObjects, true); + openee.onload = t.step_func(() => { + assert_own_property(openee, "tiedToGlobalObject"); + assert_not_equals(openee.tiedToGlobalObject, openee.document); + + assert_identical_barProps(barProps, openee, barPropObjects, true); + + openee.onpagehide = t.step_func(() => { + assert_identical_barProps(barProps, openee, barPropObjects, true); + t.step_timeout(() => { + assert_identical_barProps(barProps, openee, barPropObjects, false); + t.done(); + }, 0); + }); + + openee.close(); + assert_identical_barProps(barProps, openee, barPropObjects, true); + }); +}, "BarProp objects of an auxiliary Window"); diff --git a/testing/web-platform/tests/html/browsers/the-window-object/Document-defaultView.html b/testing/web-platform/tests/html/browsers/the-window-object/Document-defaultView.html new file mode 100644 index 0000000000..dbc75d30b2 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/Document-defaultView.html @@ -0,0 +1,38 @@ + + +Document#defaultView + + +
+ diff --git a/testing/web-platform/tests/html/browsers/the-window-object/Window-document.html b/testing/web-platform/tests/html/browsers/the-window-object/Window-document.html new file mode 100644 index 0000000000..9b27f5f7c7 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/Window-document.html @@ -0,0 +1,25 @@ + + +Window#document + + +
+ diff --git a/testing/web-platform/tests/html/browsers/the-window-object/accessing-other-browsing-contexts/indexed-browsing-contexts-01.html b/testing/web-platform/tests/html/browsers/the-window-object/accessing-other-browsing-contexts/indexed-browsing-contexts-01.html new file mode 100644 index 0000000000..9710d15fb2 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/accessing-other-browsing-contexts/indexed-browsing-contexts-01.html @@ -0,0 +1,47 @@ + + +HTML Test: the browsing contexts must be sorted in the order that their containers were inserted into the Document + + + + +
+ + + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/accessing-other-browsing-contexts/indexed-browsing-contexts-02.html b/testing/web-platform/tests/html/browsers/the-window-object/accessing-other-browsing-contexts/indexed-browsing-contexts-02.html new file mode 100644 index 0000000000..d09c944fd8 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/accessing-other-browsing-contexts/indexed-browsing-contexts-02.html @@ -0,0 +1,62 @@ + + + + HTML Test: the browsing contexts created by various container elements + + + + + + +
+
+ + + + +
+ diff --git a/testing/web-platform/tests/html/browsers/the-window-object/accessing-other-browsing-contexts/indexed-browsing-contexts-03.html b/testing/web-platform/tests/html/browsers/the-window-object/accessing-other-browsing-contexts/indexed-browsing-contexts-03.html new file mode 100644 index 0000000000..1548891175 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/accessing-other-browsing-contexts/indexed-browsing-contexts-03.html @@ -0,0 +1,30 @@ + + + + HTML Test: indexed property of a Window object + + + + + + +
+
+
+ + +
+ diff --git a/testing/web-platform/tests/html/browsers/the-window-object/accessing-other-browsing-contexts/iterator.html b/testing/web-platform/tests/html/browsers/the-window-object/accessing-other-browsing-contexts/iterator.html new file mode 100644 index 0000000000..76dc7dbae6 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/accessing-other-browsing-contexts/iterator.html @@ -0,0 +1,11 @@ + + +window[@@iterator] + + +
+ diff --git a/testing/web-platform/tests/html/browsers/the-window-object/accessing-other-browsing-contexts/test1.html b/testing/web-platform/tests/html/browsers/the-window-object/accessing-other-browsing-contexts/test1.html new file mode 100644 index 0000000000..f85f90f7c6 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/accessing-other-browsing-contexts/test1.html @@ -0,0 +1,12 @@ + + +HTML Test: child browsing contexts created by iframe elements + + + + + + +
+ +
diff --git a/testing/web-platform/tests/html/browsers/the-window-object/accessing-other-browsing-contexts/test2.html b/testing/web-platform/tests/html/browsers/the-window-object/accessing-other-browsing-contexts/test2.html new file mode 100644 index 0000000000..d6a16647fe --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/accessing-other-browsing-contexts/test2.html @@ -0,0 +1,6 @@ + + +HTML Test: child browsing contexts created by object and embed elements + + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/accessing-other-browsing-contexts/test3.html b/testing/web-platform/tests/html/browsers/the-window-object/accessing-other-browsing-contexts/test3.html new file mode 100644 index 0000000000..a62fdbaae7 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/accessing-other-browsing-contexts/test3.html @@ -0,0 +1,8 @@ + + +HTML Test: child browsing contexts created by frame elements + + + + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/accessing-other-browsing-contexts/window_length.html b/testing/web-platform/tests/html/browsers/the-window-object/accessing-other-browsing-contexts/window_length.html new file mode 100644 index 0000000000..c9559b531a --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/accessing-other-browsing-contexts/window_length.html @@ -0,0 +1,51 @@ + +window.length + + +
+ diff --git a/testing/web-platform/tests/html/browsers/the-window-object/close-method.window.js b/testing/web-platform/tests/html/browsers/the-window-object/close-method.window.js new file mode 100644 index 0000000000..048c5f7236 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/close-method.window.js @@ -0,0 +1,39 @@ +function assert_closed_opener(w, closed, opener) { + assert_equals(w.closed, closed); + assert_equals(w.opener, opener); +} + +async_test(t => { + const openee = window.open(); + assert_closed_opener(openee, false, self); + openee.onpagehide = t.step_func(() => { + assert_closed_opener(openee, true, self); + t.step_timeout(() => { + assert_closed_opener(openee, true, null); + t.done(); + }, 0); + }); + openee.close(); + assert_closed_opener(openee, true, self); +}, "window.close() queues a task to discard, but window.closed knows immediately"); + +async_test(t => { + const openee = window.open("", "greatname"); + assert_closed_opener(openee, false, self); + openee.close(); + assert_closed_opener(openee, true, self); + const openee2 = window.open("", "greatname"); + assert_not_equals(openee, openee2); + assert_closed_opener(openee, true, self); // Ensure second window.open() call was synchronous + openee2.onpagehide = t.step_func(() => { + assert_closed_opener(openee2, true, self); + t.step_timeout(() => { + assert_closed_opener(openee, true, null); + assert_closed_opener(openee2, true, null); + t.done(); + }, 0); + }); + openee2.close(); + assert_closed_opener(openee, true, self); // Ensure second close() call was synchronous + assert_closed_opener(openee2, true, self); +}, "window.close() affects name targeting immediately"); diff --git a/testing/web-platform/tests/html/browsers/the-window-object/closed-attribute.window.js b/testing/web-platform/tests/html/browsers/the-window-object/closed-attribute.window.js new file mode 100644 index 0000000000..88a3beba6f --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/closed-attribute.window.js @@ -0,0 +1,69 @@ +// META: script=/common/get-host-info.sub.js + +function closedTest(newWindow, closeNewWindowsBrowsingContext) { + assert_equals(newWindow.closed, false); + closeNewWindowsBrowsingContext(); + assert_equals(newWindow.closed, true); +} + +test(() => { + const frame = document.body.appendChild(document.createElement("iframe")); + closedTest(frame.contentWindow, () => frame.remove()); +}, "closed and same-origin nested browsing context"); + +test(() => { + const openee = window.open(); + closedTest(openee, () => openee.close()); + + // close() is a no-op once "is closing" is set + openee.close(); + assert_equals(openee.closed, true); +}, "closed/close() and same-origin auxiliary browsing context"); + +const support = new URL("support/closed.html", location.href).pathname; +[ + { + type: "cross-origin", + url: `${get_host_info().HTTP_REMOTE_ORIGIN}${support}` + }, + { + type: "cross-site", + url: `${get_host_info().HTTP_NOTSAMESITE_ORIGIN}${support}` + } +].forEach(val => { + async_test(t => { + const frame = document.createElement("iframe"), + ident = `${val.type}-nested-bc`; + frame.src = `${val.url}?window=parent&ident=${ident}`; + const listener = t.step_func(e => { + if (e.data === ident) { + closedTest(frame.contentWindow, () => frame.remove()); + self.removeEventListener("message", listener); + t.done(); + } + }); + // Use a message event rather than onload for consistency with auxiliary browsing contexts. + self.addEventListener("message", listener); + document.body.append(frame); + }, `closed and ${val.type} nested browsing context`); + + async_test(t => { + const ident = `${val.type}-auxiliary-bc`, + support = new URL("support/closed.html", location.href).pathname, + openee = window.open(`${val.url}?window=opener&ident=${ident}`), + listener = t.step_func(e => { + if (e.data === ident) { + closedTest(openee, () => openee.close()); + + // close() is a no-op once "is closing" is set + openee.close(); + assert_equals(openee.closed, true); + + self.removeEventListener("message", listener); + t.done(); + } + }); + // As there's no cross-origin onload, use a message event. + self.addEventListener("message", listener); + }, `closed/close() and ${val.type} auxiliary browsing context`); +}); diff --git a/testing/web-platform/tests/html/browsers/the-window-object/defaultstatus.html b/testing/web-platform/tests/html/browsers/the-window-object/defaultstatus.html new file mode 100644 index 0000000000..f683f130cd --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/defaultstatus.html @@ -0,0 +1,17 @@ + + +window.defaultStatus and window.defaultstatus are not supported + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/document-attribute.window.js b/testing/web-platform/tests/html/browsers/the-window-object/document-attribute.window.js new file mode 100644 index 0000000000..f13acdb8a3 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/document-attribute.window.js @@ -0,0 +1,15 @@ +async_test(t => { + const frame = document.createElement("iframe"); + frame.onload = t.step_func(() => { + const frameW = frame.contentWindow, + frameD = frame.contentDocument; + assert_equals(frameW.document, frameD); + frame.remove(); + assert_equals(frameW.document, frameD); + t.step_timeout(() => { + assert_equals(frameW.document, frameD); + t.done(); + }, 100); + }); + document.body.append(frame); +}, "Window object's document IDL attribute and discarding the browsing context"); diff --git a/testing/web-platform/tests/html/browsers/the-window-object/focus.window.js b/testing/web-platform/tests/html/browsers/the-window-object/focus.window.js new file mode 100644 index 0000000000..6ec7feee28 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/focus.window.js @@ -0,0 +1,15 @@ +async_test(t => { + const input = document.body.appendChild(document.createElement("input")); + input.onfocus = t.step_func(() => { + const frame = document.body.appendChild(document.createElement("iframe")), + frameW = frame.contentWindow; + frameW.onfocus = t.unreached_func(); + frame.remove(); + frameW.focus(); + t.step_timeout(() => { + assert_equals(document.activeElement, input); + t.done(); + }, 100); + }); + input.focus(); +}); diff --git a/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_1-1.html b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_1-1.html new file mode 100644 index 0000000000..217608e46e --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_1-1.html @@ -0,0 +1,20 @@ + + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_1-2.html b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_1-2.html new file mode 100644 index 0000000000..b43598f2cd --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_1-2.html @@ -0,0 +1,2 @@ + +Filler text diff --git a/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_1.html b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_1.html new file mode 100644 index 0000000000..4d1e473fc0 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_1.html @@ -0,0 +1,10 @@ + +Removing iframe from document removes it from history + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_2-1.html b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_2-1.html new file mode 100644 index 0000000000..61e5891ebd --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_2-1.html @@ -0,0 +1,22 @@ + + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_2.html b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_2.html new file mode 100644 index 0000000000..89d0fb4c64 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_2.html @@ -0,0 +1,10 @@ + +Removing iframe from document via innerHTML removes it from history + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_3-1.html b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_3-1.html new file mode 100644 index 0000000000..de3f075d64 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_3-1.html @@ -0,0 +1,21 @@ + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_3-2.html b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_3-2.html new file mode 100644 index 0000000000..95f9fce5d8 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_3-2.html @@ -0,0 +1,4 @@ +Click me + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_3-3.html b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_3-3.html new file mode 100644 index 0000000000..4672b0ec30 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_3-3.html @@ -0,0 +1,4 @@ + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_3.html b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_3.html new file mode 100644 index 0000000000..38dbdbd0fa --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_3.html @@ -0,0 +1,9 @@ + +Removing iframe from document removes it from history + + +
+ diff --git a/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_4-1.html b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_4-1.html new file mode 100644 index 0000000000..1b5726cdcd --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_4-1.html @@ -0,0 +1,21 @@ + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_4-2.html b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_4-2.html new file mode 100644 index 0000000000..979b2b28e4 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_4-2.html @@ -0,0 +1,4 @@ +Click me + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_4-3.html b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_4-3.html new file mode 100644 index 0000000000..b4308f439a --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_4-3.html @@ -0,0 +1,4 @@ + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_4.html b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_4.html new file mode 100644 index 0000000000..ffd444e3bf --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/discard_iframe_history_4.html @@ -0,0 +1,9 @@ + +Removing iframe from document removes it from history + + +
+ diff --git a/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/discard_iframe_history_1-1.html b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/discard_iframe_history_1-1.html new file mode 100644 index 0000000000..9969427989 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/discard_iframe_history_1-1.html @@ -0,0 +1,27 @@ + + + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/discard_iframe_history_1-2.html b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/discard_iframe_history_1-2.html new file mode 100644 index 0000000000..8c3d1a9dad --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/discard_iframe_history_1-2.html @@ -0,0 +1,2 @@ + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/discard_iframe_history_1-manual.html b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/discard_iframe_history_1-manual.html new file mode 100644 index 0000000000..ca9dd91f2e --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/discard_iframe_history_1-manual.html @@ -0,0 +1,10 @@ + +Removing iframe from document removes it from history + + +
+ diff --git a/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/discard_iframe_history_2-1.html b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/discard_iframe_history_2-1.html new file mode 100644 index 0000000000..bc01cae88c --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/discard_iframe_history_2-1.html @@ -0,0 +1,19 @@ + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/discard_iframe_history_2-2.html b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/discard_iframe_history_2-2.html new file mode 100644 index 0000000000..b25bf5f001 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/discard_iframe_history_2-2.html @@ -0,0 +1 @@ +Click me diff --git a/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/discard_iframe_history_2-3.html b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/discard_iframe_history_2-3.html new file mode 100644 index 0000000000..68847e9a7c --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/discard_iframe_history_2-3.html @@ -0,0 +1 @@ + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/discard_iframe_history_2-manual.html b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/discard_iframe_history_2-manual.html new file mode 100644 index 0000000000..57eaabcd0c --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/garbage-collection-and-browsing-contexts/non-automated/discard_iframe_history_2-manual.html @@ -0,0 +1,10 @@ + +Removing iframe from document removes it from history + + +
+ diff --git a/testing/web-platform/tests/html/browsers/the-window-object/historical.window.js b/testing/web-platform/tests/html/browsers/the-window-object/historical.window.js new file mode 100644 index 0000000000..653f12b464 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/historical.window.js @@ -0,0 +1,4 @@ +test(() => { + assert_false("showModalDialog" in window) + assert_false("showModalDialog" in Window.prototype) +}, "showModalDialog() has been removed from the platform") diff --git a/testing/web-platform/tests/html/browsers/the-window-object/length-attribute.window.js b/testing/web-platform/tests/html/browsers/the-window-object/length-attribute.window.js new file mode 100644 index 0000000000..d56e1e4692 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/length-attribute.window.js @@ -0,0 +1,24 @@ +async_test(t => { + const frame = document.createElement("iframe"); + frame.srcdoc = ""; + frame.onload = t.step_func_done(() => { + const frameW = frame.contentWindow; + assert_equals(frameW.length, 2); + assert_not_equals(frameW.x, undefined); + assert_not_equals(frameW.y, undefined); + assert_equals(frameW.z, undefined); + assert_equals(frameW.x, frameW[0]); + assert_equals(frameW.y, frameW[1]); + const xFrameW = frameW.x; + assert_equals(xFrameW.length, 1); + assert_not_equals(xFrameW.z, undefined); + assert_equals(xFrameW.z, xFrameW[0]); + frame.remove(); + assert_equals(frameW.length, 0); + assert_equals(frameW.x, undefined); + assert_equals(frameW[0], undefined); + assert_equals(xFrameW.length, 0); + assert_equals(xFrameW.z, undefined); + }); + document.body.append(frame); +}, "Window object's length IDL attribute (and named access)"); diff --git a/testing/web-platform/tests/html/browsers/the-window-object/name-attribute.window.js b/testing/web-platform/tests/html/browsers/the-window-object/name-attribute.window.js new file mode 100644 index 0000000000..f266dd7acb --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/name-attribute.window.js @@ -0,0 +1,18 @@ +test(() => { + const frame = document.createElement("iframe"), + name = "A", + name2 = "B"; + frame.setAttribute("name", name); + document.body.append(frame); + const frameW = frame.contentWindow; + assert_equals(frameW.name, name); + frameW.name = name2; + assert_equals(frame.getAttribute("name"), name); + assert_equals(frameW.name, name2); + frame.remove(); + assert_equals(frame.getAttribute("name"), name); + assert_equals(frameW.name, ""); + frameW.name = name2; + assert_equals(frame.getAttribute("name"), name); + assert_equals(frameW.name, ""); +}, "Window object's name IDL attribute"); diff --git a/testing/web-platform/tests/html/browsers/the-window-object/named-access-on-the-window-object/cross-global-npo.html b/testing/web-platform/tests/html/browsers/the-window-object/named-access-on-the-window-object/cross-global-npo.html new file mode 100644 index 0000000000..2acad0734c --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/named-access-on-the-window-object/cross-global-npo.html @@ -0,0 +1,38 @@ + + +Named access across globals + + +
+ diff --git a/testing/web-platform/tests/html/browsers/the-window-object/named-access-on-the-window-object/cross-global-support.html b/testing/web-platform/tests/html/browsers/the-window-object/named-access-on-the-window-object/cross-global-support.html new file mode 100644 index 0000000000..9d7b9f8a25 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/named-access-on-the-window-object/cross-global-support.html @@ -0,0 +1,4 @@ + + +Named access across globals: support file + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/named-access-on-the-window-object/named-objects.html b/testing/web-platform/tests/html/browsers/the-window-object/named-access-on-the-window-object/named-objects.html new file mode 100644 index 0000000000..d5b1789d59 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/named-access-on-the-window-object/named-objects.html @@ -0,0 +1,76 @@ + + +HTML Test: Named access on the Window object + + + + +
+
+

+ + + +
+ + + + + + + + + + + + +
+ diff --git a/testing/web-platform/tests/html/browsers/the-window-object/named-access-on-the-window-object/navigated-named-objects.window.js b/testing/web-platform/tests/html/browsers/the-window-object/named-access-on-the-window-object/navigated-named-objects.window.js new file mode 100644 index 0000000000..59d94efc99 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/named-access-on-the-window-object/navigated-named-objects.window.js @@ -0,0 +1,67 @@ +// META: script=/common/get-host-info.sub.js + +function echoURL(content) { + return `/common/echo.py?content=${encodeURIComponent(content)}`; +} + +function setSrc(frame, type, content) { + if (type === "same-origin") { + frame.src = echoURL(content); + } else if (type === "cross-site") { + frame.src = `${get_host_info().HTTP_NOTSAMESITE_ORIGIN}${echoURL(content)}`; + } else { + frame.srcdoc = content; + } +} + +["srcdoc", "same-origin", "cross-site"].forEach(type => { + const initialType = type === "srcdoc" ? type : "same-origin"; + + [ + { + "namedObject": "
", + "namedObjectLocalName": "div" + }, + { + "namedObject": "", + "namedObjectLocalName": "object" + }, + { + "namedObject": "", + "namedObjectLocalName": "iframe" + } + ].forEach(testData => { + async_test(t => { + const frame = document.createElement("iframe"); + t.add_cleanup(() => frame.remove()); + setSrc(frame, initialType, `${testData.namedObject}`); + frame.onload = t.step_func(() => { + const f = frame.contentWindow.f, + associatedAbc = f(); + frame.onload = t.step_func_done(() => { + assert_equals(f(), associatedAbc); + assert_equals(associatedAbc.localName, testData.namedObjectLocalName); + }); + setSrc(frame, type, ""); + }); + document.body.append(frame); + }, `Window's associated Document object is used for finding named objects (<${testData.namedObjectLocalName}> via ${type} + + + + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/named-access-on-the-window-object/window-null-names.html b/testing/web-platform/tests/html/browsers/the-window-object/named-access-on-the-window-object/window-null-names.html new file mode 100644 index 0000000000..6801ef9d8a --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/named-access-on-the-window-object/window-null-names.html @@ -0,0 +1,20 @@ + + +Named access with null characters + + + + + + +
+ diff --git a/testing/web-platform/tests/html/browsers/the-window-object/navigate-to-about-blank-while-initial-load-pending.html b/testing/web-platform/tests/html/browsers/the-window-object/navigate-to-about-blank-while-initial-load-pending.html new file mode 100644 index 0000000000..3a0def8ae6 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/navigate-to-about-blank-while-initial-load-pending.html @@ -0,0 +1,26 @@ + + +Test navigating to about:blank while window.open initial load pending. + + +
+ diff --git a/testing/web-platform/tests/html/browsers/the-window-object/noopener-noreferrer-BarProp.window.js b/testing/web-platform/tests/html/browsers/the-window-object/noopener-noreferrer-BarProp.window.js new file mode 100644 index 0000000000..a75a034650 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/noopener-noreferrer-BarProp.window.js @@ -0,0 +1,23 @@ +const barProps = ["locationbar", "menubar", "personalbar", "scrollbars", "statusbar", "toolbar"]; + +test(() => { + for(const prop of barProps) { + assert_true(window[prop].visible); + } +}, "All bars visible"); + +["noopener", "noreferrer"].forEach(openerStyle => { + async_test(t => { + const channelName = "5454" + openerStyle + "34324"; + const channel = new BroadcastChannel(channelName); + window.open("support/BarProp-target.html?" + channelName, "", openerStyle); + channel.onmessage = t.step_func_done(e => { + // Send message first so if asserts throw the popup is still closed + channel.postMessage(null); + + for(const prop of barProps) { + assert_true(e.data[prop]); + } + }); + }, `window.open() with ${openerStyle} should have all bars visible`); +}); diff --git a/testing/web-platform/tests/html/browsers/the-window-object/noopener-noreferrer-sizing.window.js b/testing/web-platform/tests/html/browsers/the-window-object/noopener-noreferrer-sizing.window.js new file mode 100644 index 0000000000..cc53ba5f2f --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/noopener-noreferrer-sizing.window.js @@ -0,0 +1,17 @@ +const windowProps = ["innerWidth", "innerHeight"]; + +["noopener", "noreferrer"].forEach(openerStyle => { + async_test(t => { + const channelName = "34342" + openerStyle + "8907"; + const channel = new BroadcastChannel(channelName); + window.open("support/sizing-target.html?" + channelName, "", openerStyle); + channel.onmessage = t.step_func_done(e => { + // Send message first so if asserts throw the popup is still closed + channel.postMessage(null); + + for(const prop of windowProps) { + assert_equals(window[prop], e.data[prop]); + } + }); + }, `window.open() with ${openerStyle} should have equal viewport width and height`); +}); diff --git a/testing/web-platform/tests/html/browsers/the-window-object/open-close/callback.js b/testing/web-platform/tests/html/browsers/the-window-object/open-close/callback.js new file mode 100644 index 0000000000..ae51265a21 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/open-close/callback.js @@ -0,0 +1 @@ +opener.callback() \ No newline at end of file diff --git a/testing/web-platform/tests/html/browsers/the-window-object/open-close/close_beforeunload-1.html b/testing/web-platform/tests/html/browsers/the-window-object/open-close/close_beforeunload-1.html new file mode 100644 index 0000000000..6f44d8a83e --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/open-close/close_beforeunload-1.html @@ -0,0 +1,7 @@ + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/open-close/close_beforeunload.html b/testing/web-platform/tests/html/browsers/the-window-object/open-close/close_beforeunload.html new file mode 100644 index 0000000000..dcb8830ab6 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/open-close/close_beforeunload.html @@ -0,0 +1,16 @@ + +Running beforeunload handler in window.close() + + +
+ diff --git a/testing/web-platform/tests/html/browsers/the-window-object/open-close/close_pagehide-1.html b/testing/web-platform/tests/html/browsers/the-window-object/open-close/close_pagehide-1.html new file mode 100644 index 0000000000..5631b539a6 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/open-close/close_pagehide-1.html @@ -0,0 +1,7 @@ + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/open-close/close_pagehide.html b/testing/web-platform/tests/html/browsers/the-window-object/open-close/close_pagehide.html new file mode 100644 index 0000000000..4d726437c2 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/open-close/close_pagehide.html @@ -0,0 +1,16 @@ + +Running pagehide handler in window.close() + + +
+ diff --git a/testing/web-platform/tests/html/browsers/the-window-object/open-close/close_script_defer-1.html b/testing/web-platform/tests/html/browsers/the-window-object/open-close/close_script_defer-1.html new file mode 100644 index 0000000000..c50eddd41f --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/open-close/close_script_defer-1.html @@ -0,0 +1 @@ + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/open-close/close_script_defer.html b/testing/web-platform/tests/html/browsers/the-window-object/open-close/close_script_defer.html new file mode 100644 index 0000000000..1217882b16 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/open-close/close_script_defer.html @@ -0,0 +1,18 @@ + +Running defer script in window.close() + + +
+ diff --git a/testing/web-platform/tests/html/browsers/the-window-object/open-close/close_unload-1.html b/testing/web-platform/tests/html/browsers/the-window-object/open-close/close_unload-1.html new file mode 100644 index 0000000000..9a9e304e84 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/open-close/close_unload-1.html @@ -0,0 +1,7 @@ + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/open-close/close_unload.html b/testing/web-platform/tests/html/browsers/the-window-object/open-close/close_unload.html new file mode 100644 index 0000000000..e4d231b285 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/open-close/close_unload.html @@ -0,0 +1,16 @@ + +Running unload handler in window.close() + + +
+ diff --git a/testing/web-platform/tests/html/browsers/the-window-object/open-close/creating_browsing_context_test_01.html b/testing/web-platform/tests/html/browsers/the-window-object/open-close/creating_browsing_context_test_01.html new file mode 100644 index 0000000000..062f61949d --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/open-close/creating_browsing_context_test_01.html @@ -0,0 +1,39 @@ + + +[Browsing Context] : [APIs for creating browsing_contexts by name] + + + + + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/open-close/no_window_open_when_term_nesting_level_nonzero.window.js b/testing/web-platform/tests/html/browsers/the-window-object/open-close/no_window_open_when_term_nesting_level_nonzero.window.js new file mode 100644 index 0000000000..3dff403b9c --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/open-close/no_window_open_when_term_nesting_level_nonzero.window.js @@ -0,0 +1,113 @@ +test(function() { + var test_window = window.open('', '', 'height=1,width=1'); + var test_document = test_window.document; + + var frame = test_document.createElement('iframe'); + test_document.body.appendChild(frame); + + frame.contentWindow.onpagehide = function(evt) { + assert_equals(frame.contentWindow.open('', '', 'height=1,width=1'), null, + "expected no popup during pagehide"); + }; + frame.contentDocument.onvisibilitychange = function(evt) { + assert_equals(frame.contentWindow.open('', '', 'height=1,width=1'), null, + "expected no popup during visibilitychange"); + }; + frame.contentWindow.onbeforeunload = function(evt) { + assert_equals(frame.contentWindow.open('', '', 'height=1,width=1'), null, + "expected no popup during beforeunload"); + }; + frame.contentWindow.onunload = function(evt) { + assert_equals(frame.contentWindow.open('', '', 'height=1,width=1'), null, + "expected no popup during unload"); + }; + + frame.remove(); +}, 'no popups with frame removal'); + +async_test(function(t) { + var test_window = window.open('', '', 'height=1,width=1'); + var test_document = test_window.document; + + var frame = test_document.createElement('iframe'); + test_document.body.appendChild(frame); + + frame.contentWindow.onpagehide = t.step_func(function(evt) { + assert_equals(frame.contentWindow.open('', '', 'height=1,width=1'), null, + "expected no popup during pagehide"); + }); + frame.contentDocument.onvisibilitychange = t.step_func(function(evt) { + assert_equals(frame.contentWindow.open('', '', 'height=1,width=1'), null, + "expected no popup during visibilitychange"); + }); + frame.contentWindow.onbeforeunload = t.step_func(function(evt) { + assert_equals(frame.contentWindow.open('', '', 'height=1,width=1'), null, + "expected no popup during beforeunload"); + }); + frame.contentWindow.onunload = t.step_func(function(evt) { + assert_equals(frame.contentWindow.open('', '', 'height=1,width=1'), null, + "expected no popup during unload"); + }); + + frame.onload = t.step_func_done(); + + frame.contentWindow.location.href = "about:blank"; +}, 'no popups with frame navigation'); + +async_test(function(t) { + var test_window = window.open('', '', 'height=1,width=1'); + var test_document = test_window.document; + + var frame = test_document.createElement('iframe'); + test_document.body.appendChild(frame); + + frame.contentWindow.onpagehide = t.step_func(function(evt) { + assert_equals(test_window.open('', '', 'height=1,width=1'), null, + "expected no popup during pagehide"); + }); + frame.contentDocument.onvisibilitychange = t.step_func(function(evt) { + assert_equals(test_window.open('', '', 'height=1,width=1'), null, + "expected no popup during visibilitychange"); + }); + frame.contentWindow.onbeforeunload = t.step_func(function(evt) { + assert_equals(test_window.open('', '', 'height=1,width=1'), null, + "expected no popup during beforeunload"); + }); + frame.contentWindow.onunload = t.step_func(function(evt) { + assert_equals(test_window.open('', '', 'height=1,width=1'), null, + "expected no popup during unload"); + }); + + frame.onload = t.step_func_done(); + + frame.contentWindow.location.href = "about:blank"; +}, 'no popups from synchronously reachable window'); + +async_test(function(t) { + var test_window = window.open('', '', 'height=1,width=1'); + var test_document = test_window.document; + + var frame = test_document.createElement('iframe'); + test_document.body.appendChild(frame); + + frame.contentWindow.onpagehide = t.step_func(function(evt) { + assert_equals(window.open('', '', 'height=1,width=1'), null, + "expected no popup during pagehide"); + }); + frame.contentDocument.onvisibilitychange = t.step_func(function(evt) { + assert_equals(window.open('', '', 'height=1,width=1'), null, + "expected no popup during visibilitychange"); + }); + frame.contentWindow.onbeforeunload = t.step_func(function(evt) { + assert_equals(window.open('', '', 'height=1,width=1'), null, + "expected no popup during beforeunload"); + }); + frame.contentWindow.onunload = t.step_func(function(evt) { + assert_equals(window.open('', '', 'height=1,width=1'), null, + "expected no popup during unload"); + }); + + frame.onload = t.step_func_done(); + + frame.contentWindow.location.href = "about:blank"; +}, 'no popups from another synchronously reachable window'); diff --git a/testing/web-platform/tests/html/browsers/the-window-object/open-close/non_automated/001-1.html b/testing/web-platform/tests/html/browsers/the-window-object/open-close/non_automated/001-1.html new file mode 100644 index 0000000000..7dd48b41c2 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/open-close/non_automated/001-1.html @@ -0,0 +1,2 @@ + +

Now open a new tab and navigate to 001-2

diff --git a/testing/web-platform/tests/html/browsers/the-window-object/open-close/non_automated/001-2.html b/testing/web-platform/tests/html/browsers/the-window-object/open-close/non_automated/001-2.html new file mode 100644 index 0000000000..b1413861a3 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/open-close/non_automated/001-2.html @@ -0,0 +1,16 @@ + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/open-close/non_automated/001.html b/testing/web-platform/tests/html/browsers/the-window-object/open-close/non_automated/001.html new file mode 100644 index 0000000000..7b0f21ec04 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/open-close/non_automated/001.html @@ -0,0 +1,3 @@ + +Accessing named windows from outside the unit of related browsing contexts +Click here diff --git a/testing/web-platform/tests/html/browsers/the-window-object/open-close/non_automated/002-1.html b/testing/web-platform/tests/html/browsers/the-window-object/open-close/non_automated/002-1.html new file mode 100644 index 0000000000..0e210f351b --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/open-close/non_automated/002-1.html @@ -0,0 +1,8 @@ + +

Now open a new tab and navigate to

+ diff --git a/testing/web-platform/tests/html/browsers/the-window-object/open-close/non_automated/002-2.html b/testing/web-platform/tests/html/browsers/the-window-object/open-close/non_automated/002-2.html new file mode 100644 index 0000000000..b1413861a3 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/open-close/non_automated/002-2.html @@ -0,0 +1,16 @@ + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/open-close/non_automated/002.html b/testing/web-platform/tests/html/browsers/the-window-object/open-close/non_automated/002.html new file mode 100644 index 0000000000..b568ae8d48 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/open-close/non_automated/002.html @@ -0,0 +1,3 @@ + +Accessing different-origin named windows from outside the unit of related browsing contexts +Click here diff --git a/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-is-popup-condition.html b/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-is-popup-condition.html new file mode 100644 index 0000000000..4f52e2e8de --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-is-popup-condition.html @@ -0,0 +1,149 @@ + + +HTML: window.open `features`: condition for is popup + + + + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-negative-innerwidth-innerheight.html b/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-negative-innerwidth-innerheight.html new file mode 100644 index 0000000000..019ee9d730 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-negative-innerwidth-innerheight.html @@ -0,0 +1,75 @@ + + +HTML: window.open `features`: negative values for legacy `innerwidth`, `innerheight` + + + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-negative-screenx-screeny.html b/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-negative-screenx-screeny.html new file mode 100644 index 0000000000..6e316db482 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-negative-screenx-screeny.html @@ -0,0 +1,67 @@ + + +HTML: window.open `features`: negative values for legacy `screenx`, `screeny` + + + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-negative-top-left.html b/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-negative-top-left.html new file mode 100644 index 0000000000..316b01a401 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-negative-top-left.html @@ -0,0 +1,68 @@ + + +HTML: window.open `features`: negative values for `top`, `left` + + + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-negative-width-height.html b/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-negative-width-height.html new file mode 100644 index 0000000000..3cb155620d --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-negative-width-height.html @@ -0,0 +1,75 @@ + + +HTML: window.open `features`: negative values for `width`, `height` + + + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-non-integer-height.html b/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-non-integer-height.html new file mode 100644 index 0000000000..d8ee866c50 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-non-integer-height.html @@ -0,0 +1,91 @@ + + +HTML: window.open `features`: non-integer values for feature `height` + + + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-non-integer-innerheight.html b/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-non-integer-innerheight.html new file mode 100644 index 0000000000..f191d875d8 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-non-integer-innerheight.html @@ -0,0 +1,76 @@ + + +HTML: window.open `features`: non-integer values for legacy feature `innerheight` + + + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-non-integer-innerwidth.html b/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-non-integer-innerwidth.html new file mode 100644 index 0000000000..d1ddc5e43a --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-non-integer-innerwidth.html @@ -0,0 +1,75 @@ + + +HTML: window.open `features`: non-integer values for legacy feature `innerwidth` + + + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-non-integer-left.html b/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-non-integer-left.html new file mode 100644 index 0000000000..c771204dc4 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-non-integer-left.html @@ -0,0 +1,76 @@ + + +HTML: window.open `features`: non-integer values for feature `left` + + + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-non-integer-screenx.html b/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-non-integer-screenx.html new file mode 100644 index 0000000000..49a3783257 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-non-integer-screenx.html @@ -0,0 +1,75 @@ + + +HTML: window.open `features`: non-integer values for legacy feature `screenx` + + + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-non-integer-screeny.html b/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-non-integer-screeny.html new file mode 100644 index 0000000000..5183405445 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-non-integer-screeny.html @@ -0,0 +1,76 @@ + + +HTML: window.open `features`: non-integer values for legacy feature `screeny` + + + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-non-integer-top.html b/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-non-integer-top.html new file mode 100644 index 0000000000..a7926e748b --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-non-integer-top.html @@ -0,0 +1,73 @@ + + +HTML: window.open `features`: non-integer values for feature `top` + + + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-non-integer-width.html b/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-non-integer-width.html new file mode 100644 index 0000000000..6878063ed7 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-non-integer-width.html @@ -0,0 +1,91 @@ + + +HTML: window.open `features`: non-integer values for feature `width` + + + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-tokenization-innerheight-innerwidth.html b/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-tokenization-innerheight-innerwidth.html new file mode 100644 index 0000000000..cf3ad25514 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-tokenization-innerheight-innerwidth.html @@ -0,0 +1,55 @@ + + +HTML: window.open `features`: tokenization -- legacy size features `innerheight`, `innerwidth` + + + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-tokenization-noopener.html b/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-tokenization-noopener.html new file mode 100644 index 0000000000..c955e67789 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-tokenization-noopener.html @@ -0,0 +1,11 @@ + + +HTML: window.open `features`: tokenization -- `noopener` + + + + + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-tokenization-noreferrer.html b/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-tokenization-noreferrer.html new file mode 100644 index 0000000000..4807f634fd --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-tokenization-noreferrer.html @@ -0,0 +1,11 @@ + + +HTML: window.open `features`: tokenization -- `noreferrer` + + + + + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-tokenization-screenx-screeny.html b/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-tokenization-screenx-screeny.html new file mode 100644 index 0000000000..5a53fefc40 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-tokenization-screenx-screeny.html @@ -0,0 +1,55 @@ + + +HTML: window.open `features`: tokenization -- legacy position features `screenx`, `screeny` + + + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-tokenization-top-left.html b/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-tokenization-top-left.html new file mode 100644 index 0000000000..842cbcf820 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-tokenization-top-left.html @@ -0,0 +1,69 @@ + + +HTML: window.open `features`: tokenization -- position features `top` and `left` + + + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-tokenization-width-height.html b/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-tokenization-width-height.html new file mode 100644 index 0000000000..ff61199179 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/open-close/open-features-tokenization-width-height.html @@ -0,0 +1,71 @@ + + +HTML: window.open `features`: tokenization -- size features `width` and `height` + + + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/open-close/resources/close-self.html b/testing/web-platform/tests/html/browsers/the-window-object/open-close/resources/close-self.html new file mode 100644 index 0000000000..0c0cf9fc49 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/open-close/resources/close-self.html @@ -0,0 +1,3 @@ + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/open-close/resources/is-popup-barprop.html b/testing/web-platform/tests/html/browsers/the-window-object/open-close/resources/is-popup-barprop.html new file mode 100644 index 0000000000..5636e29878 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/open-close/resources/is-popup-barprop.html @@ -0,0 +1,15 @@ + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/open-close/resources/message-opener.html b/testing/web-platform/tests/html/browsers/the-window-object/open-close/resources/message-opener.html new file mode 100644 index 0000000000..39ad139769 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/open-close/resources/message-opener.html @@ -0,0 +1,52 @@ + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/open-close/resources/tokenization-noopener-noreferrer.js b/testing/web-platform/tests/html/browsers/the-window-object/open-close/resources/tokenization-noopener-noreferrer.js new file mode 100644 index 0000000000..a9d42e26de --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/open-close/resources/tokenization-noopener-noreferrer.js @@ -0,0 +1,152 @@ +function booleanTests(feature) { + const windowURL = 'resources/close-self.html'; + // Tests for how windows features are tokenized into 'name', 'value' + // window features separators are ASCII whitespace, '=' and ',' + + const featureUpper = feature.toUpperCase(), + featureSplitBegin = feature.slice(0, 2), + featureSplitEnd = feature.slice(2), + featureMixedCase = featureSplitBegin.toUpperCase() + featureSplitEnd; + featureMixedCase2 = featureSplitBegin + featureSplitEnd.toUpperCase(); + + test (t => { + // Tokenizing `name`: initial window features separators are ignored + // Each of these variants should tokenize to (`${feature}`, '') + [ + ` ${feature}`, + `=${feature}`, + `,,${feature}`, + `,=, ${feature}`, + `\n=${feature}=`, + `\t${feature}`, + `\r,,,=${feature}`, + `\u000C${feature}` + ].forEach(variant => { + const win = window.open(windowURL, "", variant); + assert_equals(win, null, `"${variant}" should activate feature "${feature}"`); + }); + }, `Tokenization of "${feature}" should skip window features separators before feature`); + + test (t => { + // Tokenizing `name`: lowercase conversion + // Each of these variants should tokenize as feature (`${feature}`, '') + // except where indicated + // Note also that `value` is lowercased during tokenization + [ + `${featureUpper}`, + `${featureMixedCase}`, + ` ${featureMixedCase2}`, + `=${featureUpper}`, + `${featureUpper}=1`, + `${featureUpper}=1`, + `${featureUpper}=yes`, + `${feature}=YES`, + ].forEach(variant => { + const win = window.open(windowURL, '', variant); + assert_equals(win, null, `"${variant}" should activate feature "${feature}"`); + }); + }, `Feature "${feature}" should be converted to ASCII lowercase`); + + test (t => { + // After `name` has been collected, ignore any window features separators until '=' + // except ',' OR a non-window-features-separator — break in those cases + // i.e. ignore whitespace until '=' unless a ',' is encountered first + // Each of these variants should tokenize as feature ('noopener', '') + [ + `${feature}`, + ` ${feature}\r`, + `${feature}\n =`, + `${feature},`, + `${feature} =,`, + `, ${feature} =`, + `${feature},=`, + `${feature} foo`, + `foo ${feature}=1`, + `foo=\u000Cbar\u000C${feature}` + ].forEach(variant => { + const win = window.open(windowURL, '', variant); + assert_equals(win, null, `"${variant}" should activate feature "${feature}"`); + }); + }, `After "${feature}", tokenization should skip window features separators that are not "=" or ","`); + + test (t => { + // After initial '=', tokenizing should ignore all separators except ',' + // before collecting `value` + // Each of these variants should tokenize as feature ('noopener', '') + // Except where indicated + [ + `${feature}= yes`, + `${feature}==,`, + `${feature}=\n ,`, + `${feature} = \t ,`, + `${feature}\n=\r 1,`, + `${feature}=,yes`, + `${feature}= yes=,`, + `${feature} = \u000Cyes` + ].forEach(variant => { + const win = window.open(windowURL, '', variant); + assert_equals(win, null, `"${variant}" should activate feature "${feature}"`); + }); + }, `Tokenizing "${feature}" should ignore window feature separators except "," after initial "=" and before value`); + + test (t => { + // Tokenizing `value` should collect any non-separator code points until first separator + [ + `${feature}=1`, + `${feature}=yes`, + `${feature} = yes ,`, + `${feature}=\nyes ,`, + `${feature}=yes yes`, + `${feature}=yes\ts`, + `${feature}==`, + `${feature}=1\n,`, + `==${feature}===`, + `${feature}==\u000C` + ].forEach(variant => { + const win = window.open(windowURL, '', variant); + assert_equals(win, null, `"${variant}" should set "${feature}"`); + }); + }, `Tokenizing "${feature}" should read characters until first window feature separator as \`value\``); + + test (t => { + [ + `${feature}=1`, + `${feature}=2`, + `${feature}=12345`, + `${feature}=1.5`, + `${feature}=-1`, + ].forEach(variant => { + const win = window.open(windowURL, '', variant); + assert_equals(win, null, `"${variant}" should activate feature "${feature}"`); + }); + }, 'Integer values other than 0 should activate the feature'); + + test (t => { + [ + `${feature}=0`, + `${feature}=0.5`, + `${feature}=error`, + ].forEach(variant => { + const win = window.open(windowURL, '', variant); + assert_not_equals(win, null, `"${variant}" should NOT activate feature "${feature}"`); + }); + }, `Integer value of 0 should not activate "${feature}"`); + + test (t => { + [ + `-${feature}`, + `${featureUpper}RRR`, + `${featureMixedCase}R`, + `${featureSplitBegin}_${featureSplitEnd}`, + ` ${featureSplitBegin} ${featureSplitEnd}`, + `${featureSplitBegin}\n${featureSplitEnd}`, + `${featureSplitBegin},${featureSplitEnd}`, + `\0${feature}`, + `${feature}\u0000=yes`, + `foo=\u000C${feature}` + ].forEach(variant => { + const win = window.open(windowURL, '', variant); + assert_not_equals(win, null, `"${variant}" should NOT activate feature "${feature}"`); + }); + }, `Invalid feature names should not tokenize as "${feature}"`); +} diff --git a/testing/web-platform/tests/html/browsers/the-window-object/proxy-getOwnPropertyDescriptor.html b/testing/web-platform/tests/html/browsers/the-window-object/proxy-getOwnPropertyDescriptor.html new file mode 100644 index 0000000000..4ea9504870 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/proxy-getOwnPropertyDescriptor.html @@ -0,0 +1,126 @@ + + + + + getOwnPropertyDescriptor() is correct for Proxy with host object target + + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/security-window/window-security.https.html b/testing/web-platform/tests/html/browsers/the-window-object/security-window/window-security.https.html new file mode 100644 index 0000000000..68af5bd90b --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/security-window/window-security.https.html @@ -0,0 +1,200 @@ + + +HTML Test: Window Security + + + + + + + + + + + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/self-et-al.window.js b/testing/web-platform/tests/html/browsers/the-window-object/self-et-al.window.js new file mode 100644 index 0000000000..c42522803a --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/self-et-al.window.js @@ -0,0 +1,43 @@ +function delayed_assert_done(t, w, windowProxySelfReference) { + // Let's make sure nobody is being sneaky + t.step_timeout(() => { + t.step_timeout(() => { + assert_equals(w[windowProxySelfReference], w, `${windowProxySelfReference} got cleared after some time`); + t.done(); + }, 0); + }, 0); +} + +[ + "frames", + "globalThis", + "self", + "window" +].forEach(windowProxySelfReference => { + async_test(t => { + const frame = document.body.appendChild(document.createElement("iframe")), + otherW = frame.contentWindow; + assert_equals(otherW[windowProxySelfReference], otherW, `${windowProxySelfReference} is broken`); + frame.remove(); + assert_equals(otherW[windowProxySelfReference], otherW, `${windowProxySelfReference} got cleared after browsing context removal`); + assert_true(otherW.closed); + + delayed_assert_done(t, otherW, windowProxySelfReference); + }, `iframeWindow.${windowProxySelfReference} before and after removal`); + + async_test(t => { + const otherW = window.open(); + assert_equals(otherW[windowProxySelfReference], otherW, `${windowProxySelfReference} is broken`); + otherW.onpagehide = t.step_func(() => { + assert_equals(otherW[windowProxySelfReference], otherW, `${windowProxySelfReference} got cleared after browsing context pagehide`); + t.step_timeout(() => { + assert_equals(otherW.opener, null); // Ensure browsing context is discarded + assert_equals(otherW[windowProxySelfReference], otherW, `${windowProxySelfReference} got cleared after browsing context removal`); + delayed_assert_done(t, otherW, windowProxySelfReference); + }, 0); + }); + otherW.close(); + assert_equals(otherW[windowProxySelfReference], otherW, `${windowProxySelfReference} got cleared after browsing context closure`); + assert_true(otherW.closed); + }, `popupWindow.${windowProxySelfReference} before, after closing, and after discarding`) +}); diff --git a/testing/web-platform/tests/html/browsers/the-window-object/support/BarProp-target.html b/testing/web-platform/tests/html/browsers/the-window-object/support/BarProp-target.html new file mode 100644 index 0000000000..9921e7a577 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/support/BarProp-target.html @@ -0,0 +1,17 @@ + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/support/closed.html b/testing/web-platform/tests/html/browsers/the-window-object/support/closed.html new file mode 100644 index 0000000000..3b70598e34 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/support/closed.html @@ -0,0 +1,12 @@ + + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/support/noopener-target.html b/testing/web-platform/tests/html/browsers/the-window-object/support/noopener-target.html new file mode 100644 index 0000000000..41e197a746 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/support/noopener-target.html @@ -0,0 +1,15 @@ + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/support/noreferrer-target.html b/testing/web-platform/tests/html/browsers/the-window-object/support/noreferrer-target.html new file mode 100644 index 0000000000..c2446c6fe9 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/support/noreferrer-target.html @@ -0,0 +1,13 @@ + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/support/same-origin-iframe.html b/testing/web-platform/tests/html/browsers/the-window-object/support/same-origin-iframe.html new file mode 100644 index 0000000000..763d9e466b --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/support/same-origin-iframe.html @@ -0,0 +1,8 @@ + + + + + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/support/sizing-target.html b/testing/web-platform/tests/html/browsers/the-window-object/support/sizing-target.html new file mode 100644 index 0000000000..7cd5348a85 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/support/sizing-target.html @@ -0,0 +1,17 @@ + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/support/window-open-popup-target.html b/testing/web-platform/tests/html/browsers/the-window-object/support/window-open-popup-target.html new file mode 100644 index 0000000000..a0588de829 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/support/window-open-popup-target.html @@ -0,0 +1,24 @@ + + \ No newline at end of file diff --git a/testing/web-platform/tests/html/browsers/the-window-object/support/windowFeature-values-target.html b/testing/web-platform/tests/html/browsers/the-window-object/support/windowFeature-values-target.html new file mode 100644 index 0000000000..3a78ddf660 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/support/windowFeature-values-target.html @@ -0,0 +1,24 @@ + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/window-aliases.html b/testing/web-platform/tests/html/browsers/the-window-object/window-aliases.html new file mode 100644 index 0000000000..135be02a30 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/window-aliases.html @@ -0,0 +1,28 @@ + + +Aliases of the window object + + + + + + +
+ diff --git a/testing/web-platform/tests/html/browsers/the-window-object/window-indexed-access-vs-named-access.html b/testing/web-platform/tests/html/browsers/the-window-object/window-indexed-access-vs-named-access.html new file mode 100644 index 0000000000..23b9124ef7 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/window-indexed-access-vs-named-access.html @@ -0,0 +1,58 @@ + + +Interactions between indexed and named access on the Window object + + + + + +
+
+ + + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/window-indexed-properties-delete-no-cache.html b/testing/web-platform/tests/html/browsers/the-window-object/window-indexed-properties-delete-no-cache.html new file mode 100644 index 0000000000..22262943aa --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/window-indexed-properties-delete-no-cache.html @@ -0,0 +1,31 @@ + + +Deletion of WindowProxy's indexed properties is not cached + + + +
+ diff --git a/testing/web-platform/tests/html/browsers/the-window-object/window-indexed-properties-strict.html b/testing/web-platform/tests/html/browsers/the-window-object/window-indexed-properties-strict.html new file mode 100644 index 0000000000..2ee10a7a64 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/window-indexed-properties-strict.html @@ -0,0 +1,75 @@ + + +Indexed properties of the window object (strict mode) + + + + + + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/window-indexed-properties.html b/testing/web-platform/tests/html/browsers/the-window-object/window-indexed-properties.html new file mode 100644 index 0000000000..57f18c5944 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/window-indexed-properties.html @@ -0,0 +1,71 @@ + + +Indexed properties of the window object (non-strict mode) + + + + + + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/window-open-defaults.window.js b/testing/web-platform/tests/html/browsers/the-window-object/window-open-defaults.window.js new file mode 100644 index 0000000000..1b2d68a462 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/window-open-defaults.window.js @@ -0,0 +1,12 @@ +async_test(t => { + const frame = document.createElement("iframe"); + t.add_cleanup(() => frame.remove()); + frame.name = "foo"; + frame.src = "/common/blank.html"; + frame.onload = t.step_func(() => { + frame.onload = t.unreached_func(); + t.step_timeout(() => t.done(), 500); + assert_equals(window[0], window.open(undefined, "foo")); + }); + document.body.append(frame); +}, "window.open()'s url parameter default"); diff --git a/testing/web-platform/tests/html/browsers/the-window-object/window-open-invalid-url.html b/testing/web-platform/tests/html/browsers/the-window-object/window-open-invalid-url.html new file mode 100644 index 0000000000..cabc143b9d --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/window-open-invalid-url.html @@ -0,0 +1,10 @@ + + +window.open() with an invalid URL + + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/window-open-noopener.html b/testing/web-platform/tests/html/browsers/the-window-object/window-open-noopener.html new file mode 100644 index 0000000000..8d3a95df63 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/window-open-noopener.html @@ -0,0 +1,137 @@ + + +window.open() with "noopener" tests + + + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/window-open-noreferrer.html b/testing/web-platform/tests/html/browsers/the-window-object/window-open-noreferrer.html new file mode 100644 index 0000000000..92b72cdb5f --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/window-open-noreferrer.html @@ -0,0 +1,20 @@ + + +window.open() with "noreferrer" tests + + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/window-open-popup-behavior.html b/testing/web-platform/tests/html/browsers/the-window-object/window-open-popup-behavior.html new file mode 100644 index 0000000000..258698d94d --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/window-open-popup-behavior.html @@ -0,0 +1,51 @@ + + + +Window.open popup behavior + + + + + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/window-open-windowfeatures-values.html b/testing/web-platform/tests/html/browsers/the-window-object/window-open-windowfeatures-values.html new file mode 100644 index 0000000000..32551dd8d7 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/window-open-windowfeatures-values.html @@ -0,0 +1,72 @@ + + + +window.open() windowFeature value parsing + + + + + diff --git a/testing/web-platform/tests/html/browsers/the-window-object/window-opener-unconfigurable.window.js b/testing/web-platform/tests/html/browsers/the-window-object/window-opener-unconfigurable.window.js new file mode 100644 index 0000000000..2b9bda6792 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/window-opener-unconfigurable.window.js @@ -0,0 +1,17 @@ +test(t => { + let desc = Object.getOwnPropertyDescriptor(self, "opener"); + assert_true(!!desc.get, "Initially {get: function}"); + assert_true(!!desc.set, "Initially {set: function}"); + assert_true(desc.configurable, "Initially {configurable: true}"); + assert_true(desc.enumerable, "Initially {enumerable: true}"); + + Object.defineProperty(self, "opener", {configurable: false}); + + desc = Object.getOwnPropertyDescriptor(self, "opener"); + assert_true(!!desc.get, "Still has {get: function}"); + assert_true(!!desc.set, "Still has {set: function}"); + assert_false(desc.configurable, "Changed to {configurable: false}"); + assert_true(desc.enumerable, "Still has {enumerable: true}"); + + assert_throws_js(TypeError, () => self.opener = "something", "Throws a TypeError due to {configurable: false}"); +}, "Corner case: self.opener is set while it's not configurable"); diff --git a/testing/web-platform/tests/html/browsers/the-window-object/window-properties.https.html b/testing/web-platform/tests/html/browsers/the-window-object/window-properties.https.html new file mode 100644 index 0000000000..2fb408cdc9 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/window-properties.https.html @@ -0,0 +1,359 @@ + + +Properties of the window object + + + + + + + + + + + + + + + + + + +
+ diff --git a/testing/web-platform/tests/html/browsers/the-window-object/window-prototype-chain.html b/testing/web-platform/tests/html/browsers/the-window-object/window-prototype-chain.html new file mode 100644 index 0000000000..14dbca35e8 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/window-prototype-chain.html @@ -0,0 +1,32 @@ + + +Prototype chain of the window object + + + + + + + +
+ diff --git a/testing/web-platform/tests/html/browsers/the-window-object/window-reuse-in-nested-browsing-contexts.tentative.html b/testing/web-platform/tests/html/browsers/the-window-object/window-reuse-in-nested-browsing-contexts.tentative.html new file mode 100644 index 0000000000..03c7a68dfd --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-window-object/window-reuse-in-nested-browsing-contexts.tentative.html @@ -0,0 +1,158 @@ + + + + + +
+ diff --git a/testing/web-platform/tests/html/browsers/the-windowproxy-exotic-object/document-tree-child-browsing-context-name-property-set.sub.html b/testing/web-platform/tests/html/browsers/the-windowproxy-exotic-object/document-tree-child-browsing-context-name-property-set.sub.html new file mode 100644 index 0000000000..171aa01999 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-windowproxy-exotic-object/document-tree-child-browsing-context-name-property-set.sub.html @@ -0,0 +1,26 @@ + + +document-tree child browsing context name property set + + + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/the-windowproxy-exotic-object/windowproxy-define-own-property-unforgeable-same-origin.html b/testing/web-platform/tests/html/browsers/the-windowproxy-exotic-object/windowproxy-define-own-property-unforgeable-same-origin.html new file mode 100644 index 0000000000..ac4eb458c3 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-windowproxy-exotic-object/windowproxy-define-own-property-unforgeable-same-origin.html @@ -0,0 +1,47 @@ + + +[[DefineOwnProperty]] on a WindowProxy forwards to OrdinaryDefineOwnProperty for same-origin objects + + + + + + diff --git a/testing/web-platform/tests/html/browsers/the-windowproxy-exotic-object/windowproxy-prevent-extensions.html b/testing/web-platform/tests/html/browsers/the-windowproxy-exotic-object/windowproxy-prevent-extensions.html new file mode 100644 index 0000000000..97a156290a --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-windowproxy-exotic-object/windowproxy-prevent-extensions.html @@ -0,0 +1,21 @@ + + +[[PreventExtensions]] on a WindowProxy object should return false + + + + + + diff --git a/testing/web-platform/tests/html/browsers/the-windowproxy-exotic-object/windowproxy-prototype-setting-cross-origin-domain.sub.html b/testing/web-platform/tests/html/browsers/the-windowproxy-exotic-object/windowproxy-prototype-setting-cross-origin-domain.sub.html new file mode 100644 index 0000000000..a5ae78cc87 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-windowproxy-exotic-object/windowproxy-prototype-setting-cross-origin-domain.sub.html @@ -0,0 +1,29 @@ + + +[[SetPrototypeOf]] on a WindowProxy object should not allow changing its value: cross-origin via document.domain + + + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/the-windowproxy-exotic-object/windowproxy-prototype-setting-cross-origin.sub.html b/testing/web-platform/tests/html/browsers/the-windowproxy-exotic-object/windowproxy-prototype-setting-cross-origin.sub.html new file mode 100644 index 0000000000..a5c1a2f102 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-windowproxy-exotic-object/windowproxy-prototype-setting-cross-origin.sub.html @@ -0,0 +1,28 @@ + + +[[SetPrototypeOf]] on a WindowProxy object should not allow changing its value: cross-origin + + + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/the-windowproxy-exotic-object/windowproxy-prototype-setting-goes-cross-origin-domain.sub.html b/testing/web-platform/tests/html/browsers/the-windowproxy-exotic-object/windowproxy-prototype-setting-goes-cross-origin-domain.sub.html new file mode 100644 index 0000000000..c2a6def6c2 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-windowproxy-exotic-object/windowproxy-prototype-setting-goes-cross-origin-domain.sub.html @@ -0,0 +1,35 @@ + + +[[SetPrototypeOf]] on a WindowProxy object should not allow changing its value: cross-origin via document.domain after initially getting the object + + + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/the-windowproxy-exotic-object/windowproxy-prototype-setting-same-origin-domain.sub.html b/testing/web-platform/tests/html/browsers/the-windowproxy-exotic-object/windowproxy-prototype-setting-same-origin-domain.sub.html new file mode 100644 index 0000000000..fb18822ac5 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-windowproxy-exotic-object/windowproxy-prototype-setting-same-origin-domain.sub.html @@ -0,0 +1,30 @@ + + +[[SetPrototypeOf]] on a WindowProxy object should not allow changing its value: cross-origin, but same-origin-domain + + + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/the-windowproxy-exotic-object/windowproxy-prototype-setting-same-origin.html b/testing/web-platform/tests/html/browsers/the-windowproxy-exotic-object/windowproxy-prototype-setting-same-origin.html new file mode 100644 index 0000000000..5779199ca3 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/the-windowproxy-exotic-object/windowproxy-prototype-setting-same-origin.html @@ -0,0 +1,21 @@ + + +[[SetPrototypeOf]] on a WindowProxy object should not allow changing its value: same-origin + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/windows/auxiliary-browsing-contexts/opener-closed.html b/testing/web-platform/tests/html/browsers/windows/auxiliary-browsing-contexts/opener-closed.html new file mode 100644 index 0000000000..106c3f97cb --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/auxiliary-browsing-contexts/opener-closed.html @@ -0,0 +1,31 @@ + + + + + Auxiliary Browsing Contexts: window.opener when Opener Removed/Closed + + + + + +
+ + + diff --git a/testing/web-platform/tests/html/browsers/windows/auxiliary-browsing-contexts/opener-multiple.html b/testing/web-platform/tests/html/browsers/windows/auxiliary-browsing-contexts/opener-multiple.html new file mode 100644 index 0000000000..e71d4dc868 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/auxiliary-browsing-contexts/opener-multiple.html @@ -0,0 +1,35 @@ + + + + Auxiliary Browsing Contexts: window.opener, multiple + + + + + +
+ + + diff --git a/testing/web-platform/tests/html/browsers/windows/auxiliary-browsing-contexts/opener-noopener.html b/testing/web-platform/tests/html/browsers/windows/auxiliary-browsing-contexts/opener-noopener.html new file mode 100644 index 0000000000..086a96442d --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/auxiliary-browsing-contexts/opener-noopener.html @@ -0,0 +1,25 @@ + + + + Auxiliary Browsing Contexts: window.opener noopener + + + + + +
+ + + diff --git a/testing/web-platform/tests/html/browsers/windows/auxiliary-browsing-contexts/opener-noreferrer.html b/testing/web-platform/tests/html/browsers/windows/auxiliary-browsing-contexts/opener-noreferrer.html new file mode 100644 index 0000000000..b8226bd2b9 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/auxiliary-browsing-contexts/opener-noreferrer.html @@ -0,0 +1,29 @@ + + + + Auxiliary Browsing Contexts: window.opener noreferrer + + + + + +
+ + + diff --git a/testing/web-platform/tests/html/browsers/windows/auxiliary-browsing-contexts/opener-setter.html b/testing/web-platform/tests/html/browsers/windows/auxiliary-browsing-contexts/opener-setter.html new file mode 100644 index 0000000000..ac6e47b846 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/auxiliary-browsing-contexts/opener-setter.html @@ -0,0 +1,33 @@ + + + + Auxiliary Browsing Contexts: window.opener setter + + + + + + +
+ + + diff --git a/testing/web-platform/tests/html/browsers/windows/auxiliary-browsing-contexts/opener-setter.window.js b/testing/web-platform/tests/html/browsers/windows/auxiliary-browsing-contexts/opener-setter.window.js new file mode 100644 index 0000000000..6d540ce97c --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/auxiliary-browsing-contexts/opener-setter.window.js @@ -0,0 +1,38 @@ +[ + undefined, + 42, + function() { return "hi" }, + "hi", + {}, + [], + Symbol() +].forEach(val => { + test(t => { + const frame = document.body.appendChild(document.createElement("iframe")), + win = frame.contentWindow; + t.add_cleanup(() => frame.remove()); + + assert_own_property(win, "opener"); + assert_equals(win.opener, null); + const beforeDesc = Object.getOwnPropertyDescriptor(win, "opener"), + openerGet = beforeDesc.get, + openerSet = beforeDesc.set; + assert_own_property(beforeDesc, "get"); + assert_own_property(beforeDesc, "set"); + assert_true(beforeDesc.enumerable); + assert_true(beforeDesc.configurable); + + win.opener = val; + assert_equals(win.opener, val); + assert_equals(openerGet(), null); + + const desc = Object.getOwnPropertyDescriptor(win, "opener"); + assert_equals(desc.value, val); + assert_true(desc.writable); + assert_true(desc.enumerable); + assert_true(desc.configurable); + + openerSet("x"); + assert_equals(win.opener, "x"); + }, "Setting window.opener to " + String(val)); // String() needed for symbols +}); diff --git a/testing/web-platform/tests/html/browsers/windows/auxiliary-browsing-contexts/opener.html b/testing/web-platform/tests/html/browsers/windows/auxiliary-browsing-contexts/opener.html new file mode 100644 index 0000000000..c43d3bd3bf --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/auxiliary-browsing-contexts/opener.html @@ -0,0 +1,55 @@ + + + + Auxiliary Browsing Contexts: window.opener + + + + + +
+ + + diff --git a/testing/web-platform/tests/html/browsers/windows/auxiliary-browsing-contexts/resources/close-opener.html b/testing/web-platform/tests/html/browsers/windows/auxiliary-browsing-contexts/resources/close-opener.html new file mode 100644 index 0000000000..f41773ed2c --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/auxiliary-browsing-contexts/resources/close-opener.html @@ -0,0 +1,30 @@ + + + + +

This window should close its opener.

+ + + + diff --git a/testing/web-platform/tests/html/browsers/windows/auxiliary-browsing-contexts/resources/message-window-opener.html b/testing/web-platform/tests/html/browsers/windows/auxiliary-browsing-contexts/resources/message-window-opener.html new file mode 100644 index 0000000000..8105650b61 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/auxiliary-browsing-contexts/resources/message-window-opener.html @@ -0,0 +1,14 @@ + + diff --git a/testing/web-platform/tests/html/browsers/windows/auxiliary-browsing-contexts/resources/multiple-opener.html b/testing/web-platform/tests/html/browsers/windows/auxiliary-browsing-contexts/resources/multiple-opener.html new file mode 100644 index 0000000000..2e63b9f4c6 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/auxiliary-browsing-contexts/resources/multiple-opener.html @@ -0,0 +1,32 @@ + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/windows/auxiliary-browsing-contexts/resources/no-opener.html b/testing/web-platform/tests/html/browsers/windows/auxiliary-browsing-contexts/resources/no-opener.html new file mode 100644 index 0000000000..afd72f948d --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/auxiliary-browsing-contexts/resources/no-opener.html @@ -0,0 +1,16 @@ + + + +

This window should have no opener.

+ + + + + diff --git a/testing/web-platform/tests/html/browsers/windows/auxiliary-browsing-contexts/resources/open-closer.html b/testing/web-platform/tests/html/browsers/windows/auxiliary-browsing-contexts/resources/open-closer.html new file mode 100644 index 0000000000..7575c7c95f --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/auxiliary-browsing-contexts/resources/open-closer.html @@ -0,0 +1,17 @@ + + + + +Open auxiliary context that will close this window (its opener) + + + + diff --git a/testing/web-platform/tests/html/browsers/windows/auxiliary-browsing-contexts/resources/opener-setter.html b/testing/web-platform/tests/html/browsers/windows/auxiliary-browsing-contexts/resources/opener-setter.html new file mode 100644 index 0000000000..4112dae0ce --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/auxiliary-browsing-contexts/resources/opener-setter.html @@ -0,0 +1,23 @@ + + + +

This window should set the window.opener attribute

+ + + + + diff --git a/testing/web-platform/tests/html/browsers/windows/browsing-context-names/choose-_blank-001.html b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/choose-_blank-001.html new file mode 100644 index 0000000000..a1416f2eb8 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/choose-_blank-001.html @@ -0,0 +1,35 @@ + + +HTML Test: Browsing context - `_blank` name keyword + + +
+ diff --git a/testing/web-platform/tests/html/browsers/windows/browsing-context-names/choose-_blank-002.html b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/choose-_blank-002.html new file mode 100644 index 0000000000..aba9d52ba0 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/choose-_blank-002.html @@ -0,0 +1,21 @@ + +Link with target=_blank, rel=noreferrer + + + +
+Link + diff --git a/testing/web-platform/tests/html/browsers/windows/browsing-context-names/choose-_blank-003.html b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/choose-_blank-003.html new file mode 100644 index 0000000000..5571344c85 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/choose-_blank-003.html @@ -0,0 +1,20 @@ + +Link with target=_blank, no rel + + + +
+Link + diff --git a/testing/web-platform/tests/html/browsers/windows/browsing-context-names/choose-_parent-001.html b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/choose-_parent-001.html new file mode 100644 index 0000000000..35cbc101c7 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/choose-_parent-001.html @@ -0,0 +1,15 @@ + + +HTML Test: Choose browsing context - '_parent' + + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/windows/browsing-context-names/choose-_parent-002.html b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/choose-_parent-002.html new file mode 100644 index 0000000000..7b7d561030 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/choose-_parent-002.html @@ -0,0 +1,17 @@ + + +HTML Test: Choose browsing context - '_parent' (nested contexts) + + +
+ diff --git a/testing/web-platform/tests/html/browsers/windows/browsing-context-names/choose-_parent-003.html b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/choose-_parent-003.html new file mode 100644 index 0000000000..20dc9b0d2a --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/choose-_parent-003.html @@ -0,0 +1,17 @@ + + +HTML Test: Choose browsing context - '_parent' (via window.open) + + +
+ diff --git a/testing/web-platform/tests/html/browsers/windows/browsing-context-names/choose-_parent-004.html b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/choose-_parent-004.html new file mode 100644 index 0000000000..c79378018a --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/choose-_parent-004.html @@ -0,0 +1,40 @@ + + +HTML Test: Choose browsing context - '_parent' (case-sensitivity) + + + + +
+ + + diff --git a/testing/web-platform/tests/html/browsers/windows/browsing-context-names/choose-_self-001.html b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/choose-_self-001.html new file mode 100644 index 0000000000..ed7666846d --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/choose-_self-001.html @@ -0,0 +1,15 @@ + + +HTML Test: Choose browsing context - the given name is '_self' + + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/windows/browsing-context-names/choose-_self-002.html b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/choose-_self-002.html new file mode 100644 index 0000000000..2e798f5493 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/choose-_self-002.html @@ -0,0 +1,46 @@ + + +HTML Test: Choose browsing context - '_self' (case-sensitivity) + + + + +
+ + + + diff --git a/testing/web-platform/tests/html/browsers/windows/browsing-context-names/choose-_top-001.html b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/choose-_top-001.html new file mode 100644 index 0000000000..de4c6ad115 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/choose-_top-001.html @@ -0,0 +1,34 @@ + +HTML Test: Browsing context name - _top (current is top) + + + +
+ diff --git a/testing/web-platform/tests/html/browsers/windows/browsing-context-names/choose-_top-002.html b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/choose-_top-002.html new file mode 100644 index 0000000000..f29da80c6e --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/choose-_top-002.html @@ -0,0 +1,33 @@ + +HTML Test: Browsing context name - _top + + + +
+ diff --git a/testing/web-platform/tests/html/browsers/windows/browsing-context-names/choose-_top-003.html b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/choose-_top-003.html new file mode 100644 index 0000000000..e068f8cc1f --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/choose-_top-003.html @@ -0,0 +1,39 @@ + + +HTML Test: Choose browsing context - '_top' (case-sensitivity) + + + + +
+ + + diff --git a/testing/web-platform/tests/html/browsers/windows/browsing-context-names/choose-default-001.html b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/choose-default-001.html new file mode 100644 index 0000000000..c21159e0a6 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/choose-default-001.html @@ -0,0 +1,23 @@ + + +HTML Test: Browsing context - Default name + + + +
+ + + + diff --git a/testing/web-platform/tests/html/browsers/windows/browsing-context-names/choose-default-002.html b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/choose-default-002.html new file mode 100644 index 0000000000..748ee68973 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/choose-default-002.html @@ -0,0 +1,16 @@ + + +HTML Test: Browsing context names - empty string + + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/windows/browsing-context-names/choose-existing-001.html b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/choose-existing-001.html new file mode 100644 index 0000000000..fdf74b8a79 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/choose-existing-001.html @@ -0,0 +1,17 @@ + + +HTML Test: Choose browsing context - the given name is same as an existing browsing context's name + + + +
+ + + diff --git a/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/choose-_parent-001-iframe-1.html b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/choose-_parent-001-iframe-1.html new file mode 100644 index 0000000000..04dd74f1a5 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/choose-_parent-001-iframe-1.html @@ -0,0 +1,5 @@ + + +HTML Test: browsing context name - parent + + diff --git a/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/choose-_parent-002-iframe.html b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/choose-_parent-002-iframe.html new file mode 100644 index 0000000000..52da8986b0 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/choose-_parent-002-iframe.html @@ -0,0 +1,4 @@ + + +HTML Test: browsing context name - parent: nested context + diff --git a/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/choose-_parent-002-window.html b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/choose-_parent-002-window.html new file mode 100644 index 0000000000..558193742f --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/choose-_parent-002-window.html @@ -0,0 +1,12 @@ + + +HTML Test: browsing context name - parent: top-level context + + diff --git a/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/choose-_parent-003-iframe.html b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/choose-_parent-003-iframe.html new file mode 100644 index 0000000000..1412dc2e79 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/choose-_parent-003-iframe.html @@ -0,0 +1,6 @@ + + +HTML Test: browsing context name - parent + diff --git a/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/choose-_parent-003-window.html b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/choose-_parent-003-window.html new file mode 100644 index 0000000000..bd1802aed6 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/choose-_parent-003-window.html @@ -0,0 +1,4 @@ + + +HTML Test: browsing context name - parent: top-level context (gets replaced) + diff --git a/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/choose-_parent-004-iframe-1.html b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/choose-_parent-004-iframe-1.html new file mode 100644 index 0000000000..7a8cbecb27 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/choose-_parent-004-iframe-1.html @@ -0,0 +1,14 @@ + + +HTML Test: browsing context name - parent + + + + diff --git a/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/choose-_parent-004-iframe-2.html b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/choose-_parent-004-iframe-2.html new file mode 100644 index 0000000000..33ead5a538 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/choose-_parent-004-iframe-2.html @@ -0,0 +1,9 @@ + + +HTML Test: browsing context name - parent (case-insensitive) + + diff --git a/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/choose-_self-001-iframe.html b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/choose-_self-001-iframe.html new file mode 100644 index 0000000000..0ad79d6e16 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/choose-_self-001-iframe.html @@ -0,0 +1,9 @@ + + +HTML Test: browsing context name - self + + diff --git a/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/choose-_self-002-iframe.html b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/choose-_self-002-iframe.html new file mode 100644 index 0000000000..9d88305e09 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/choose-_self-002-iframe.html @@ -0,0 +1,11 @@ + + +HTML Test: browsing context name - self (case-insensitive) + + + diff --git a/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/choose-_top-002-window.html b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/choose-_top-002-window.html new file mode 100644 index 0000000000..d71384b72f --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/choose-_top-002-window.html @@ -0,0 +1,16 @@ + + + +HTML Test: browsing context name - _top + + + diff --git a/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/choose-_top-003-iframe-1.html b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/choose-_top-003-iframe-1.html new file mode 100644 index 0000000000..aecc2fd88a --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/choose-_top-003-iframe-1.html @@ -0,0 +1,15 @@ + + +HTML Test: browsing context name - top (case-insensitive) + + + + diff --git a/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/choose-_top-003-iframe-2.html b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/choose-_top-003-iframe-2.html new file mode 100644 index 0000000000..a1a7e1dda7 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/choose-_top-003-iframe-2.html @@ -0,0 +1,10 @@ + + +HTML Test: browsing context name - top (case-insensitive) + + diff --git a/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/choose-default-002-iframe.html b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/choose-default-002-iframe.html new file mode 100644 index 0000000000..567e4ea310 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/choose-default-002-iframe.html @@ -0,0 +1,17 @@ + + + +HTML Test: browsing context name - Empty string + + + + + diff --git a/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/choose-existing-001-iframe.html b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/choose-existing-001-iframe.html new file mode 100644 index 0000000000..cb0b554854 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/choose-existing-001-iframe.html @@ -0,0 +1,7 @@ + + +This is a test page + + diff --git a/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/open-in-_parent.html b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/open-in-_parent.html new file mode 100644 index 0000000000..81d0735c60 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/open-in-_parent.html @@ -0,0 +1,9 @@ + + +HTML Test: browsing context name - parent + + diff --git a/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/open-in-_top.html b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/open-in-_top.html new file mode 100644 index 0000000000..929d52d15e --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/open-in-_top.html @@ -0,0 +1,9 @@ + + + +HTML Test: browsing context name - _top + diff --git a/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/post-to-opener.html b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/post-to-opener.html new file mode 100644 index 0000000000..3e9b7aaccb --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/post-to-opener.html @@ -0,0 +1,12 @@ + + +HTML Test: post window's name to top browsing context + + diff --git a/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/post-to-top.html b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/post-to-top.html new file mode 100644 index 0000000000..aebb57b019 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/post-to-top.html @@ -0,0 +1,10 @@ + + +HTML Test: post window's name to top browsing context + + diff --git a/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/report-has-opener.html b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/report-has-opener.html new file mode 100644 index 0000000000..37d8cedc6d --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/report-has-opener.html @@ -0,0 +1,8 @@ + + + diff --git a/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/report-is-top.html b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/report-is-top.html new file mode 100644 index 0000000000..8711235982 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/browsing-context-names/resources/report-is-top.html @@ -0,0 +1,10 @@ + + + + diff --git a/testing/web-platform/tests/html/browsers/windows/browsing-context-window.html b/testing/web-platform/tests/html/browsers/windows/browsing-context-window.html new file mode 100644 index 0000000000..f4f3c715ac --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/browsing-context-window.html @@ -0,0 +1,37 @@ + + + + HTML Test: Newly-Created browsing context Window and `this` + + + + + + +
+ + + diff --git a/testing/web-platform/tests/html/browsers/windows/browsing-context.html b/testing/web-platform/tests/html/browsers/windows/browsing-context.html new file mode 100644 index 0000000000..59367b0428 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/browsing-context.html @@ -0,0 +1,48 @@ + + + + HTML Test: Browsing context is first created + + + + + +
+ + + diff --git a/testing/web-platform/tests/html/browsers/windows/clear-window-name.https.html b/testing/web-platform/tests/html/browsers/windows/clear-window-name.https.html new file mode 100644 index 0000000000..698de8a1ca --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/clear-window-name.https.html @@ -0,0 +1,122 @@ + + + + Clear window.name when cross-origin + + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/windows/dangling-markup-window-name.html b/testing/web-platform/tests/html/browsers/windows/dangling-markup-window-name.html new file mode 100644 index 0000000000..1bc8bb9f7f --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/dangling-markup-window-name.html @@ -0,0 +1,97 @@ + + + + Dangling Markup in target + + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/windows/document-domain-nested-navigate.window.js b/testing/web-platform/tests/html/browsers/windows/document-domain-nested-navigate.window.js new file mode 100644 index 0000000000..f51eed5ca9 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/document-domain-nested-navigate.window.js @@ -0,0 +1,16 @@ +async_test(t => { + // Setting document.domain makes this document cross-origin with that of the frame. However, + // about:blank will end up reusing the origin of this document, at which point the frame's + // document is no longer cross-origin. + const frame = document.body.appendChild(document.createElement('iframe')); + document.domain = document.domain; + frame.src = "/common/blank.html"; + frame.onload = t.step_func(() => { + assert_throws_dom("SecurityError", () => window[0].document); + frame.src = "about:blank"; + frame.onload = t.step_func_done(() => { + // Ensure we can access the child browsing context after navigation to non-initial about:blank + assert_equals(window[0].document, frame.contentDocument); + }); + }); +}, "Navigated frame to about:blank and document.domain"); diff --git a/testing/web-platform/tests/html/browsers/windows/document-domain-nested-set.window.js b/testing/web-platform/tests/html/browsers/windows/document-domain-nested-set.window.js new file mode 100644 index 0000000000..13c0d50ba0 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/document-domain-nested-set.window.js @@ -0,0 +1,10 @@ +test(() => { + // As the initial:about frame document reuses the origin of this document, setting document.domain + // from the frame, resulting in a origin mutation, has no effect on these documents being able to + // reach each other, as they share the same "physical" origin. + document.body.appendChild(document.createElement('iframe')); + const script = document.createElement("script"); + script.text = "document.domain = document.domain"; + window[0].document.body.appendChild(script); + assert_equals(window[0].document.body.localName, "body"); +}, "Initial about:blank frame and document.domain in the frame"); diff --git a/testing/web-platform/tests/html/browsers/windows/document-domain-nested.window.js b/testing/web-platform/tests/html/browsers/windows/document-domain-nested.window.js new file mode 100644 index 0000000000..2e39d05f03 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/document-domain-nested.window.js @@ -0,0 +1,9 @@ +test(() => { + // As the initial:about frame document reuses the origin of this document, setting document.domain + // from this document, resulting in a origin mutation, has no effect on these documents being able + // to reach each other, as they share the same "physical" origin. + document.body.appendChild(document.createElement('iframe')); + document.domain = document.domain; + // Ensure we can still access the child browsing context + assert_equals(window[0].document.body.localName, "body"); +}, "Initial about:blank frame and document.domain"); diff --git a/testing/web-platform/tests/html/browsers/windows/document-domain-removed-iframe.html b/testing/web-platform/tests/html/browsers/windows/document-domain-removed-iframe.html new file mode 100644 index 0000000000..7403ebfaad --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/document-domain-removed-iframe.html @@ -0,0 +1,72 @@ + + +document.domain and removed iframe interaction + + + + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/windows/embedded-opener-a-form.html b/testing/web-platform/tests/html/browsers/windows/embedded-opener-a-form.html new file mode 100644 index 0000000000..e1ec760b92 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/embedded-opener-a-form.html @@ -0,0 +1,30 @@ + +opener and embedded documents; using a and form + + +
+ +<a> +
+ diff --git a/testing/web-platform/tests/html/browsers/windows/embedded-opener-remove-frame.html b/testing/web-platform/tests/html/browsers/windows/embedded-opener-remove-frame.html new file mode 100644 index 0000000000..a66f52e5f6 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/embedded-opener-remove-frame.html @@ -0,0 +1,66 @@ + +opener and discarded browsing contexts + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/windows/embedded-opener.html b/testing/web-platform/tests/html/browsers/windows/embedded-opener.html new file mode 100644 index 0000000000..8e02664342 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/embedded-opener.html @@ -0,0 +1,32 @@ + +opener and embedded documents; using window.open() + + +
+ + diff --git a/testing/web-platform/tests/html/browsers/windows/iframe-cross-origin-print.sub.html b/testing/web-platform/tests/html/browsers/windows/iframe-cross-origin-print.sub.html new file mode 100644 index 0000000000..d07db13776 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/iframe-cross-origin-print.sub.html @@ -0,0 +1,6 @@ + + + + diff --git a/testing/web-platform/tests/html/browsers/windows/iframe-cross-origin-scaled-print.sub.html b/testing/web-platform/tests/html/browsers/windows/iframe-cross-origin-scaled-print.sub.html new file mode 100644 index 0000000000..2442563082 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/iframe-cross-origin-scaled-print.sub.html @@ -0,0 +1,17 @@ + + + +
+ +
diff --git a/testing/web-platform/tests/html/browsers/windows/iframe-nested-print-ref.html b/testing/web-platform/tests/html/browsers/windows/iframe-nested-print-ref.html new file mode 100644 index 0000000000..c36c459881 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/iframe-nested-print-ref.html @@ -0,0 +1,9 @@ + + +

PASS diff --git a/testing/web-platform/tests/html/browsers/windows/iframe-nested-print.html b/testing/web-platform/tests/html/browsers/windows/iframe-nested-print.html new file mode 100644 index 0000000000..844f6ba373 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/iframe-nested-print.html @@ -0,0 +1,6 @@ + + + + diff --git a/testing/web-platform/tests/html/browsers/windows/iframe-nested-scaled-print-ref.html b/testing/web-platform/tests/html/browsers/windows/iframe-nested-scaled-print-ref.html new file mode 100644 index 0000000000..fceaf1e52c --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/iframe-nested-scaled-print-ref.html @@ -0,0 +1,15 @@ + + +

+ +
diff --git a/testing/web-platform/tests/html/browsers/windows/nested-browsing-contexts/frameElement-siblings.sub.html b/testing/web-platform/tests/html/browsers/windows/nested-browsing-contexts/frameElement-siblings.sub.html new file mode 100644 index 0000000000..0c814d26d9 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/nested-browsing-contexts/frameElement-siblings.sub.html @@ -0,0 +1,42 @@ + + +window.frameElement access to a same-origin-domain sibling + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/windows/nested-browsing-contexts/frameElement.sub.html b/testing/web-platform/tests/html/browsers/windows/nested-browsing-contexts/frameElement.sub.html new file mode 100644 index 0000000000..7ea1182081 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/nested-browsing-contexts/frameElement.sub.html @@ -0,0 +1,66 @@ + + + + + HTML Test: window.frameElement + + + + + + + + + + + + + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/windows/nested-browsing-contexts/name-attribute.window.js b/testing/web-platform/tests/html/browsers/windows/nested-browsing-contexts/name-attribute.window.js new file mode 100644 index 0000000000..69908af71b --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/nested-browsing-contexts/name-attribute.window.js @@ -0,0 +1,58 @@ +// META: script=/common/get-host-info.sub.js + +[ + "frame", // This works without , so great + "iframe", + "object", + "embed", +].forEach(element => { + [ + null, + "", + "initialvalue" + ].forEach(initialNameValue => { + [ + "same-origin", + "cross-origin" + ].forEach(originType => { + async_test(t => { + const ident = element + initialNameValue + originType, + file = `${new URL("resources/post-to-parent.html", location.href).pathname}?ident=${ident}`, + child = originType === "same-origin" ? file : `${get_host_info().HTTP_REMOTE_ORIGIN}${file}`, + frame = document.createElement(element), + expectedNameValue = initialNameValue || ""; + let state = "set"; + const listener = t.step_func(e => { + if (e.data.ident === ident) { + assert_equals(e.data.name, expectedNameValue); // This check is always the same + if (state === "set") { + frame.setAttribute("name", "meh"); + state = "remove" + e.source.postMessage(null, "*"); + return; + } + if (state === "remove") { + frame.removeAttribute("name"); + state = "done"; + e.source.postMessage(null, "*"); + return; + } + if (state === "done") { + t.done(); + } + } + }); + frame.setAttribute(element === "object" ? "data" : "src", child); + if (initialNameValue !== null) { + frame.setAttribute("name", initialNameValue); + } + t.add_cleanup(() => { + self.removeEventListener("message", listener); + frame.remove(); + }); + self.addEventListener("message", listener); + document.body.append(frame); + }, `${originType} <${element}${initialNameValue !== null ? ' name=' + initialNameValue : ''}>`); + }); + }); +}); diff --git a/testing/web-platform/tests/html/browsers/windows/nested-browsing-contexts/resources/frameElement-nested-frame.html b/testing/web-platform/tests/html/browsers/windows/nested-browsing-contexts/resources/frameElement-nested-frame.html new file mode 100644 index 0000000000..d066b8d4cb --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/nested-browsing-contexts/resources/frameElement-nested-frame.html @@ -0,0 +1,7 @@ + + +HTML Test: child browsing context created by the frame element + + + + diff --git a/testing/web-platform/tests/html/browsers/windows/nested-browsing-contexts/resources/frameElement-sibling-accessed.html b/testing/web-platform/tests/html/browsers/windows/nested-browsing-contexts/resources/frameElement-sibling-accessed.html new file mode 100644 index 0000000000..15245981ce --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/nested-browsing-contexts/resources/frameElement-sibling-accessed.html @@ -0,0 +1,16 @@ + + +This page will set its document.domain on request so that its sibling can access it + +

I did get loaded

+ + diff --git a/testing/web-platform/tests/html/browsers/windows/nested-browsing-contexts/resources/frameElement-sibling-accessor.html b/testing/web-platform/tests/html/browsers/windows/nested-browsing-contexts/resources/frameElement-sibling-accessor.html new file mode 100644 index 0000000000..4b4c7a87bb --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/nested-browsing-contexts/resources/frameElement-sibling-accessor.html @@ -0,0 +1,33 @@ + + +This page will attempt to access the frameElement of its sibling and report the results on request + +

I did get loaded

+ + diff --git a/testing/web-platform/tests/html/browsers/windows/nested-browsing-contexts/resources/frameElement-window-post.html b/testing/web-platform/tests/html/browsers/windows/nested-browsing-contexts/resources/frameElement-window-post.html new file mode 100644 index 0000000000..d67bde26f4 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/nested-browsing-contexts/resources/frameElement-window-post.html @@ -0,0 +1,14 @@ + + +Testcase 3: frameElement attribute must return null if the container\'s document does not have the same effective script origin + diff --git a/testing/web-platform/tests/html/browsers/windows/nested-browsing-contexts/resources/post-to-opener.html b/testing/web-platform/tests/html/browsers/windows/nested-browsing-contexts/resources/post-to-opener.html new file mode 100644 index 0000000000..65a825f573 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/nested-browsing-contexts/resources/post-to-opener.html @@ -0,0 +1,7 @@ + diff --git a/testing/web-platform/tests/html/browsers/windows/nested-browsing-contexts/resources/post-to-parent.html b/testing/web-platform/tests/html/browsers/windows/nested-browsing-contexts/resources/post-to-parent.html new file mode 100644 index 0000000000..302e9d9cc1 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/nested-browsing-contexts/resources/post-to-parent.html @@ -0,0 +1,6 @@ + diff --git a/testing/web-platform/tests/html/browsers/windows/nested-browsing-contexts/window-parent-null.html b/testing/web-platform/tests/html/browsers/windows/nested-browsing-contexts/window-parent-null.html new file mode 100644 index 0000000000..428312086e --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/nested-browsing-contexts/window-parent-null.html @@ -0,0 +1,66 @@ + + +window.parent: `null` + + +
+ diff --git a/testing/web-platform/tests/html/browsers/windows/nested-browsing-contexts/window-parent.html b/testing/web-platform/tests/html/browsers/windows/nested-browsing-contexts/window-parent.html new file mode 100644 index 0000000000..ef662dca5e --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/nested-browsing-contexts/window-parent.html @@ -0,0 +1,44 @@ + + +window.parent + + +
+ diff --git a/testing/web-platform/tests/html/browsers/windows/nested-browsing-contexts/window-top-null.html b/testing/web-platform/tests/html/browsers/windows/nested-browsing-contexts/window-top-null.html new file mode 100644 index 0000000000..cf7fcf2ae1 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/nested-browsing-contexts/window-top-null.html @@ -0,0 +1,66 @@ + + +window.top: `null` + + +
+ diff --git a/testing/web-platform/tests/html/browsers/windows/nested-browsing-contexts/window-top.html b/testing/web-platform/tests/html/browsers/windows/nested-browsing-contexts/window-top.html new file mode 100644 index 0000000000..e5590adeb8 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/nested-browsing-contexts/window-top.html @@ -0,0 +1,65 @@ + + +window.top + + +
+ diff --git a/testing/web-platform/tests/html/browsers/windows/noreferrer-cross-origin-close-manual.sub.html b/testing/web-platform/tests/html/browsers/windows/noreferrer-cross-origin-close-manual.sub.html new file mode 100644 index 0000000000..8e2740c268 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/noreferrer-cross-origin-close-manual.sub.html @@ -0,0 +1,3 @@ + +

Follow this link to open a new browsing context and then confirm it can be closed: +link. diff --git a/testing/web-platform/tests/html/browsers/windows/noreferrer-cross-origin-manual.html b/testing/web-platform/tests/html/browsers/windows/noreferrer-cross-origin-manual.html new file mode 100644 index 0000000000..f5879ee6d7 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/noreferrer-cross-origin-manual.html @@ -0,0 +1,10 @@ +

    +
  1. After clicking these two links in order a single browsing context should be open showing + example.org: + one, + two. + +

  2. After clicking these two links two browsing contexts should have been opened: + one, + two. +

diff --git a/testing/web-platform/tests/html/browsers/windows/noreferrer-cross-origin-window-name-manual.sub.html b/testing/web-platform/tests/html/browsers/windows/noreferrer-cross-origin-window-name-manual.sub.html new file mode 100644 index 0000000000..c598ffbfaa --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/noreferrer-cross-origin-window-name-manual.sub.html @@ -0,0 +1,3 @@ + +

Follow this link to open a new browsing context and then confirm it says "idonteven": +link. diff --git a/testing/web-platform/tests/html/browsers/windows/noreferrer-null-opener.html b/testing/web-platform/tests/html/browsers/windows/noreferrer-null-opener.html new file mode 100644 index 0000000000..f308abc05e --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/noreferrer-null-opener.html @@ -0,0 +1,25 @@ + +rel=noreferrer nullifies window.opener + + +

+ diff --git a/testing/web-platform/tests/html/browsers/windows/noreferrer-window-name.html b/testing/web-platform/tests/html/browsers/windows/noreferrer-window-name.html new file mode 100644 index 0000000000..5fe649d172 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/noreferrer-window-name.html @@ -0,0 +1,86 @@ + +rel=noreferrer and reuse of names + + + +
+ diff --git a/testing/web-platform/tests/html/browsers/windows/opener-cross-origin-manual.sub.html b/testing/web-platform/tests/html/browsers/windows/opener-cross-origin-manual.sub.html new file mode 100644 index 0000000000..0c018663a2 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/opener-cross-origin-manual.sub.html @@ -0,0 +1,10 @@ +
    +
  1. Clicking this link must navigate this page to a resource that contains "THE END": + test + +

  2. Clicking this link must open a new browsing context that is empty: + test + +

  3. Clicking this link must navigate this page to a resource that contains "THE END": + test +

diff --git a/testing/web-platform/tests/html/browsers/windows/opener-string.window.js b/testing/web-platform/tests/html/browsers/windows/opener-string.window.js new file mode 100644 index 0000000000..a39c584d20 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/opener-string.window.js @@ -0,0 +1,14 @@ +test(t => { + const popup = window.open(); + t.add_cleanup(() => popup.close()); + assert_equals(popup.opener, self, "The opener of the popup is me"); + assert_equals(Object.getOwnPropertyDescriptor(popup, "opener").writable, undefined); + + popup.opener = "blah"; + assert_equals(popup.opener, "blah", "The popup's opener is now a string"); + assert_equals(Object.getOwnPropertyDescriptor(popup, "opener").writable, true); + + const openerGetter = Object.getOwnPropertyDescriptor(self, "opener").get; + const popupOpener = openerGetter.call(popup); + assert_equals(popupOpener, self, "The underlying opener of the popup is still me"); +}, "Setting popup.opener to a string"); diff --git a/testing/web-platform/tests/html/browsers/windows/post-message/first-party-to-first-party-cross-partition.sub.html b/testing/web-platform/tests/html/browsers/windows/post-message/first-party-to-first-party-cross-partition.sub.html new file mode 100644 index 0000000000..f91d9403ea --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/post-message/first-party-to-first-party-cross-partition.sub.html @@ -0,0 +1,26 @@ + + +postMessage: First-Party to First-Party, Cross-Partition + + + + + diff --git a/testing/web-platform/tests/html/browsers/windows/post-message/first-party-to-first-party-same-partition.html b/testing/web-platform/tests/html/browsers/windows/post-message/first-party-to-first-party-same-partition.html new file mode 100644 index 0000000000..6fc915298b --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/post-message/first-party-to-first-party-same-partition.html @@ -0,0 +1,26 @@ + + +postMessage: First-Party to First-Party, Same-Partition + + + + + diff --git a/testing/web-platform/tests/html/browsers/windows/post-message/first-party-to-third-party-cross-partition-cross-origin.sub.html b/testing/web-platform/tests/html/browsers/windows/post-message/first-party-to-third-party-cross-partition-cross-origin.sub.html new file mode 100644 index 0000000000..de776f8381 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/post-message/first-party-to-third-party-cross-partition-cross-origin.sub.html @@ -0,0 +1,27 @@ + + +postMessage: First-Party to Third-Party, Cross-Partition, Cross-Origin + + + + + diff --git a/testing/web-platform/tests/html/browsers/windows/post-message/first-party-to-third-party-cross-partition-same-origin.sub.html b/testing/web-platform/tests/html/browsers/windows/post-message/first-party-to-third-party-cross-partition-same-origin.sub.html new file mode 100644 index 0000000000..490b647fa4 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/post-message/first-party-to-third-party-cross-partition-same-origin.sub.html @@ -0,0 +1,27 @@ + + +postMessage: First-Party to Third-Party, Cross-Partition, Same-Origin + + + + + diff --git a/testing/web-platform/tests/html/browsers/windows/post-message/resources/first-party-to-first-party-cross-partition-window.html b/testing/web-platform/tests/html/browsers/windows/post-message/resources/first-party-to-first-party-cross-partition-window.html new file mode 100644 index 0000000000..cdfa9d95ca --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/post-message/resources/first-party-to-first-party-cross-partition-window.html @@ -0,0 +1,8 @@ + + + + + diff --git a/testing/web-platform/tests/html/browsers/windows/post-message/resources/first-party-to-first-party-same-partition-window.html b/testing/web-platform/tests/html/browsers/windows/post-message/resources/first-party-to-first-party-same-partition-window.html new file mode 100644 index 0000000000..4baf45d3c8 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/post-message/resources/first-party-to-first-party-same-partition-window.html @@ -0,0 +1,8 @@ + + + + + diff --git a/testing/web-platform/tests/html/browsers/windows/post-message/resources/first-party-to-third-party-cross-partition-cross-origin-iframe.https.html b/testing/web-platform/tests/html/browsers/windows/post-message/resources/first-party-to-third-party-cross-partition-cross-origin-iframe.https.html new file mode 100644 index 0000000000..eef594831a --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/post-message/resources/first-party-to-third-party-cross-partition-cross-origin-iframe.https.html @@ -0,0 +1,8 @@ + + + + + diff --git a/testing/web-platform/tests/html/browsers/windows/post-message/resources/first-party-to-third-party-cross-partition-cross-origin-window.sub.https.html b/testing/web-platform/tests/html/browsers/windows/post-message/resources/first-party-to-third-party-cross-partition-cross-origin-window.sub.https.html new file mode 100644 index 0000000000..7edfbd9328 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/post-message/resources/first-party-to-third-party-cross-partition-cross-origin-window.sub.https.html @@ -0,0 +1,6 @@ + + + + + + diff --git a/testing/web-platform/tests/html/browsers/windows/post-message/resources/first-party-to-third-party-cross-partition-same-origin-iframe.html b/testing/web-platform/tests/html/browsers/windows/post-message/resources/first-party-to-third-party-cross-partition-same-origin-iframe.html new file mode 100644 index 0000000000..eb17036c8c --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/post-message/resources/first-party-to-third-party-cross-partition-same-origin-iframe.html @@ -0,0 +1,8 @@ + + + + + diff --git a/testing/web-platform/tests/html/browsers/windows/post-message/resources/first-party-to-third-party-cross-partition-same-origin-window.sub.html b/testing/web-platform/tests/html/browsers/windows/post-message/resources/first-party-to-third-party-cross-partition-same-origin-window.sub.html new file mode 100644 index 0000000000..f99b96c466 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/post-message/resources/first-party-to-third-party-cross-partition-same-origin-window.sub.html @@ -0,0 +1,6 @@ + + + + + + diff --git a/testing/web-platform/tests/html/browsers/windows/post-message/resources/third-party-to-first-party-cross-partition-cross-origin-iframe.sub.html b/testing/web-platform/tests/html/browsers/windows/post-message/resources/third-party-to-first-party-cross-partition-cross-origin-iframe.sub.html new file mode 100644 index 0000000000..348efb3f9c --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/post-message/resources/third-party-to-first-party-cross-partition-cross-origin-iframe.sub.html @@ -0,0 +1,17 @@ + + + + + diff --git a/testing/web-platform/tests/html/browsers/windows/post-message/resources/third-party-to-first-party-cross-partition-cross-origin-window.https.html b/testing/web-platform/tests/html/browsers/windows/post-message/resources/third-party-to-first-party-cross-partition-cross-origin-window.https.html new file mode 100644 index 0000000000..0045909494 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/post-message/resources/third-party-to-first-party-cross-partition-cross-origin-window.https.html @@ -0,0 +1,8 @@ + + + + + diff --git a/testing/web-platform/tests/html/browsers/windows/post-message/resources/third-party-to-first-party-cross-partition-same-origin-iframe.sub.html b/testing/web-platform/tests/html/browsers/windows/post-message/resources/third-party-to-first-party-cross-partition-same-origin-iframe.sub.html new file mode 100644 index 0000000000..405b1053d3 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/post-message/resources/third-party-to-first-party-cross-partition-same-origin-iframe.sub.html @@ -0,0 +1,17 @@ + + + + + diff --git a/testing/web-platform/tests/html/browsers/windows/post-message/resources/third-party-to-first-party-cross-partition-same-origin-window.html b/testing/web-platform/tests/html/browsers/windows/post-message/resources/third-party-to-first-party-cross-partition-same-origin-window.html new file mode 100644 index 0000000000..0ae51e3fc1 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/post-message/resources/third-party-to-first-party-cross-partition-same-origin-window.html @@ -0,0 +1,8 @@ + + + + + diff --git a/testing/web-platform/tests/html/browsers/windows/post-message/resources/third-party-to-third-party-cross-partition-cross-origin-iframe-a.sub.html b/testing/web-platform/tests/html/browsers/windows/post-message/resources/third-party-to-third-party-cross-partition-cross-origin-iframe-a.sub.html new file mode 100644 index 0000000000..a11f3640e8 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/post-message/resources/third-party-to-third-party-cross-partition-cross-origin-iframe-a.sub.html @@ -0,0 +1,17 @@ + + + + + diff --git a/testing/web-platform/tests/html/browsers/windows/post-message/resources/third-party-to-third-party-cross-partition-cross-origin-iframe-b.https.html b/testing/web-platform/tests/html/browsers/windows/post-message/resources/third-party-to-third-party-cross-partition-cross-origin-iframe-b.https.html new file mode 100644 index 0000000000..f56e2b35d8 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/post-message/resources/third-party-to-third-party-cross-partition-cross-origin-iframe-b.https.html @@ -0,0 +1,8 @@ + + + + + diff --git a/testing/web-platform/tests/html/browsers/windows/post-message/resources/third-party-to-third-party-cross-partition-cross-origin-window.sub.https.html b/testing/web-platform/tests/html/browsers/windows/post-message/resources/third-party-to-third-party-cross-partition-cross-origin-window.sub.https.html new file mode 100644 index 0000000000..1307287587 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/post-message/resources/third-party-to-third-party-cross-partition-cross-origin-window.sub.https.html @@ -0,0 +1,6 @@ + + + + + + diff --git a/testing/web-platform/tests/html/browsers/windows/post-message/resources/third-party-to-third-party-cross-partition-same-origin-iframe-a.sub.https.html b/testing/web-platform/tests/html/browsers/windows/post-message/resources/third-party-to-third-party-cross-partition-same-origin-iframe-a.sub.https.html new file mode 100644 index 0000000000..ec551bfdec --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/post-message/resources/third-party-to-third-party-cross-partition-same-origin-iframe-a.sub.https.html @@ -0,0 +1,17 @@ + + + + + diff --git a/testing/web-platform/tests/html/browsers/windows/post-message/resources/third-party-to-third-party-cross-partition-same-origin-iframe-b.https.html b/testing/web-platform/tests/html/browsers/windows/post-message/resources/third-party-to-third-party-cross-partition-same-origin-iframe-b.https.html new file mode 100644 index 0000000000..fc15b1f125 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/post-message/resources/third-party-to-third-party-cross-partition-same-origin-iframe-b.https.html @@ -0,0 +1,8 @@ + + + + + diff --git a/testing/web-platform/tests/html/browsers/windows/post-message/resources/third-party-to-third-party-cross-partition-same-origin-window.sub.https.html b/testing/web-platform/tests/html/browsers/windows/post-message/resources/third-party-to-third-party-cross-partition-same-origin-window.sub.https.html new file mode 100644 index 0000000000..f26f709db3 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/post-message/resources/third-party-to-third-party-cross-partition-same-origin-window.sub.https.html @@ -0,0 +1,6 @@ + + + + + + diff --git a/testing/web-platform/tests/html/browsers/windows/post-message/resources/third-party-to-third-party-same-partition-iframe-a.sub.html b/testing/web-platform/tests/html/browsers/windows/post-message/resources/third-party-to-third-party-same-partition-iframe-a.sub.html new file mode 100644 index 0000000000..339dc9f06e --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/post-message/resources/third-party-to-third-party-same-partition-iframe-a.sub.html @@ -0,0 +1,17 @@ + + + + + diff --git a/testing/web-platform/tests/html/browsers/windows/post-message/resources/third-party-to-third-party-same-partition-iframe-b.html b/testing/web-platform/tests/html/browsers/windows/post-message/resources/third-party-to-third-party-same-partition-iframe-b.html new file mode 100644 index 0000000000..daaf236bfc --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/post-message/resources/third-party-to-third-party-same-partition-iframe-b.html @@ -0,0 +1,8 @@ + + + + + diff --git a/testing/web-platform/tests/html/browsers/windows/post-message/resources/third-party-to-third-party-same-partition-window.sub.html b/testing/web-platform/tests/html/browsers/windows/post-message/resources/third-party-to-third-party-same-partition-window.sub.html new file mode 100644 index 0000000000..7cea58f235 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/post-message/resources/third-party-to-third-party-same-partition-window.sub.html @@ -0,0 +1,6 @@ + + + + + + diff --git a/testing/web-platform/tests/html/browsers/windows/post-message/third-party-to-first-party-cross-partition-cross-origin.sub.html b/testing/web-platform/tests/html/browsers/windows/post-message/third-party-to-first-party-cross-partition-cross-origin.sub.html new file mode 100644 index 0000000000..2618e966de --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/post-message/third-party-to-first-party-cross-partition-cross-origin.sub.html @@ -0,0 +1,29 @@ + + +postMessage: Third-Party to First-Party, Cross-Partition, Cross-Origin + + + + + diff --git a/testing/web-platform/tests/html/browsers/windows/post-message/third-party-to-first-party-cross-partition-same-origin.sub.html b/testing/web-platform/tests/html/browsers/windows/post-message/third-party-to-first-party-cross-partition-same-origin.sub.html new file mode 100644 index 0000000000..735b458841 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/post-message/third-party-to-first-party-cross-partition-same-origin.sub.html @@ -0,0 +1,29 @@ + + +postMessage: Third-Party to First-Party, Cross-Partition, Same-Origin + + + + + diff --git a/testing/web-platform/tests/html/browsers/windows/post-message/third-party-to-third-party-cross-partition-cross-origin.sub.html b/testing/web-platform/tests/html/browsers/windows/post-message/third-party-to-third-party-cross-partition-cross-origin.sub.html new file mode 100644 index 0000000000..1083071f7d --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/post-message/third-party-to-third-party-cross-partition-cross-origin.sub.html @@ -0,0 +1,30 @@ + + +postMessage: Third-Party to Third-Party, Cross-Partition, Cross-Origin + + + + + diff --git a/testing/web-platform/tests/html/browsers/windows/post-message/third-party-to-third-party-cross-partition-same-origin.sub.html b/testing/web-platform/tests/html/browsers/windows/post-message/third-party-to-third-party-cross-partition-same-origin.sub.html new file mode 100644 index 0000000000..9caf6c11e4 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/post-message/third-party-to-third-party-cross-partition-same-origin.sub.html @@ -0,0 +1,30 @@ + + +postMessage: Third-Party to Third-Party, Cross-Partition, Same-Origin + + + + + diff --git a/testing/web-platform/tests/html/browsers/windows/post-message/third-party-to-third-party-same-partition.sub.html b/testing/web-platform/tests/html/browsers/windows/post-message/third-party-to-third-party-same-partition.sub.html new file mode 100644 index 0000000000..c90a055268 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/post-message/third-party-to-third-party-same-partition.sub.html @@ -0,0 +1,30 @@ + + +postMessage: Third-Party to Third-Party, Same-Partition + + + + + diff --git a/testing/web-platform/tests/html/browsers/windows/resources/browsing-context-window.html b/testing/web-platform/tests/html/browsers/windows/resources/browsing-context-window.html new file mode 100644 index 0000000000..c1594f637e --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/resources/browsing-context-window.html @@ -0,0 +1,7 @@ + diff --git a/testing/web-platform/tests/html/browsers/windows/resources/document-domain-setter.html b/testing/web-platform/tests/html/browsers/windows/resources/document-domain-setter.html new file mode 100644 index 0000000000..3b14255571 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/resources/document-domain-setter.html @@ -0,0 +1,7 @@ + + +Helper page that sets document.domain + diff --git a/testing/web-platform/tests/html/browsers/windows/resources/echo-window-name.html b/testing/web-platform/tests/html/browsers/windows/resources/echo-window-name.html new file mode 100644 index 0000000000..a437fecb2c --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/resources/echo-window-name.html @@ -0,0 +1 @@ + diff --git a/testing/web-platform/tests/html/browsers/windows/resources/iframe-nested-cross-origin.html b/testing/web-platform/tests/html/browsers/windows/resources/iframe-nested-cross-origin.html new file mode 100644 index 0000000000..a1a66ed842 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/resources/iframe-nested-cross-origin.html @@ -0,0 +1,2 @@ + + diff --git a/testing/web-platform/tests/html/browsers/windows/resources/iframe-nested-printing-pass.html b/testing/web-platform/tests/html/browsers/windows/resources/iframe-nested-printing-pass.html new file mode 100644 index 0000000000..c2dca9185f --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/resources/iframe-nested-printing-pass.html @@ -0,0 +1,9 @@ + + + +PASS + diff --git a/testing/web-platform/tests/html/browsers/windows/resources/message-parent.html b/testing/web-platform/tests/html/browsers/windows/resources/message-parent.html new file mode 100644 index 0000000000..ba60618ad4 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/resources/message-parent.html @@ -0,0 +1,5 @@ + diff --git a/testing/web-platform/tests/html/browsers/windows/resources/nested-post-to-opener.html b/testing/web-platform/tests/html/browsers/windows/resources/nested-post-to-opener.html new file mode 100644 index 0000000000..e92b69d7e7 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/resources/nested-post-to-opener.html @@ -0,0 +1,12 @@ + + + diff --git a/testing/web-platform/tests/html/browsers/windows/resources/noreferrer-window-name.html b/testing/web-platform/tests/html/browsers/windows/resources/noreferrer-window-name.html new file mode 100644 index 0000000000..8c106ca886 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/resources/noreferrer-window-name.html @@ -0,0 +1,8 @@ + diff --git a/testing/web-platform/tests/html/browsers/windows/resources/opener-cross-origin-embed.sub.html b/testing/web-platform/tests/html/browsers/windows/resources/opener-cross-origin-embed.sub.html new file mode 100644 index 0000000000..db0c003141 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/resources/opener-cross-origin-embed.sub.html @@ -0,0 +1,2 @@ + + diff --git a/testing/web-platform/tests/html/browsers/windows/resources/opener-cross-origin-end.txt b/testing/web-platform/tests/html/browsers/windows/resources/opener-cross-origin-end.txt new file mode 100644 index 0000000000..8b74fbab8a --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/resources/opener-cross-origin-end.txt @@ -0,0 +1 @@ +THE END diff --git a/testing/web-platform/tests/html/browsers/windows/resources/opener-cross-origin.html b/testing/web-platform/tests/html/browsers/windows/resources/opener-cross-origin.html new file mode 100644 index 0000000000..7c536b9213 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/resources/opener-cross-origin.html @@ -0,0 +1,4 @@ + diff --git a/testing/web-platform/tests/html/browsers/windows/resources/post-to-opener.html b/testing/web-platform/tests/html/browsers/windows/resources/post-to-opener.html new file mode 100644 index 0000000000..453fec97a7 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/resources/post-to-opener.html @@ -0,0 +1,8 @@ + diff --git a/testing/web-platform/tests/html/browsers/windows/resources/restore-window-name-back.sub.html b/testing/web-platform/tests/html/browsers/windows/resources/restore-window-name-back.sub.html new file mode 100644 index 0000000000..ea2c3a92b4 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/resources/restore-window-name-back.sub.html @@ -0,0 +1,7 @@ + + \ No newline at end of file diff --git a/testing/web-platform/tests/html/browsers/windows/resources/restore-window-name.sub.html b/testing/web-platform/tests/html/browsers/windows/resources/restore-window-name.sub.html new file mode 100644 index 0000000000..a1e573a7c0 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/resources/restore-window-name.sub.html @@ -0,0 +1,43 @@ + + + +popup helper for restore window.name test + + + +

Please first click the 'start test' link. And then, click the 'Verify Result' button to verify the result. You should get a PASS after clicking the button

+ start test
+ + Result: + + diff --git a/testing/web-platform/tests/html/browsers/windows/resources/target-cross-origin.sub.html b/testing/web-platform/tests/html/browsers/windows/resources/target-cross-origin.sub.html new file mode 100644 index 0000000000..8472f96b90 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/resources/target-cross-origin.sub.html @@ -0,0 +1,3 @@ + +

Follow this link to open a new browsing context in a separate origin. +link. diff --git a/testing/web-platform/tests/html/browsers/windows/resources/window-close-button.html b/testing/web-platform/tests/html/browsers/windows/resources/window-close-button.html new file mode 100644 index 0000000000..38ec2aef5c --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/resources/window-close-button.html @@ -0,0 +1 @@ +

Clicking this button should close this browsing context: diff --git a/testing/web-platform/tests/html/browsers/windows/resources/window-name-stash.py b/testing/web-platform/tests/html/browsers/windows/resources/window-name-stash.py new file mode 100644 index 0000000000..411a4587bc --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/resources/window-name-stash.py @@ -0,0 +1,13 @@ +def main(request, response): + key = request.GET.first(b"id") + if request.method == "POST": + value = request.GET.first(b"value") + request.server.stash.take(key) + request.server.stash.put(key, value) + return b"OK" + else: + value = request.server.stash.take(key) + if value is not None: + return value + else: + return b"NONE" diff --git a/testing/web-platform/tests/html/browsers/windows/resources/window-name.sub.html b/testing/web-platform/tests/html/browsers/windows/resources/window-name.sub.html new file mode 100644 index 0000000000..9255ba3401 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/resources/window-name.sub.html @@ -0,0 +1,102 @@ + +popup helper + diff --git a/testing/web-platform/tests/html/browsers/windows/resources/window-opener.html b/testing/web-platform/tests/html/browsers/windows/resources/window-opener.html new file mode 100644 index 0000000000..c734eb3056 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/resources/window-opener.html @@ -0,0 +1,4 @@ + diff --git a/testing/web-platform/tests/html/browsers/windows/restore-window-name-manual.https.html b/testing/web-platform/tests/html/browsers/windows/restore-window-name-manual.https.html new file mode 100644 index 0000000000..13e8381e31 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/restore-window-name-manual.https.html @@ -0,0 +1,20 @@ + + + + Restore window.name when navigating back from a cross-origin + + + + + + +

Please click the following link and follow the instructions in the page for testing

+ run test + + diff --git a/testing/web-platform/tests/html/browsers/windows/targeting-cross-origin-nested-browsing-contexts.html b/testing/web-platform/tests/html/browsers/windows/targeting-cross-origin-nested-browsing-contexts.html new file mode 100644 index 0000000000..44d4fbad6b --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/targeting-cross-origin-nested-browsing-contexts.html @@ -0,0 +1,39 @@ + + + + + Targeting nested browsing contexts + + + + + + + + diff --git a/testing/web-platform/tests/html/browsers/windows/targeting-multiple-cross-origin-manual.sub.html b/testing/web-platform/tests/html/browsers/windows/targeting-multiple-cross-origin-manual.sub.html new file mode 100644 index 0000000000..c8f8cfbe29 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/targeting-multiple-cross-origin-manual.sub.html @@ -0,0 +1,9 @@ + +

Follow this link to open a new browsing context in a separate origin. Follow the instructions +in that new window, and then come back to this window. +link. + +

Once you come back to this page, follow this link. +link. + +

After clicking that link, you should have three additional windows open. diff --git a/testing/web-platform/tests/html/browsers/windows/targeting-with-embedded-null-in-target.html b/testing/web-platform/tests/html/browsers/windows/targeting-with-embedded-null-in-target.html new file mode 100644 index 0000000000..7407248ffe --- /dev/null +++ b/testing/web-platform/tests/html/browsers/windows/targeting-with-embedded-null-in-target.html @@ -0,0 +1,34 @@ + + + + + Targeting with embedded null in target + + + + + + Click me + + + -- cgit v1.2.3