From 0ebf5bdf043a27fd3dfb7f92e0cb63d88954c44d Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 03:47:29 +0200 Subject: Adding upstream version 115.8.0esr. Signed-off-by: Daniel Baumann --- .../collections/domstringlist.html | 61 ++ .../collections/historical.html | 33 + .../collections/htmlallcollection.html | 334 ++++++++++ .../collections/htmlformcontrolscollection.html | 121 ++++ .../collections/htmloptionscollection.html | 216 +++++++ .../collections/radionodelist.html | 78 +++ ...cy-colour-value-ascii-case-insensitive-ref.html | 6 + ...legacy-colour-value-ascii-case-insensitive.html | 20 + .../extensibility/foreign.html | 45 ++ ...ssorigin-enumerated-ascii-case-insensitive.html | 34 + ...ross-origin-transfer-resizable-arraybuffer.html | 28 + .../messagechannel.any.js | 16 + .../resources/echo-iframe.html | 11 + .../resources/echo-iframe.html.headers | 2 + .../resources/echo-worker.js | 5 + .../resources/echo-worker.js.headers | 1 + .../iframe-resizable-arraybuffer-helper.html | 11 + .../resources/post-parent-type-error.html | 9 + .../shared-array-buffers/blob-data.https.html | 132 ++++ .../blob-data.https.html.headers | 2 + ...broadcastchannel-success-and-failure.https.html | 35 + ...tchannel-success-and-failure.https.html.headers | 2 + .../broadcastchannel-success.https.html | 55 ++ .../broadcastchannel-success.https.html.headers | 2 + .../identity-not-preserved.https.html | 68 ++ .../identity-not-preserved.https.html.headers | 2 + .../nested-sharedworker-success.https.html | 8 + .../nested-sharedworker-success.https.html.headers | 2 + .../nested-worker-success.https.html | 8 + .../nested-worker-success.https.html.headers | 2 + .../shared-array-buffers/no-coop-coep.https.any.js | 33 + .../no-transferring.https.html | 31 + .../no-transferring.https.html.headers | 2 + .../shared-array-buffers/resources/blank.html | 2 + .../resources/blank.html.headers | 1 + .../resources/broadcastchannel-iframe.html | 22 + .../resources/broadcastchannel-iframe.html.headers | 2 + .../resources/broadcastchannel-sharedworker.js | 7 + .../broadcastchannel-sharedworker.js.headers | 1 + .../resources/broadcastchannel-worker.js | 9 + .../resources/broadcastchannel-worker.js.headers | 1 + .../resources/iframe-domain-failure.sub.html | 14 + .../iframe-domain-failure.sub.html.headers | 2 + .../resources/iframe-failure.html | 3 + .../resources/iframe-failure.html.headers | 2 + .../resources/iframe-messagechannel-complex.html | 6 + .../iframe-messagechannel-complex.html.headers | 2 + .../resources/iframe-messagechannel-failure.html | 7 + .../iframe-messagechannel-failure.html.headers | 2 + .../iframe-messagechannel-site-failure.html | 7 + ...iframe-messagechannel-site-failure.html.headers | 2 + .../incrementer-iframe-messagechannel.html | 10 + .../incrementer-iframe-messagechannel.html.headers | 2 + .../resources/incrementer-iframe.html | 10 + .../resources/incrementer-iframe.html.headers | 2 + .../resources/incrementer-popup.html | 10 + .../resources/incrementer-popup.html.headers | 2 + .../resources/incrementer-worker-with-channel.js | 7 + .../incrementer-worker-with-channel.js.headers | 1 + .../resources/incrementer-worker.js | 4 + .../resources/incrementer-worker.js.headers | 1 + .../resources/nested-iframe-1.html | 5 + .../resources/nested-iframe-1.html.headers | 2 + .../resources/nested-iframe-2.html | 5 + .../resources/nested-iframe-2.html.headers | 2 + .../resources/nested-iframe-3.html | 5 + .../resources/nested-iframe-3.html.headers | 2 + .../resources/nested-iframe-4-incrementer.html | 10 + .../nested-iframe-4-incrementer.html.headers | 2 + .../resources/nested-worker-success.js | 14 + .../resources/nested-worker-success.js.headers | 1 + .../resources/serviceworker-failure.js | 33 + .../resources/serviceworker-failure.js.headers | 1 + .../resources/sharedworker-failure.js | 18 + .../resources/sharedworker-failure.js.headers | 1 + .../resources/test-incrementer.js | 80 +++ .../shared-array-buffers/resources/test-sab.js | 15 + .../serialization-via-history.https.html | 36 ++ .../serialization-via-history.https.html.headers | 2 + .../serialization-via-idb.any.js | 44 ++ .../serialization-via-notifications-api.any.js | 28 + .../window-domain-failure.https.sub.html | 49 ++ .../window-domain-failure.https.sub.html.headers | 2 + .../shared-array-buffers/window-failure.https.html | 15 + .../window-failure.https.html.headers | 2 + .../window-iframe-messagechannel.https.html | 80 +++ ...window-iframe-messagechannel.https.html.headers | 2 + .../window-messagechannel-success.https.html | 22 + ...indow-messagechannel-success.https.html.headers | 2 + .../window-serviceworker-failure.https.html | 56 ++ ...window-serviceworker-failure.https.html.headers | 2 + .../window-sharedworker-failure.https.html | 31 + .../window-sharedworker-failure.https.html.headers | 2 + .../window-simple-success.https.html | 72 +++ .../window-simple-success.https.html.headers | 2 + .../structured-cloning-error-extra.html | 46 ++ ...ured-cloning-error-stack-optional.sub.window.js | 106 +++ .../structuredclone_0.html | 637 ++++++++++++++++++ .../transfer-errors.window.js | 47 ++ .../window-postmessage.window.js | 16 + .../infrastructure/terminology/plugins/sample.txt | 3 + .../terminology/plugins/text-plain.html | 32 + ...ment-base-url-changes-about-srcdoc-2.https.html | 57 ++ .../dynamic-urls.sub.html | 41 ++ .../historical.sub.xhtml | 59 ++ .../query-encoding/attributes.sub.html | 67 ++ .../query-encoding/location.sub.html | 46 ++ .../query-encoding/lone-surrogates.sub.html | 30 + .../query-encoding/navigation.sub.html | 162 +++++ .../query-encoding/resources/blank.py | 2 + .../query-encoding/resources/css-tmpl.py | 7 + .../query-encoding/resources/resolve-url.js | 719 +++++++++++++++++++++ .../query-encoding/resources/resource.py | 133 ++++ .../query-encoding/resources/stash.py | 15 + .../resolving-urls/query-encoding/utf-16be.html | Bin 0 -> 2640 bytes .../resolving-urls/query-encoding/utf-16le.html | Bin 0 -> 2646 bytes .../urls/resolving-urls/query-encoding/utf-8.html | 26 + .../query-encoding/windows-1251.html | 26 + .../query-encoding/windows-1252.html | 26 + .../document-base-url-about-srcdoc.https.window.js | 27 + ...t-base-url-changes-about-srcdoc.https.window.js | 47 ++ ...-changes-after-nav-about-srcdoc.https.window.js | 83 +++ ...base-url-initiated-grand-parent.https.window.js | 62 ++ .../urls/terminology-0/document-base-url.html | 93 +++ .../urls/terminology-0/multiple-base.sub.html | 17 + .../resources/send-back-base-url.html | 8 + 126 files changed, 4841 insertions(+) create mode 100644 testing/web-platform/tests/html/infrastructure/common-dom-interfaces/collections/domstringlist.html create mode 100644 testing/web-platform/tests/html/infrastructure/common-dom-interfaces/collections/historical.html create mode 100644 testing/web-platform/tests/html/infrastructure/common-dom-interfaces/collections/htmlallcollection.html create mode 100644 testing/web-platform/tests/html/infrastructure/common-dom-interfaces/collections/htmlformcontrolscollection.html create mode 100644 testing/web-platform/tests/html/infrastructure/common-dom-interfaces/collections/htmloptionscollection.html create mode 100644 testing/web-platform/tests/html/infrastructure/common-dom-interfaces/collections/radionodelist.html create mode 100644 testing/web-platform/tests/html/infrastructure/common-microsyntaxes/colours/parsing-legacy-colour-value-ascii-case-insensitive-ref.html create mode 100644 testing/web-platform/tests/html/infrastructure/common-microsyntaxes/colours/parsing-legacy-colour-value-ascii-case-insensitive.html create mode 100644 testing/web-platform/tests/html/infrastructure/conformance-requirements/extensibility/foreign.html create mode 100644 testing/web-platform/tests/html/infrastructure/fetching-resources/crossorigin-enumerated-ascii-case-insensitive.html create mode 100644 testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/cross-origin-transfer-resizable-arraybuffer.html create mode 100644 testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/messagechannel.any.js create mode 100644 testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/resources/echo-iframe.html create mode 100644 testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/resources/echo-iframe.html.headers create mode 100644 testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/resources/echo-worker.js create mode 100644 testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/resources/echo-worker.js.headers create mode 100644 testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/resources/iframe-resizable-arraybuffer-helper.html create mode 100644 testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/resources/post-parent-type-error.html create mode 100644 testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/blob-data.https.html create mode 100644 testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/blob-data.https.html.headers create mode 100644 testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/broadcastchannel-success-and-failure.https.html create mode 100644 testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/broadcastchannel-success-and-failure.https.html.headers create mode 100644 testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/broadcastchannel-success.https.html create mode 100644 testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/broadcastchannel-success.https.html.headers create mode 100644 testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/identity-not-preserved.https.html create mode 100644 testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/identity-not-preserved.https.html.headers create mode 100644 testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/nested-sharedworker-success.https.html create mode 100644 testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/nested-sharedworker-success.https.html.headers create mode 100644 testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/nested-worker-success.https.html create mode 100644 testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/nested-worker-success.https.html.headers create mode 100644 testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/no-coop-coep.https.any.js create mode 100644 testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/no-transferring.https.html create mode 100644 testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/no-transferring.https.html.headers create mode 100644 testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/blank.html create mode 100644 testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/blank.html.headers create mode 100644 testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/broadcastchannel-iframe.html create mode 100644 testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/broadcastchannel-iframe.html.headers create mode 100644 testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/broadcastchannel-sharedworker.js create mode 100644 testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/broadcastchannel-sharedworker.js.headers create mode 100644 testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/broadcastchannel-worker.js create mode 100644 testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/broadcastchannel-worker.js.headers create mode 100644 testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/iframe-domain-failure.sub.html create mode 100644 testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/iframe-domain-failure.sub.html.headers create mode 100644 testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/iframe-failure.html create mode 100644 testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/iframe-failure.html.headers create mode 100644 testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/iframe-messagechannel-complex.html create mode 100644 testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/iframe-messagechannel-complex.html.headers create mode 100644 testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/iframe-messagechannel-failure.html create mode 100644 testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/iframe-messagechannel-failure.html.headers create mode 100644 testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/iframe-messagechannel-site-failure.html create mode 100644 testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/iframe-messagechannel-site-failure.html.headers create mode 100644 testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/incrementer-iframe-messagechannel.html create mode 100644 testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/incrementer-iframe-messagechannel.html.headers create mode 100644 testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/incrementer-iframe.html create mode 100644 testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/incrementer-iframe.html.headers create mode 100644 testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/incrementer-popup.html create mode 100644 testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/incrementer-popup.html.headers create mode 100644 testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/incrementer-worker-with-channel.js create mode 100644 testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/incrementer-worker-with-channel.js.headers create mode 100644 testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/incrementer-worker.js create mode 100644 testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/incrementer-worker.js.headers create mode 100644 testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/nested-iframe-1.html create mode 100644 testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/nested-iframe-1.html.headers create mode 100644 testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/nested-iframe-2.html create mode 100644 testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/nested-iframe-2.html.headers create mode 100644 testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/nested-iframe-3.html create mode 100644 testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/nested-iframe-3.html.headers create mode 100644 testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/nested-iframe-4-incrementer.html create mode 100644 testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/nested-iframe-4-incrementer.html.headers create mode 100644 testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/nested-worker-success.js create mode 100644 testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/nested-worker-success.js.headers create mode 100644 testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/serviceworker-failure.js create mode 100644 testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/serviceworker-failure.js.headers create mode 100644 testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/sharedworker-failure.js create mode 100644 testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/sharedworker-failure.js.headers create mode 100644 testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/test-incrementer.js create mode 100644 testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/test-sab.js create mode 100644 testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/serialization-via-history.https.html create mode 100644 testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/serialization-via-history.https.html.headers create mode 100644 testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/serialization-via-idb.any.js create mode 100644 testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/serialization-via-notifications-api.any.js create mode 100644 testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/window-domain-failure.https.sub.html create mode 100644 testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/window-domain-failure.https.sub.html.headers create mode 100644 testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/window-failure.https.html create mode 100644 testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/window-failure.https.html.headers create mode 100644 testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/window-iframe-messagechannel.https.html create mode 100644 testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/window-iframe-messagechannel.https.html.headers create mode 100644 testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/window-messagechannel-success.https.html create mode 100644 testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/window-messagechannel-success.https.html.headers create mode 100644 testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/window-serviceworker-failure.https.html create mode 100644 testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/window-serviceworker-failure.https.html.headers create mode 100644 testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/window-sharedworker-failure.https.html create mode 100644 testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/window-sharedworker-failure.https.html.headers create mode 100644 testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/window-simple-success.https.html create mode 100644 testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/window-simple-success.https.html.headers create mode 100644 testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/structured-cloning-error-extra.html create mode 100644 testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/structured-cloning-error-stack-optional.sub.window.js create mode 100644 testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/structuredclone_0.html create mode 100644 testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/transfer-errors.window.js create mode 100644 testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/window-postmessage.window.js create mode 100644 testing/web-platform/tests/html/infrastructure/terminology/plugins/sample.txt create mode 100644 testing/web-platform/tests/html/infrastructure/terminology/plugins/text-plain.html create mode 100644 testing/web-platform/tests/html/infrastructure/urls/base-url/document-base-url-changes-about-srcdoc-2.https.html create mode 100644 testing/web-platform/tests/html/infrastructure/urls/dynamic-changes-to-base-urls/dynamic-urls.sub.html create mode 100644 testing/web-platform/tests/html/infrastructure/urls/dynamic-changes-to-base-urls/historical.sub.xhtml create mode 100644 testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/attributes.sub.html create mode 100644 testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/location.sub.html create mode 100644 testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/lone-surrogates.sub.html create mode 100644 testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/navigation.sub.html create mode 100644 testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/resources/blank.py create mode 100644 testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/resources/css-tmpl.py create mode 100644 testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/resources/resolve-url.js create mode 100644 testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/resources/resource.py create mode 100644 testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/resources/stash.py create mode 100644 testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/utf-16be.html create mode 100644 testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/utf-16le.html create mode 100644 testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/utf-8.html create mode 100644 testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/windows-1251.html create mode 100644 testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/windows-1252.html create mode 100644 testing/web-platform/tests/html/infrastructure/urls/terminology-0/document-base-url-about-srcdoc.https.window.js create mode 100644 testing/web-platform/tests/html/infrastructure/urls/terminology-0/document-base-url-changes-about-srcdoc.https.window.js create mode 100644 testing/web-platform/tests/html/infrastructure/urls/terminology-0/document-base-url-changes-after-nav-about-srcdoc.https.window.js create mode 100644 testing/web-platform/tests/html/infrastructure/urls/terminology-0/document-base-url-initiated-grand-parent.https.window.js create mode 100644 testing/web-platform/tests/html/infrastructure/urls/terminology-0/document-base-url.html create mode 100644 testing/web-platform/tests/html/infrastructure/urls/terminology-0/multiple-base.sub.html create mode 100644 testing/web-platform/tests/html/infrastructure/urls/terminology-0/resources/send-back-base-url.html (limited to 'testing/web-platform/tests/html/infrastructure') diff --git a/testing/web-platform/tests/html/infrastructure/common-dom-interfaces/collections/domstringlist.html b/testing/web-platform/tests/html/infrastructure/common-dom-interfaces/collections/domstringlist.html new file mode 100644 index 0000000000..6e6e4312a0 --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/common-dom-interfaces/collections/domstringlist.html @@ -0,0 +1,61 @@ + +DOMStringList + + + diff --git a/testing/web-platform/tests/html/infrastructure/common-dom-interfaces/collections/historical.html b/testing/web-platform/tests/html/infrastructure/common-dom-interfaces/collections/historical.html new file mode 100644 index 0000000000..91142c864e --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/common-dom-interfaces/collections/historical.html @@ -0,0 +1,33 @@ + +Historical HTML*Collection features should not be supported + + +
+
+ +
+
+ diff --git a/testing/web-platform/tests/html/infrastructure/common-dom-interfaces/collections/htmlallcollection.html b/testing/web-platform/tests/html/infrastructure/common-dom-interfaces/collections/htmlallcollection.html new file mode 100644 index 0000000000..14faa2128e --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/common-dom-interfaces/collections/htmlallcollection.html @@ -0,0 +1,334 @@ + + + +HTMLAllCollection Tests + + + + + + + + + + + + + + +
+
+
+
+
+
+
+
+ + + diff --git a/testing/web-platform/tests/html/infrastructure/common-dom-interfaces/collections/htmlformcontrolscollection.html b/testing/web-platform/tests/html/infrastructure/common-dom-interfaces/collections/htmlformcontrolscollection.html new file mode 100644 index 0000000000..5591e190b3 --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/common-dom-interfaces/collections/htmlformcontrolscollection.html @@ -0,0 +1,121 @@ + + +HTML Test: the HTMLFormControlsCollection interface + + + + +
+
+ + +
+
+ + + + + + + +
+ + +
+ + +
+
+ + diff --git a/testing/web-platform/tests/html/infrastructure/common-dom-interfaces/collections/htmloptionscollection.html b/testing/web-platform/tests/html/infrastructure/common-dom-interfaces/collections/htmloptionscollection.html new file mode 100644 index 0000000000..130716a9cc --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/common-dom-interfaces/collections/htmloptionscollection.html @@ -0,0 +1,216 @@ + +HTMLOptionsCollection + + + + + + + + +
diff --git a/testing/web-platform/tests/html/infrastructure/common-dom-interfaces/collections/radionodelist.html b/testing/web-platform/tests/html/infrastructure/common-dom-interfaces/collections/radionodelist.html new file mode 100644 index 0000000000..fc70d7172c --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/common-dom-interfaces/collections/radionodelist.html @@ -0,0 +1,78 @@ + + +HTML Test: the RadioNodeList interface + + + + +
+
+ + + +
+ diff --git a/testing/web-platform/tests/html/infrastructure/common-microsyntaxes/colours/parsing-legacy-colour-value-ascii-case-insensitive-ref.html b/testing/web-platform/tests/html/infrastructure/common-microsyntaxes/colours/parsing-legacy-colour-value-ascii-case-insensitive-ref.html new file mode 100644 index 0000000000..6565e0e750 --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/common-microsyntaxes/colours/parsing-legacy-colour-value-ascii-case-insensitive-ref.html @@ -0,0 +1,6 @@ + + + +

