Closed Bug 1847548 Opened 1 year ago Closed 1 year ago

Worker's dynamic import scripts should have different content policy types than worker's static import scripts.

Categories

(Core :: DOM: Workers, defect)

defect

Tracking

()

RESOLVED FIXED
118 Branch
Tracking Status
firefox118 --- fixed

People

(Reporter: allstars.chh, Assigned: allstars.chh)

References

(Blocks 1 open bug)

Details

Attachments

(3 files, 2 obsolete files)

Currently worker's dynamic import scripts are using the the content policy type nsIContentPolicy::TYPE_INTERNAL_WORKER_STATIC_MODULE, which is wrong.

For dynamic import, its destination is "script".
See https://html.spec.whatwg.org/multipage/webappapis.html#hostloadimportedmodule,
step 10.
Let destination be "script".

According to the destination table in HTML spec.
https://fetch.spec.whatwg.org/#destination-table
We can reuse the existing content policy type TYPE_INTERNAL_WORKER_IMPORT_SCRIPTS
for worker's dynamic import scripts, without creating a new one for it.

Attachment #9347686 - Attachment description: Bug 1847548 - Use nsIContentPolicy::TYPE_INTERNAL_WORKER_IMPORT_SCRIPTS for worker's dynamic import scripts. → Bug 1847548 - Part 1: Use nsIContentPolicy::TYPE_INTERNAL_WORKER_IMPORT_SCRIPTS for worker's dynamic import scripts.
Severity: -- → S3
Attachment #9347686 - Attachment description: Bug 1847548 - Part 1: Use nsIContentPolicy::TYPE_INTERNAL_WORKER_IMPORT_SCRIPTS for worker's dynamic import scripts. → Bug 1847548 - Part 2: Use nsIContentPolicy::TYPE_INTERNAL_WORKER_DYNAMIC_IMPORT_SCRIPT for worker's dynamic import scripts.
Attachment #9347699 - Attachment description: Bug 1847548 - Part 2: Update ini files in WPT/. → Bug 1847548 - Part 4: Update ini files in WPT/.
Attachment #9347686 - Attachment description: Bug 1847548 - Part 2: Use nsIContentPolicy::TYPE_INTERNAL_WORKER_DYNAMIC_IMPORT_SCRIPT for worker's dynamic import scripts. → Bug 1847548 - Part 2: Use nsIContentPolicy::TYPE_INTERNAL_MODULE for worker's dynamic import scripts.
Attachment #9348195 - Attachment is obsolete: true
Attachment #9348808 - Attachment is obsolete: true
Attachment #9347686 - Attachment description: Bug 1847548 - Part 2: Use nsIContentPolicy::TYPE_INTERNAL_MODULE for worker's dynamic import scripts. → Bug 1847548 - Part 1: Use nsIContentPolicy::TYPE_INTERNAL_MODULE for worker's dynamic import scripts.
Attachment #9348196 - Attachment description: Bug 1847548 - Part 3: Add a CSP test 'script-src-elem' for worker's static import and dynamic import. → Bug 1847548 - Part 2: Add a CSP test 'script-src-elem' for worker's static import and dynamic import.
Attachment #9347699 - Attachment description: Bug 1847548 - Part 4: Update ini files in WPT/. → Bug 1847548 - Part 3: Update ini files in WPT/.
Pushed by allstars.chh@gmail.com: https://hg.mozilla.org/integration/autoland/rev/cfb6d2f457db Part 1: Use nsIContentPolicy::TYPE_INTERNAL_MODULE for worker's dynamic import scripts. r=dom-worker-reviewers,smaug,evilpie https://hg.mozilla.org/integration/autoland/rev/c2b0f04c34d3 Part 2: Add a CSP test 'script-src-elem' for worker's static import and dynamic import. r=evilpie,dom-worker-reviewers,smaug https://hg.mozilla.org/integration/autoland/rev/a229f36ddd39 Part 3: Update ini files in WPT/. r=dom-worker-reviewers,smaug
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/41466 for changes under testing/web-platform/tests
Upstream PR merged by moz-wptsync-bot
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: