Skip to content

Commit

Permalink
Bug 1831583 - Part 4: Mark [Static import (redirect).] failed as expe…
Browse files Browse the repository at this point in the history
…cted 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
whatwg/html#9571

Differential Revision: https://phabricator.services.mozilla.com/D187901
  • Loading branch information
allstarschh committed Sep 25, 2023
1 parent f77dbae commit e13d6a3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit e13d6a3

Please sign in to comment.