This square should be black: X +

This square should be black: X +

This square should be blue: X diff --git a/testing/web-platform/tests/html/infrastructure/common-microsyntaxes/colours/parsing-legacy-colour-value-ascii-case-insensitive.html b/testing/web-platform/tests/html/infrastructure/common-microsyntaxes/colours/parsing-legacy-colour-value-ascii-case-insensitive.html new file mode 100644 index 0000000000..eee4a9c7c8 --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/common-microsyntaxes/colours/parsing-legacy-colour-value-ascii-case-insensitive.html @@ -0,0 +1,20 @@ + + + + + + +

This square should be black: X +

This square should be black: X +

This square should be blue: X + diff --git a/testing/web-platform/tests/html/infrastructure/conformance-requirements/extensibility/foreign.html b/testing/web-platform/tests/html/infrastructure/conformance-requirements/extensibility/foreign.html new file mode 100644 index 0000000000..eaa133bade --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/conformance-requirements/extensibility/foreign.html @@ -0,0 +1,45 @@ + + + + + Foreign content + + + + + + + + +

User agents must treat elements and attributes that they do not understand as semantically neutral; leaving them in the DOM (for DOM processors), and styling them according to CSS (for CSS processors), but not inferring any meaning from them.

+ + Foobar + +
Running test...
+ + + + diff --git a/testing/web-platform/tests/html/infrastructure/fetching-resources/crossorigin-enumerated-ascii-case-insensitive.html b/testing/web-platform/tests/html/infrastructure/fetching-resources/crossorigin-enumerated-ascii-case-insensitive.html new file mode 100644 index 0000000000..7207d43c60 --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/fetching-resources/crossorigin-enumerated-ascii-case-insensitive.html @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + diff --git a/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/cross-origin-transfer-resizable-arraybuffer.html b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/cross-origin-transfer-resizable-arraybuffer.html new file mode 100644 index 0000000000..2b21a1459d --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/cross-origin-transfer-resizable-arraybuffer.html @@ -0,0 +1,28 @@ + +postMessage transfer ArrayBuffer cross origin iframe + + + + + diff --git a/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/messagechannel.any.js b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/messagechannel.any.js new file mode 100644 index 0000000000..6ba17f7a89 --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/messagechannel.any.js @@ -0,0 +1,16 @@ +// META: global=window,worker +// META: script=/common/sab.js +// META: script=/html/webappapis/structured-clone/structured-clone-battery-of-tests.js +// META: script=/html/webappapis/structured-clone/structured-clone-battery-of-tests-with-transferables.js +// META: script=/html/webappapis/structured-clone/structured-clone-battery-of-tests-harness.js + +runStructuredCloneBatteryOfTests({ + structuredClone(data, transfer) { + return new Promise(resolve => { + const channel = new MessageChannel(); + channel.port2.onmessage = ev => resolve(ev.data.data); + channel.port1.postMessage({data, transfer}, transfer); + }); + }, + hasDocument : self.GLOBAL.isWindow() +}); diff --git a/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/resources/echo-iframe.html b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/resources/echo-iframe.html new file mode 100644 index 0000000000..c4fd5824a1 --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/resources/echo-iframe.html @@ -0,0 +1,11 @@ + + +A test page that echos back anything postMessaged to it to its parent + + diff --git a/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/resources/echo-iframe.html.headers b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/resources/echo-iframe.html.headers new file mode 100644 index 0000000000..4e798cd9f5 --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/resources/echo-iframe.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/infrastructure/safe-passing-of-structured-data/resources/echo-worker.js b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/resources/echo-worker.js new file mode 100644 index 0000000000..cbbde8a73c --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/resources/echo-worker.js @@ -0,0 +1,5 @@ +"use strict"; + +self.onmessage = ({ data }) => { + self.postMessage(data); +}; diff --git a/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/resources/echo-worker.js.headers b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/resources/echo-worker.js.headers new file mode 100644 index 0000000000..6604450991 --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/resources/echo-worker.js.headers @@ -0,0 +1 @@ +Cross-Origin-Embedder-Policy: require-corp diff --git a/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/resources/iframe-resizable-arraybuffer-helper.html b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/resources/iframe-resizable-arraybuffer-helper.html new file mode 100644 index 0000000000..378c953fbe --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/resources/iframe-resizable-arraybuffer-helper.html @@ -0,0 +1,11 @@ + + diff --git a/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/resources/post-parent-type-error.html b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/resources/post-parent-type-error.html new file mode 100644 index 0000000000..d6713c4192 --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/resources/post-parent-type-error.html @@ -0,0 +1,9 @@ + + +Helper that posts its parent a TypeError + + diff --git a/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/blob-data.https.html b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/blob-data.https.html new file mode 100644 index 0000000000..bfcc8b61ca --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/blob-data.https.html @@ -0,0 +1,132 @@ + + + + +
+ diff --git a/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/blob-data.https.html.headers b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/blob-data.https.html.headers new file mode 100644 index 0000000000..63b60e490f --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/blob-data.https.html.headers @@ -0,0 +1,2 @@ +Cross-Origin-Opener-Policy: same-origin +Cross-Origin-Embedder-Policy: require-corp diff --git a/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/broadcastchannel-success-and-failure.https.html b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/broadcastchannel-success-and-failure.https.html new file mode 100644 index 0000000000..8902de49cf --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/broadcastchannel-success-and-failure.https.html @@ -0,0 +1,35 @@ + +SharedArrayBuffer cannot cross agent clusters, BroadcastChannel edition + + + diff --git a/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/broadcastchannel-success-and-failure.https.html.headers b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/broadcastchannel-success-and-failure.https.html.headers new file mode 100644 index 0000000000..63b60e490f --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/broadcastchannel-success-and-failure.https.html.headers @@ -0,0 +1,2 @@ +Cross-Origin-Opener-Policy: same-origin +Cross-Origin-Embedder-Policy: require-corp diff --git a/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/broadcastchannel-success.https.html b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/broadcastchannel-success.https.html new file mode 100644 index 0000000000..d3e9956368 --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/broadcastchannel-success.https.html @@ -0,0 +1,55 @@ + + +Structured cloning of SharedArrayBuffers: BroadcastChannel within the same agent cluster + + + + + + + +
+ + diff --git a/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/broadcastchannel-success.https.html.headers b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/broadcastchannel-success.https.html.headers new file mode 100644 index 0000000000..63b60e490f --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/broadcastchannel-success.https.html.headers @@ -0,0 +1,2 @@ +Cross-Origin-Opener-Policy: same-origin +Cross-Origin-Embedder-Policy: require-corp diff --git a/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/identity-not-preserved.https.html b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/identity-not-preserved.https.html new file mode 100644 index 0000000000..869f49043e --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/identity-not-preserved.https.html @@ -0,0 +1,68 @@ + + +SharedArrayBuffers, when cloned, do not give back the same object + + + + + + + +
+ + diff --git a/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/identity-not-preserved.https.html.headers b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/identity-not-preserved.https.html.headers new file mode 100644 index 0000000000..63b60e490f --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/identity-not-preserved.https.html.headers @@ -0,0 +1,2 @@ +Cross-Origin-Opener-Policy: same-origin +Cross-Origin-Embedder-Policy: require-corp diff --git a/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/nested-sharedworker-success.https.html b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/nested-sharedworker-success.https.html new file mode 100644 index 0000000000..dd221502b6 --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/nested-sharedworker-success.https.html @@ -0,0 +1,8 @@ + + + + +
+ diff --git a/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/nested-sharedworker-success.https.html.headers b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/nested-sharedworker-success.https.html.headers new file mode 100644 index 0000000000..63b60e490f --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/nested-sharedworker-success.https.html.headers @@ -0,0 +1,2 @@ +Cross-Origin-Opener-Policy: same-origin +Cross-Origin-Embedder-Policy: require-corp diff --git a/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/nested-worker-success.https.html b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/nested-worker-success.https.html new file mode 100644 index 0000000000..aeee3705ae --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/nested-worker-success.https.html @@ -0,0 +1,8 @@ + + + + +
+ diff --git a/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/nested-worker-success.https.html.headers b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/nested-worker-success.https.html.headers new file mode 100644 index 0000000000..63b60e490f --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/nested-worker-success.https.html.headers @@ -0,0 +1,2 @@ +Cross-Origin-Opener-Policy: same-origin +Cross-Origin-Embedder-Policy: require-corp diff --git a/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/no-coop-coep.https.any.js b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/no-coop-coep.https.any.js new file mode 100644 index 0000000000..0db16fd6f7 --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/no-coop-coep.https.any.js @@ -0,0 +1,33 @@ +// META: global=window,worker + +test(() => { + // See https://github.com/whatwg/html/issues/5380 for why not `new SharedArrayBuffer()` + assert_equals(globalThis.SharedArrayBuffer, undefined); + assert_false("SharedArrayBuffer" in globalThis); +}, "SharedArrayBuffer constructor does not exist without COOP+COEP"); + +test(() => { + // See https://github.com/whatwg/html/issues/5380 for why not `new SharedArrayBuffer()` + const sab = new WebAssembly.Memory({ shared:true, initial:1, maximum:1 }).buffer; + const channel = new MessageChannel(); + assert_throws_dom("DataCloneError", () => channel.port1.postMessage(sab)); +}, "SharedArrayBuffer over MessageChannel without COOP+COEP"); + +test(() => { + // See https://github.com/whatwg/html/issues/5380 for why not `new SharedArrayBuffer()` + const sab = new WebAssembly.Memory({ shared:true, initial:1, maximum:1 }).buffer; + const channel = new BroadcastChannel("Is mir egal"); + assert_throws_dom("DataCloneError", () => channel.postMessage(sab)); +}, "SharedArrayBuffer over BroadcastChannel without COOP+COEP"); + +if (self.GLOBAL.isWindow()) { + test(() => { + // See https://github.com/whatwg/html/issues/5380 for why not `new SharedArrayBuffer()` + const sab = new WebAssembly.Memory({ shared:true, initial:1, maximum:1 }).buffer; + assert_throws_dom("DataCloneError", () => self.postMessage(sab)); + }, "SharedArrayBuffer over postMessage() without COOP+COEP"); +} + +test(() => { + assert_false(self.crossOriginIsolated); +}, "Bonus: self.crossOriginIsolated"); diff --git a/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/no-transferring.https.html b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/no-transferring.https.html new file mode 100644 index 0000000000..dfa57fa200 --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/no-transferring.https.html @@ -0,0 +1,31 @@ + + +SharedArrayBuffers cannot be transferred + + + + + + diff --git a/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/no-transferring.https.html.headers b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/no-transferring.https.html.headers new file mode 100644 index 0000000000..63b60e490f --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/no-transferring.https.html.headers @@ -0,0 +1,2 @@ +Cross-Origin-Opener-Policy: same-origin +Cross-Origin-Embedder-Policy: require-corp diff --git a/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/blank.html b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/blank.html new file mode 100644 index 0000000000..eec1b2cc8e --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/blank.html @@ -0,0 +1,2 @@ + +Used as a service worker-controlled iframe diff --git a/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/blank.html.headers b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/blank.html.headers new file mode 100644 index 0000000000..6604450991 --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/blank.html.headers @@ -0,0 +1 @@ +Cross-Origin-Embedder-Policy: require-corp diff --git a/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/broadcastchannel-iframe.html b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/broadcastchannel-iframe.html new file mode 100644 index 0000000000..02b9bcbbe8 --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/broadcastchannel-iframe.html @@ -0,0 +1,22 @@ + + +A test page that messes with a given SharedArrayBuffer sent from a BroadcastChannel + + diff --git a/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/broadcastchannel-iframe.html.headers b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/broadcastchannel-iframe.html.headers new file mode 100644 index 0000000000..4e798cd9f5 --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/broadcastchannel-iframe.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/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/broadcastchannel-sharedworker.js b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/broadcastchannel-sharedworker.js new file mode 100644 index 0000000000..310e0e9358 --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/broadcastchannel-sharedworker.js @@ -0,0 +1,7 @@ +const channel = new BroadcastChannel("anne was here"); +channel.onmessageerror = ({ data }) => { + if(data === null) { + channel.postMessage("sw-success"); + } +} +channel.postMessage("hi"); diff --git a/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/broadcastchannel-sharedworker.js.headers b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/broadcastchannel-sharedworker.js.headers new file mode 100644 index 0000000000..6604450991 --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/broadcastchannel-sharedworker.js.headers @@ -0,0 +1 @@ +Cross-Origin-Embedder-Policy: require-corp diff --git a/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/broadcastchannel-worker.js b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/broadcastchannel-worker.js new file mode 100644 index 0000000000..36369cde50 --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/broadcastchannel-worker.js @@ -0,0 +1,9 @@ +const channel = new BroadcastChannel("anne was here"); +channel.onmessage = ({ data }) => { + if(data === "hi" || data === "sw-success") { + return; + } else if(data instanceof SharedArrayBuffer) { + channel.postMessage("dw-success"); + } +} +channel.postMessage("hi"); diff --git a/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/broadcastchannel-worker.js.headers b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/broadcastchannel-worker.js.headers new file mode 100644 index 0000000000..6604450991 --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/broadcastchannel-worker.js.headers @@ -0,0 +1 @@ +Cross-Origin-Embedder-Policy: require-corp diff --git a/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/iframe-domain-failure.sub.html b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/iframe-domain-failure.sub.html new file mode 100644 index 0000000000..0cdb8b5f59 --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/iframe-domain-failure.sub.html @@ -0,0 +1,14 @@ + + +A test page that postMessage a SharedArrayBuffer to the parent and also sets document.domain + + diff --git a/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/iframe-domain-failure.sub.html.headers b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/iframe-domain-failure.sub.html.headers new file mode 100644 index 0000000000..56d0ac3428 --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/iframe-domain-failure.sub.html.headers @@ -0,0 +1,2 @@ +Cross-Origin-Embedder-Policy: require-corp +Cross-Origin-Resource-Policy: same-site diff --git a/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/iframe-failure.html b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/iframe-failure.html new file mode 100644 index 0000000000..2c33dba79a --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/iframe-failure.html @@ -0,0 +1,3 @@ + diff --git a/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/iframe-failure.html.headers b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/iframe-failure.html.headers new file mode 100644 index 0000000000..4e798cd9f5 --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/iframe-failure.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/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/iframe-messagechannel-complex.html b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/iframe-messagechannel-complex.html new file mode 100644 index 0000000000..1666a98458 --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/iframe-messagechannel-complex.html @@ -0,0 +1,6 @@ + + diff --git a/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/iframe-messagechannel-complex.html.headers b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/iframe-messagechannel-complex.html.headers new file mode 100644 index 0000000000..4e798cd9f5 --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/iframe-messagechannel-complex.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/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/iframe-messagechannel-failure.html b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/iframe-messagechannel-failure.html new file mode 100644 index 0000000000..c6896762bc --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/iframe-messagechannel-failure.html @@ -0,0 +1,7 @@ + + diff --git a/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/iframe-messagechannel-failure.html.headers b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/iframe-messagechannel-failure.html.headers new file mode 100644 index 0000000000..4e798cd9f5 --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/iframe-messagechannel-failure.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/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/iframe-messagechannel-site-failure.html b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/iframe-messagechannel-site-failure.html new file mode 100644 index 0000000000..95a610f928 --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/iframe-messagechannel-site-failure.html @@ -0,0 +1,7 @@ + + diff --git a/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/iframe-messagechannel-site-failure.html.headers b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/iframe-messagechannel-site-failure.html.headers new file mode 100644 index 0000000000..56d0ac3428 --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/iframe-messagechannel-site-failure.html.headers @@ -0,0 +1,2 @@ +Cross-Origin-Embedder-Policy: require-corp +Cross-Origin-Resource-Policy: same-site diff --git a/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/incrementer-iframe-messagechannel.html b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/incrementer-iframe-messagechannel.html new file mode 100644 index 0000000000..6f3f284ae2 --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/incrementer-iframe-messagechannel.html @@ -0,0 +1,10 @@ + + +A test page that messes with a given SharedArrayBuffer via MessageChannel + + + diff --git a/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/incrementer-iframe-messagechannel.html.headers b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/incrementer-iframe-messagechannel.html.headers new file mode 100644 index 0000000000..4e798cd9f5 --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/incrementer-iframe-messagechannel.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/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/incrementer-iframe.html b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/incrementer-iframe.html new file mode 100644 index 0000000000..6f27ad7d5b --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/incrementer-iframe.html @@ -0,0 +1,10 @@ + + +A test page that messes with a given SharedArrayBuffer + + + diff --git a/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/incrementer-iframe.html.headers b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/incrementer-iframe.html.headers new file mode 100644 index 0000000000..4e798cd9f5 --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/incrementer-iframe.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/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/incrementer-popup.html b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/incrementer-popup.html new file mode 100644 index 0000000000..e583b5c416 --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/incrementer-popup.html @@ -0,0 +1,10 @@ + + +A test page that messes with a given SharedArrayBuffer + + + diff --git a/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/incrementer-popup.html.headers b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/incrementer-popup.html.headers new file mode 100644 index 0000000000..63b60e490f --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/incrementer-popup.html.headers @@ -0,0 +1,2 @@ +Cross-Origin-Opener-Policy: same-origin +Cross-Origin-Embedder-Policy: require-corp diff --git a/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/incrementer-worker-with-channel.js b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/incrementer-worker-with-channel.js new file mode 100644 index 0000000000..c74fd26d3f --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/incrementer-worker-with-channel.js @@ -0,0 +1,7 @@ +"use strict"; +importScripts("./test-incrementer.js"); + +self.onmessage = ({ data }) => { + // data will be a MessagePort + setupDestinationIncrementer(data, data); +}; diff --git a/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/incrementer-worker-with-channel.js.headers b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/incrementer-worker-with-channel.js.headers new file mode 100644 index 0000000000..6604450991 --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/incrementer-worker-with-channel.js.headers @@ -0,0 +1 @@ +Cross-Origin-Embedder-Policy: require-corp diff --git a/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/incrementer-worker.js b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/incrementer-worker.js new file mode 100644 index 0000000000..5801bd2b97 --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/incrementer-worker.js @@ -0,0 +1,4 @@ +"use strict"; +importScripts("./test-incrementer.js"); + +setupDestinationIncrementer(self, self); diff --git a/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/incrementer-worker.js.headers b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/incrementer-worker.js.headers new file mode 100644 index 0000000000..6604450991 --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/incrementer-worker.js.headers @@ -0,0 +1 @@ +Cross-Origin-Embedder-Policy: require-corp diff --git a/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/nested-iframe-1.html b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/nested-iframe-1.html new file mode 100644 index 0000000000..fe93cc0c4b --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/nested-iframe-1.html @@ -0,0 +1,5 @@ + + +Nesting level 1 + + diff --git a/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/nested-iframe-1.html.headers b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/nested-iframe-1.html.headers new file mode 100644 index 0000000000..4e798cd9f5 --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/nested-iframe-1.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/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/nested-iframe-2.html b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/nested-iframe-2.html new file mode 100644 index 0000000000..fad52ce9de --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/nested-iframe-2.html @@ -0,0 +1,5 @@ + + +Nesting level 2 + + diff --git a/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/nested-iframe-2.html.headers b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/nested-iframe-2.html.headers new file mode 100644 index 0000000000..4e798cd9f5 --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/nested-iframe-2.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/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/nested-iframe-3.html b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/nested-iframe-3.html new file mode 100644 index 0000000000..7971022b2c --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/nested-iframe-3.html @@ -0,0 +1,5 @@ + + +Nesting level 3 + + diff --git a/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/nested-iframe-3.html.headers b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/nested-iframe-3.html.headers new file mode 100644 index 0000000000..4e798cd9f5 --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/nested-iframe-3.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/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/nested-iframe-4-incrementer.html b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/nested-iframe-4-incrementer.html new file mode 100644 index 0000000000..d374515bdc --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/nested-iframe-4-incrementer.html @@ -0,0 +1,10 @@ + + +A test page that messes with a given SharedArrayBuffer, nested 4 levels deep in iframes + + + diff --git a/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/nested-iframe-4-incrementer.html.headers b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/nested-iframe-4-incrementer.html.headers new file mode 100644 index 0000000000..4e798cd9f5 --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/nested-iframe-4-incrementer.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/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/nested-worker-success.js b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/nested-worker-success.js new file mode 100644 index 0000000000..ffc3708acb --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/nested-worker-success.js @@ -0,0 +1,14 @@ +importScripts("/resources/testharness.js"); +importScripts("test-incrementer.js"); + +promise_test(t => { + const worker = new Worker("incrementer-worker.js"); + + return testSharingViaIncrementerScript(t, worker, "parent worker", worker, "sub-worker"); +}, "postMessaging to a dedicated sub-worker allows them to see each others' modifications"); + +test(() => { + assert_true(self.crossOriginIsolated); +}, "Bonus: self.crossOriginIsolated"); + +done(); diff --git a/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/nested-worker-success.js.headers b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/nested-worker-success.js.headers new file mode 100644 index 0000000000..6604450991 --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/nested-worker-success.js.headers @@ -0,0 +1 @@ +Cross-Origin-Embedder-Policy: require-corp diff --git a/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/serviceworker-failure.js b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/serviceworker-failure.js new file mode 100644 index 0000000000..4e8fba636c --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/serviceworker-failure.js @@ -0,0 +1,33 @@ +"use strict"; +self.importScripts("/resources/testharness.js"); + +let state = "start in worker"; + +self.onmessage = e => { + if (e.data === "start in window") { + assert_equals(state, "start in worker"); + e.source.postMessage(state); + state = "we are expecting a messageerror due to the window sending us a SAB"; + } else if (e.data === "we are expecting a messageerror due to the worker sending us a SAB") { + assert_equals(state, "onmessageerror was received in worker"); + e.source.postMessage(new SharedArrayBuffer()); + state = "done in worker"; + } else { + e.source.postMessage(`worker onmessage was reached when in state "${state}" and data ${e.data}`); + } +}; + +self.onmessageerror = e => { + if (state === "we are expecting a messageerror due to the window sending us a SAB") { + assert_equals(e.constructor.name, "ExtendableMessageEvent", "type"); + assert_equals(e.data, null, "data"); + assert_equals(e.origin, self.origin, "origin"); + assert_not_equals(e.source, null, "source"); + assert_equals(e.ports.length, 0, "ports length"); + + state = "onmessageerror was received in worker"; + e.source.postMessage(state); + } else { + e.source.postMessage(`worker onmessageerror was reached when in state "${state}" and data ${e.data}`); + } +}; diff --git a/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/serviceworker-failure.js.headers b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/serviceworker-failure.js.headers new file mode 100644 index 0000000000..6604450991 --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/serviceworker-failure.js.headers @@ -0,0 +1 @@ +Cross-Origin-Embedder-Policy: require-corp diff --git a/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/sharedworker-failure.js b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/sharedworker-failure.js new file mode 100644 index 0000000000..8472318abd --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/sharedworker-failure.js @@ -0,0 +1,18 @@ +let state = "send-sw-failure" +onconnect = initialE => { + let port = initialE.source; + port.postMessage(state) + port.onmessage = e => { + if(state === "" && e.data === "send-window-failure") { + port.postMessage(new SharedArrayBuffer()) + } else { + port.postMessage("failure") + } + } + port.onmessageerror = e => { + if(state === "send-sw-failure") { + port.postMessage("send-sw-failure-success") + state = "" + } + } +} diff --git a/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/sharedworker-failure.js.headers b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/sharedworker-failure.js.headers new file mode 100644 index 0000000000..6604450991 --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/sharedworker-failure.js.headers @@ -0,0 +1 @@ +Cross-Origin-Embedder-Policy: require-corp diff --git a/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/test-incrementer.js b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/test-incrementer.js new file mode 100644 index 0000000000..9c3fb813ae --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/test-incrementer.js @@ -0,0 +1,80 @@ +"use strict"; + +self.getViewValue = (view, index) => { + if(view instanceof DataView) { + return view.getInt8(index); + } + return view[index]; +}; + +self.setViewValue = (view, index, value) => { + if(view instanceof DataView) { + view.setInt8(index, value); + } else { + view[index] = value; + } +}; + +self.maybeBigInt = (view, value) => { + if (view.constructor.name === "BigInt64Array" || view.constructor.name === "BigUint64Array") { + return BigInt(value); + } + return value; +}; + +self.testSharingViaIncrementerScript = (t, whereToListen, whereToListenLabel, whereToSend, whereToSendLabel, origin, type = "Int32Array") => { + return new Promise(resolve => { + const sab = new SharedArrayBuffer(8); + const view = new self[type](sab); + setViewValue(view, 0, maybeBigInt(view, 1)); + + whereToListen.onmessage = t.step_func(({ data }) => { + switch (data.message) { + case "initial payload received": { + assert_equals(data.value, maybeBigInt(view, 1), `The ${whereToSendLabel} must see the same value in the SharedArrayBuffer`); + break; + } + + case "changed to 2": { + assert_equals(getViewValue(view, 0), maybeBigInt(view, 2), `The ${whereToListenLabel} must see changes made in the ${whereToSendLabel}`); + + setViewValue(view, 0, maybeBigInt(view, 3)); + whereToSend.postMessage({ message: "changed to 3" }, origin); + + break; + } + + case "changed to 3 received": { + assert_equals(data.value, maybeBigInt(view, 3), `The ${whereToSendLabel} must see changes made in the ${whereToListenLabel}`); + resolve(); + break; + } + } + }); + + whereToSend.postMessage({ message: "initial payload", view }, origin); + }); +}; + +self.setupDestinationIncrementer = (whereToListen, whereToSendBackTo, origin) => { + let view; + whereToListen.onmessage = ({ data }) => { + switch (data.message) { + case "initial payload": { + view = data.view; + whereToSendBackTo.postMessage({ message: "initial payload received", value: getViewValue(view, 0) }, origin); + + setViewValue(view, 0, maybeBigInt(view, 2)); + whereToSendBackTo.postMessage({ message: "changed to 2" }, origin); + + break; + } + + case "changed to 3": { + whereToSendBackTo.postMessage({ message: "changed to 3 received", value: getViewValue(view, 0) }, origin); + + break; + } + } + }; +}; diff --git a/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/test-sab.js b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/test-sab.js new file mode 100644 index 0000000000..6d6efda00d --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/resources/test-sab.js @@ -0,0 +1,15 @@ +"use strict"; + +self.assertSABsHaveSameBackingBlock = (originalSAB, clonedSAB) => { + const originalView = new Uint8Array(originalSAB); + const clonedView = new Uint8Array(clonedSAB); + + assert_not_equals(originalSAB, clonedSAB, "the clone must not be the same object"); + + assert_equals(originalView[0], 0, "originalView[0] starts 0"); + assert_equals(clonedView[0], 0, "clonedView[0] starts 0"); + + originalView[0] = 5; + assert_equals(originalView[0], 5, "originalView[0] ends up 5"); + assert_equals(clonedView[0], 5, "clonedView[0] ends up 5"); +}; diff --git a/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/serialization-via-history.https.html b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/serialization-via-history.https.html new file mode 100644 index 0000000000..28859f17cb --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/serialization-via-history.https.html @@ -0,0 +1,36 @@ + + +SharedArrayBuffers cloning via history's methods invoking StructuredSerializeForStorage + + + + + + + + diff --git a/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/serialization-via-history.https.html.headers b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/serialization-via-history.https.html.headers new file mode 100644 index 0000000000..63b60e490f --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/serialization-via-history.https.html.headers @@ -0,0 +1,2 @@ +Cross-Origin-Opener-Policy: same-origin +Cross-Origin-Embedder-Policy: require-corp diff --git a/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/serialization-via-idb.any.js b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/serialization-via-idb.any.js new file mode 100644 index 0000000000..e317b150cc --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/serialization-via-idb.any.js @@ -0,0 +1,44 @@ +// META: script=/IndexedDB/resources/support.js +"use strict"; + +async_test(t => { + const openReq = createdb(t); + + openReq.onupgradeneeded = e => { + const db = e.target.result; + const store = db.createObjectStore("store", { keyPath: "key" }); + // See https://github.com/whatwg/html/issues/5380 for why not `new SharedArrayBuffer()` + const sab = new WebAssembly.Memory({ shared:true, initial:1, maximum:1 }).buffer; + + assert_throws_dom("DataCloneError", () => { + store.put({ key: 1, property: sab }); + }); + t.done(); + }; +}, "SharedArrayBuffer cloning via IndexedDB: basic case"); + +async_test(t => { + const openReq = createdb(t); + + openReq.onupgradeneeded = e => { + const db = e.target.result; + const store = db.createObjectStore("store", { keyPath: "key" }); + // See https://github.com/whatwg/html/issues/5380 for why not `new SharedArrayBuffer()` + const sab = new WebAssembly.Memory({ shared:true, initial:1, maximum:1 }).buffer; + + let getter1Called = false; + let getter2Called = false; + + assert_throws_dom("DataCloneError", () => { + store.put({ key: 1, property: [ + { get x() { getter1Called = true; return 5; } }, + sab, + { get x() { getter2Called = true; return 5; } } + ]}); + }); + + assert_true(getter1Called, "The getter before the SAB must have been called"); + assert_false(getter2Called, "The getter after the SAB must not have been called"); + t.done(); + }; +}, "SharedArrayBuffer cloning via the IndexedDB: is interleaved correctly"); diff --git a/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/serialization-via-notifications-api.any.js b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/serialization-via-notifications-api.any.js new file mode 100644 index 0000000000..4c1c1fdabb --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/serialization-via-notifications-api.any.js @@ -0,0 +1,28 @@ +"use strict"; + +test(() => { + assert_throws_dom("DataCloneError", () => { + // See https://github.com/whatwg/html/issues/5380 for why not `new SharedArrayBuffer()` + const sab = new WebAssembly.Memory({ shared:true, initial:1, maximum:1 }).buffer; + new Notification("Bob: Hi", { data: sab }); + }) +}, "SharedArrayBuffer cloning via the Notifications API's data member: basic case"); + +test(() => { + // See https://github.com/whatwg/html/issues/5380 for why not `new SharedArrayBuffer()` + const sab = new WebAssembly.Memory({ shared:true, initial:1, maximum:1 }).buffer; + + let getter1Called = false; + let getter2Called = false; + + assert_throws_dom("DataCloneError", () => { + new Notification("Bob: Hi", { data: [ + { get x() { getter1Called = true; return 5; } }, + sab, + { get x() { getter2Called = true; return 5; } } + ]}); + }); + + assert_true(getter1Called, "The getter before the SAB must have been called"); + assert_false(getter2Called, "The getter after the SAB must not have been called"); +}, "SharedArrayBuffer cloning via the Notifications API's data member: is interleaved correctly"); diff --git a/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/window-domain-failure.https.sub.html b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/window-domain-failure.https.sub.html new file mode 100644 index 0000000000..6fa196e094 --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/window-domain-failure.https.sub.html @@ -0,0 +1,49 @@ + + +Structured cloning of SharedArrayBuffers into same-origin-domain windows + + + + + + diff --git a/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/window-domain-failure.https.sub.html.headers b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/window-domain-failure.https.sub.html.headers new file mode 100644 index 0000000000..63b60e490f --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/window-domain-failure.https.sub.html.headers @@ -0,0 +1,2 @@ +Cross-Origin-Opener-Policy: same-origin +Cross-Origin-Embedder-Policy: require-corp diff --git a/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/window-failure.https.html b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/window-failure.https.html new file mode 100644 index 0000000000..203a9f637f --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/window-failure.https.html @@ -0,0 +1,15 @@ + + + + +
+ diff --git a/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/window-failure.https.html.headers b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/window-failure.https.html.headers new file mode 100644 index 0000000000..63b60e490f --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/window-failure.https.html.headers @@ -0,0 +1,2 @@ +Cross-Origin-Opener-Policy: same-origin +Cross-Origin-Embedder-Policy: require-corp diff --git a/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/window-iframe-messagechannel.https.html b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/window-iframe-messagechannel.https.html new file mode 100644 index 0000000000..acef65cbdf --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/window-iframe-messagechannel.https.html @@ -0,0 +1,80 @@ + + +Structured cloning of SharedArrayBuffers into windows using MessageChannel + + + + + + +
+ + diff --git a/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/window-iframe-messagechannel.https.html.headers b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/window-iframe-messagechannel.https.html.headers new file mode 100644 index 0000000000..63b60e490f --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/window-iframe-messagechannel.https.html.headers @@ -0,0 +1,2 @@ +Cross-Origin-Opener-Policy: same-origin +Cross-Origin-Embedder-Policy: require-corp diff --git a/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/window-messagechannel-success.https.html b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/window-messagechannel-success.https.html new file mode 100644 index 0000000000..cd67e5b2c9 --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/window-messagechannel-success.https.html @@ -0,0 +1,22 @@ + + +Structured cloning of SharedArrayBuffers using MessageChannel + + + + + + +
+ + diff --git a/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/window-messagechannel-success.https.html.headers b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/window-messagechannel-success.https.html.headers new file mode 100644 index 0000000000..63b60e490f --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/window-messagechannel-success.https.html.headers @@ -0,0 +1,2 @@ +Cross-Origin-Opener-Policy: same-origin +Cross-Origin-Embedder-Policy: require-corp diff --git a/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/window-serviceworker-failure.https.html b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/window-serviceworker-failure.https.html new file mode 100644 index 0000000000..373359de85 --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/window-serviceworker-failure.https.html @@ -0,0 +1,56 @@ + + +SharedArrayBuffer cannot cross agent clusters, service worker edition + + + + + + + diff --git a/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/window-serviceworker-failure.https.html.headers b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/window-serviceworker-failure.https.html.headers new file mode 100644 index 0000000000..63b60e490f --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/window-serviceworker-failure.https.html.headers @@ -0,0 +1,2 @@ +Cross-Origin-Opener-Policy: same-origin +Cross-Origin-Embedder-Policy: require-corp diff --git a/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/window-sharedworker-failure.https.html b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/window-sharedworker-failure.https.html new file mode 100644 index 0000000000..023cb5acde --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/window-sharedworker-failure.https.html @@ -0,0 +1,31 @@ + +SharedArrayBuffer cannot cross agent clusters, shared worker edition + + + diff --git a/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/window-sharedworker-failure.https.html.headers b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/window-sharedworker-failure.https.html.headers new file mode 100644 index 0000000000..63b60e490f --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/window-sharedworker-failure.https.html.headers @@ -0,0 +1,2 @@ +Cross-Origin-Opener-Policy: same-origin +Cross-Origin-Embedder-Policy: require-corp diff --git a/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/window-simple-success.https.html b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/window-simple-success.https.html new file mode 100644 index 0000000000..c9b41d0a0d --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/window-simple-success.https.html @@ -0,0 +1,72 @@ + + +Structured cloning of SharedArrayBuffers: simple success cases that don't need dedicated files + + + + + + +
+ + diff --git a/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/window-simple-success.https.html.headers b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/window-simple-success.https.html.headers new file mode 100644 index 0000000000..63b60e490f --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/window-simple-success.https.html.headers @@ -0,0 +1,2 @@ +Cross-Origin-Opener-Policy: same-origin +Cross-Origin-Embedder-Policy: require-corp diff --git a/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/structured-cloning-error-extra.html b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/structured-cloning-error-extra.html new file mode 100644 index 0000000000..5ff10cbc10 --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/structured-cloning-error-extra.html @@ -0,0 +1,46 @@ + + +Structured cloning of Error objects: extra tests + + + + + + + + diff --git a/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/structured-cloning-error-stack-optional.sub.window.js b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/structured-cloning-error-stack-optional.sub.window.js new file mode 100644 index 0000000000..cbc6a73d51 --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/structured-cloning-error-stack-optional.sub.window.js @@ -0,0 +1,106 @@ +// META: script=/common/utils.js + +// .stack properties on errors are unspecified, but are present in most +// browsers, most of the time. https://github.com/tc39/proposal-error-stacks/ tracks standardizing them. +// Tests will pass automatically if the .stack property isn't present. + +stackTests(() => { + return new Error('some message'); +}, 'page-created Error'); + +stackTests(() => { + return new DOMException('InvalidStateError', 'some message'); +}, 'page-created DOMException'); + +stackTests(() => { + try { + Object.defineProperty(); + } catch (e) { + return e; + } +}, 'JS-engine-created TypeError'); + +stackTests(() => { + try { + HTMLParagraphElement.prototype.align; + } catch (e) { + return e; + } +}, 'web API-created TypeError'); + +stackTests(() => { + try { + document.createElement(''); + } catch (e) { + return e; + } +}, 'web API-created DOMException'); + +function stackTests(errorFactory, description) { + test(t => { + const error = errorFactory(); + const originalStack = error.stack; + + if (!originalStack) { + return; + } + + const clonedError = structuredClone(error); + assert_equals(clonedError.stack, originalStack); + }, description + ' (structuredClone())'); + + async_test(t => { + const error = errorFactory(); + const originalStack = error.stack; + + if (!originalStack) { + t.done(); + return; + } + + const worker = new Worker('resources/echo-worker.js'); + worker.onmessage = t.step_func_done(e => { + assert_equals(e.data.stack, originalStack); + }); + + worker.postMessage(error); + }, description + ' (worker)'); + + let iframeTest = (t, url) => { + const thisTestId = token(); + + const error = errorFactory(); + const originalStack = error.stack; + + if (!originalStack) { + t.done(); + return; + } + + const iframe = document.createElement('iframe'); + window.addEventListener('message', t.step_func(e => { + if (e.data.testId === thisTestId) { + assert_equals(e.data.error.stack, originalStack); + t.done(); + } + })); + + iframe.onload = t.step_func(() => { + iframe.contentWindow.postMessage({ error, testId: thisTestId }, "*"); + }); + + iframe.src = url; + document.body.append(iframe); + } + + async_test(t => { + const crossSiteURL = new URL('resources/echo-iframe.html', location.href); + crossSiteURL.hostname = '{{hosts[alt][www1]}}'; + iframeTest(t, crossSiteURL); + }, description + ' (cross-site iframe)'); + + async_test(t => { + const sameOriginURL = new URL('resources/echo-iframe.html', location.href); + iframeTest(t, sameOriginURL); + }, description + ' (same-origin iframe)') +} diff --git a/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/structuredclone_0.html b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/structuredclone_0.html new file mode 100644 index 0000000000..c8a6d38393 --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/structuredclone_0.html @@ -0,0 +1,637 @@ + + + + + 2.8 Common DOM interfaces - Structured Clone Algorithm + + + + + +
+ + + + + diff --git a/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/transfer-errors.window.js b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/transfer-errors.window.js new file mode 100644 index 0000000000..b3ecd86b40 --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/transfer-errors.window.js @@ -0,0 +1,47 @@ +function assert_transfer_error(transferList) { + assert_throws_dom("DataCloneError", () => self.postMessage({ get whatever() { throw new Error("You should not have gotten to this point") } }, "*", transferList)); +} + +test(() => { + [self, self.document, new Image()].forEach(val => { + assert_transfer_error([val]); + }); +}, "Cannot transfer all objects"); + +function transfer_tests(name, create) { + promise_test(async () => { + const transferable = await create(); + assert_transfer_error([transferable, transferable]); + }, `Cannot transfer the same ${name} twice`); + + promise_test(async () => { + const transferable = await create(); + self.postMessage(null, "*", [transferable]); + assert_throws_dom("DataCloneError", () => self.postMessage(null, "*", [transferable])); + }, `Serialize should make the ${name} detached, so it cannot be transferred again`); + + promise_test(async () => { + const transferable = await create(), + customError = new Error("hi"); + self.postMessage(null, "*", [transferable]); + assert_throws_exactly(customError, () => self.postMessage({ get whatever() { throw customError } }, "*", [transferable])); + }, `Serialize should throw before a detached ${name} is found`); + + promise_test(async () => { + const transferable = await create(); + let seen = false; + const message = { + get a() { + self.postMessage(null, '*', [transferable]); + seen = true; + } + }; + assert_throws_dom("DataCloneError", () => self.postMessage(message, "*", [transferable])); + assert_true(seen); + }, `Cannot transfer ${name} detached while the message was serialized`); +} + +transfer_tests("ArrayBuffer", () => new ArrayBuffer(1)); +transfer_tests("MessagePort", () => new MessageChannel().port1); +transfer_tests("ImageBitmap", () => self.createImageBitmap(document.createElement("canvas"))); +transfer_tests("OffscreenCanvas", () => new OffscreenCanvas(1, 1)); diff --git a/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/window-postmessage.window.js b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/window-postmessage.window.js new file mode 100644 index 0000000000..2a46d790b8 --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/window-postmessage.window.js @@ -0,0 +1,16 @@ +// META: script=/common/sab.js +// META: script=/html/webappapis/structured-clone/structured-clone-battery-of-tests.js +// META: script=/html/webappapis/structured-clone/structured-clone-battery-of-tests-with-transferables.js +// META: script=/html/webappapis/structured-clone/structured-clone-battery-of-tests-harness.js + +runStructuredCloneBatteryOfTests({ + structuredClone(data, transfer) { + return new Promise(resolve => { + window.addEventListener('message', function f(ev) { + window.removeEventListener('message', f); + resolve(ev.data.data); + }); + window.postMessage({data, transfer}, "/", transfer); + }); + } +}); diff --git a/testing/web-platform/tests/html/infrastructure/terminology/plugins/sample.txt b/testing/web-platform/tests/html/infrastructure/terminology/plugins/sample.txt new file mode 100644 index 0000000000..cedecd6d88 --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/terminology/plugins/sample.txt @@ -0,0 +1,3 @@ +This is a sample text/plain document. + +This is not an HTML document. diff --git a/testing/web-platform/tests/html/infrastructure/terminology/plugins/text-plain.html b/testing/web-platform/tests/html/infrastructure/terminology/plugins/text-plain.html new file mode 100644 index 0000000000..0ed0ce23b8 --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/terminology/plugins/text-plain.html @@ -0,0 +1,32 @@ + + + + + Media Types + + + + + + + + + +

