From 120a1436ad7faa341046e4b31917f2f0fb24c0b2 Mon Sep 17 00:00:00 2001 From: Yoshi Cheng-Hao Huang Date: Mon, 25 Sep 2023 14:37:01 +0000 Subject: [PATCH] Bug 1831583 - Part 4: Mark [Static import (redirect).] failed as expected in dedicated-worker-import-data-url.any.js and shared-worker-import-data-url.window.js. r=dom-worker-reviewers,asuth In this test, The worker will load a data URI, which import another test script statically, and the imported script will import 'export-on-load-script.js', which will be served with the CORS header 'Access-Control-Allow-Origin: *' in /workers/modules/resources/export-on-load-script.js.headers In the test case [Static import (redirect).], 'export-on-load-script.js' will be redirected, and the redirected script doesn't have the CORS header. According the current spec, the redirected 'export-on-load-script.js' is in the same-origin with the document, therefore it should be loaded. But with Gecko's implementation, the redirected script "export-on-load-script.js" is cross-origin with the main worker script (which is loaded by data URI), so the script is blocked. (The first test case, which tests static import without redirect, the script 'export-on-load-script.js' could be loaded by Gecko because the script has the CORS header.) Mark this test case as failed according to the spec issue https://github.com/whatwg/html/issues/9571 Differential Revision: https://phabricator.services.mozilla.com/D187901 --- .../modules/dedicated-worker-import-data-url.any.js.ini | 9 +++++++++ .../modules/shared-worker-import-data-url.window.js.ini | 4 ++++ 2 files changed, 13 insertions(+) create mode 100644 testing/web-platform/meta/workers/modules/dedicated-worker-import-data-url.any.js.ini create mode 100644 testing/web-platform/meta/workers/modules/shared-worker-import-data-url.window.js.ini diff --git a/testing/web-platform/meta/workers/modules/dedicated-worker-import-data-url.any.js.ini b/testing/web-platform/meta/workers/modules/dedicated-worker-import-data-url.any.js.ini new file mode 100644 index 0000000000000..968239b5428fa --- /dev/null +++ b/testing/web-platform/meta/workers/modules/dedicated-worker-import-data-url.any.js.ini @@ -0,0 +1,9 @@ +[dedicated-worker-import-data-url.any.html] + [Static import (redirect).] + bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1841363 + expected: FAIL + +[dedicated-worker-import-data-url.any.worker.html] + [Static import (redirect).] + bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1841363 + expected: FAIL diff --git a/testing/web-platform/meta/workers/modules/shared-worker-import-data-url.window.js.ini b/testing/web-platform/meta/workers/modules/shared-worker-import-data-url.window.js.ini new file mode 100644 index 0000000000000..a921b647e49fd --- /dev/null +++ b/testing/web-platform/meta/workers/modules/shared-worker-import-data-url.window.js.ini @@ -0,0 +1,4 @@ +[shared-worker-import-data-url.window.html] + [Static import (redirect).] + bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1841363 + expected: FAIL