Test of plugin support

+

A user agent must not consider the types text/plain and application/octet-stream as having a registered plugin.

+ + + + +
Running test...
+ + + diff --git a/testing/web-platform/tests/html/infrastructure/urls/base-url/document-base-url-changes-about-srcdoc-2.https.html b/testing/web-platform/tests/html/infrastructure/urls/base-url/document-base-url-changes-about-srcdoc-2.https.html new file mode 100644 index 0000000000..eac1eaf7d0 --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/urls/base-url/document-base-url-changes-about-srcdoc-2.https.html @@ -0,0 +1,57 @@ + + + + + + + + diff --git a/testing/web-platform/tests/html/infrastructure/urls/dynamic-changes-to-base-urls/dynamic-urls.sub.html b/testing/web-platform/tests/html/infrastructure/urls/dynamic-changes-to-base-urls/dynamic-urls.sub.html new file mode 100644 index 0000000000..ce65f392d6 --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/urls/dynamic-changes-to-base-urls/dynamic-urls.sub.html @@ -0,0 +1,41 @@ + + +HTML Test: Dynamic changes to base URLs + + + + + + + + diff --git a/testing/web-platform/tests/html/infrastructure/urls/dynamic-changes-to-base-urls/historical.sub.xhtml b/testing/web-platform/tests/html/infrastructure/urls/dynamic-changes-to-base-urls/historical.sub.xhtml new file mode 100644 index 0000000000..1be7a7cf2c --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/urls/dynamic-changes-to-base-urls/historical.sub.xhtml @@ -0,0 +1,59 @@ + + + + + Historical xml:base must be removed + + + + + + +
+ + + + diff --git a/testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/attributes.sub.html b/testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/attributes.sub.html new file mode 100644 index 0000000000..d596f37716 --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/attributes.sub.html @@ -0,0 +1,67 @@ + + + + + + + + + + +
+ diff --git a/testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/location.sub.html b/testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/location.sub.html new file mode 100644 index 0000000000..1403cf18cd --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/location.sub.html @@ -0,0 +1,46 @@ + + + + + + + +
+ diff --git a/testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/lone-surrogates.sub.html b/testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/lone-surrogates.sub.html new file mode 100644 index 0000000000..e47ab0f310 --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/lone-surrogates.sub.html @@ -0,0 +1,30 @@ + + + + + + +
+ diff --git a/testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/navigation.sub.html b/testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/navigation.sub.html new file mode 100644 index 0000000000..7808434f05 --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/navigation.sub.html @@ -0,0 +1,162 @@ + + + + + + + + + + + +
+ diff --git a/testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/resources/blank.py b/testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/resources/blank.py new file mode 100644 index 0000000000..bbd269d170 --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/resources/blank.py @@ -0,0 +1,2 @@ +def main(request, response): + return [(b"Content-Type", b"text/html; charset=%s" % (request.GET[b'encoding']))], u"" diff --git a/testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/resources/css-tmpl.py b/testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/resources/css-tmpl.py new file mode 100644 index 0000000000..673b2fca32 --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/resources/css-tmpl.py @@ -0,0 +1,7 @@ +from wptserve.utils import isomorphic_decode + +def main(request, response): + encoding = request.GET[b'encoding'] + tmpl = request.GET[b'tmpl'] + sheet = isomorphic_decode(tmpl) % u'\\0000E5' + return [(b"Content-Type", b"text/css; charset=%s" % encoding)], sheet.encode(isomorphic_decode(encoding)) diff --git a/testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/resources/resolve-url.js b/testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/resources/resolve-url.js new file mode 100644 index 0000000000..f654a894b9 --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/resources/resolve-url.js @@ -0,0 +1,719 @@ +// NOTE: this file needs to be split up rather than expanded. See ../location.sub.html for some +// extracted tests. Tracked by https://github.com/web-platform-tests/wpt/issues/4934. + +/* +* help: +* https://html.spec.whatwg.org/multipage/#the-link-element +* https://html.spec.whatwg.org/multipage/#styling +* https://html.spec.whatwg.org/multipage/#prepare-a-script +* https://html.spec.whatwg.org/multipage/#concept-media-load-algorithm +* https://html.spec.whatwg.org/multipage/#track-url +* https://html.spec.whatwg.org/multipage/#concept-form-submit +* https://html.spec.whatwg.org/multipage/#set-the-frozen-base-url +* https://dom.spec.whatwg.org/#dom-node-baseuri +* https://html.spec.whatwg.org/multipage/#the-a-element +* https://html.spec.whatwg.org/multipage/#dom-worker +* https://html.spec.whatwg.org/multipage/#dom-sharedworker +* https://html.spec.whatwg.org/multipage/#dom-eventsource +* https://html.spec.whatwg.org/multipage/#dom-xmldocument-load +* https://html.spec.whatwg.org/multipage/#dom-open +* http://url.spec.whatwg.org/#dom-url-search +* https://www.w3.org/Bugs/Public/show_bug.cgi?id=24148 +* https://xhr.spec.whatwg.org/#the-open()-method +* https://html.spec.whatwg.org/multipage/#set-up-a-worker-script-settings-object +* https://html.spec.whatwg.org/multipage/#dom-workerglobalscope-importscripts +* https://html.spec.whatwg.org/multipage/#parse-a-websocket-url's-components +* https://html.spec.whatwg.org/multipage/#dom-websocket-url +* https://www.w3.org/Bugs/Public/show_bug.cgi?id=23968 +* http://dev.w3.org/csswg/cssom/#requirements-on-user-agents-implementing-the-xml-stylesheet-processing-instruction +* http://url.spec.whatwg.org/#dom-url +*/ +setup({explicit_done:true}); +onload = function() { + var encoding = '{{GET[encoding]}}'; + var input_url = 'resources/resource.py?q=\u00E5&encoding=' + encoding + '&type='; + ('html css js worker sharedworker worker_importScripts sharedworker_importScripts worker_worker worker_sharedworker sharedworker_worker '+ + 'sharedworker_sharedworker eventstream png svg xmlstylesheet_css video webvtt').split(' ').forEach(function(str) { + window['input_url_'+str] = input_url + str; + }); + var blank = 'resources/blank.py?encoding=' + encoding; + var stash_put = 'resources/stash.py?q=\u00E5&action=put&id='; + var stash_take = 'resources/stash.py?action=take&id='; + var expected_obj = { + 'utf-8':'%C3%A5', + 'utf-16be':'%C3%A5', + 'utf-16le':'%C3%A5', + 'windows-1252':'%E5', + 'windows-1251':'%26%23229%3B' + }; + var expected_current = expected_obj[encoding]; + var expected_utf8 = expected_obj['utf-8']; + + function msg(expected, got) { + return 'expected substring '+expected+' got '+got; + } + + function poll_for_stash(test_obj, uuid, expected) { + var start = new Date(); + var poll = test_obj.step_func(function () { + var xhr = new XMLHttpRequest(); + xhr.open('GET', stash_take + uuid); + xhr.onload = test_obj.step_func(function(e) { + if (xhr.response == "") { + if (new Date() - start > 10000) { + // If we set the status to TIMEOUT here we avoid a race between the + // page and the test timing out + test_obj.force_timeout(); + } + test_obj.step_timeout(poll, 200); + } else { + assert_equals(xhr.response, expected); + test_obj.done(); + } + }); + xhr.send(); + }) + test_obj.step_timeout(poll, 200); + } + + // loading html (or actually svg to support ) + function test_load_nested_browsing_context(tag, attr, spec_url) { + subsetTestByKey('nested-browsing', async_test, function() { + var id = 'test_load_nested_browsing_context_'+tag; + var elm = document.createElement(tag); + elm.setAttribute(attr, input_url_svg); + elm.name = id; + document.body.appendChild(elm); + this.add_cleanup(function() { + document.body.removeChild(elm); + }); + elm.onload = this.step_func_done(function() { + assert_equals(window[id].document.documentElement.textContent, expected_current); + }); + + }, 'load nested browsing context <'+tag+' '+attr+'>'); + } + + spec_url_load_nested_browsing_context = { + frame:'https://html.spec.whatwg.org/multipage/#process-the-frame-attributes', + iframe:'https://html.spec.whatwg.org/multipage/#process-the-iframe-attributes', + object:'https://html.spec.whatwg.org/multipage/#the-object-element', + embed:'https://html.spec.whatwg.org/multipage/#the-embed-element-setup-steps' + }; + + 'frame src, iframe src, object data, embed src'.split(', ').forEach(function(str) { + var arr = str.split(' '); + test_load_nested_browsing_context(arr[0], arr[1], spec_url_load_nested_browsing_context[arr[0]]); + }); + + // loading css with + subsetTestByKey('loading', async_test, function() { + var elm = document.createElement('link'); + elm.href = input_url_css; + elm.rel = 'stylesheet'; + document.head.appendChild(elm); + this.add_cleanup(function() { + document.head.removeChild(elm); + }); + elm.onload = this.step_func_done(function() { + var got = elm.sheet.href; + assert_true(elm.sheet.href.indexOf(expected_current) > -1, 'sheet.href ' + msg(expected_current, got)); + assert_equals(elm.sheet.cssRules[0].style.content, '"'+expected_current+'"', 'sheet.cssRules[0].style.content'); + }); + }, 'loading css '); + + // loading js + subsetTestByKey('loading-css', async_test, function() { + var elm = document.createElement('script'); + elm.src = input_url_js + '&var=test_load_js_got'; + document.head.appendChild(elm); // no cleanup + elm.onload = this.step_func_done(function() { + assert_equals(window.test_load_js_got, expected_current); + }); + }, 'loading js + + + +
+ diff --git a/testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/windows-1251.html b/testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/windows-1251.html new file mode 100644 index 0000000000..dbf136706e --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/windows-1251.html @@ -0,0 +1,26 @@ + + +Resolving URLs, URL character encoding, windows-1251 + + + + + + + + + + + + + + + + + + + + + +
+ diff --git a/testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/windows-1252.html b/testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/windows-1252.html new file mode 100644 index 0000000000..43b7dc9ea4 --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/urls/resolving-urls/query-encoding/windows-1252.html @@ -0,0 +1,26 @@ + + +Resolving URLs, URL character encoding, windows-1252 + + + + + + + + + + + + + + + + + + + + + +
+ diff --git a/testing/web-platform/tests/html/infrastructure/urls/terminology-0/document-base-url-about-srcdoc.https.window.js b/testing/web-platform/tests/html/infrastructure/urls/terminology-0/document-base-url-about-srcdoc.https.window.js new file mode 100644 index 0000000000..b8fad36ccf --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/urls/terminology-0/document-base-url-about-srcdoc.https.window.js @@ -0,0 +1,27 @@ +// META: script=/common/get-host-info.sub.js + +// Load about:srcdoc in a sandboxed iframe. Check the document.baseURI is +// correct. +const runTest = (description, iframe_sandbox) => { + promise_test(async test => { + const iframe = document.createElement("iframe"); + iframe.sandbox = iframe_sandbox; + iframe.srcdoc = ` + + + + +
+ + diff --git a/testing/web-platform/tests/html/infrastructure/urls/terminology-0/multiple-base.sub.html b/testing/web-platform/tests/html/infrastructure/urls/terminology-0/multiple-base.sub.html new file mode 100644 index 0000000000..49c428c5be --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/urls/terminology-0/multiple-base.sub.html @@ -0,0 +1,17 @@ + + +document base URL: multiple base elements + + + + + + + +
+ diff --git a/testing/web-platform/tests/html/infrastructure/urls/terminology-0/resources/send-back-base-url.html b/testing/web-platform/tests/html/infrastructure/urls/terminology-0/resources/send-back-base-url.html new file mode 100644 index 0000000000..6fdf81d1db --- /dev/null +++ b/testing/web-platform/tests/html/infrastructure/urls/terminology-0/resources/send-back-base-url.html @@ -0,0 +1,8 @@ + + -- cgit v1.2.3