Commit Graph
221 Commits
Author SHA1 Message Date
Tooru Fujisawa b1578b8a63 Bug 2036849 - Part 8: Rewrite the IsTextSource and IsSerializedStencil accessors for the ScriptLoadRequest to avoid accidental use after converting to cache. r=nbp,dom-worker-reviewers,asuth
LoadedScript::{IsTextSource,IsSerializedStencil} accessors can return
false once it's converted to cache.
Most of the consumers need the flag to branch on the server response, before
converting to cache.
Add assertions to avoid accidental use.

Differential Revision: https://phabricator.services.mozilla.com/D299926
2026-05-13 17:09:56 +00:00
Tooru Fujisawa 5026dda743 Bug 2036849 - Part 3: Use ScriptLoadRequest::IsRetrievedFromMemoryCache. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D299921
2026-05-13 17:09:37 +00:00
Daniel Minor e2dc2fbb79 Bug 1997621 - Support source phase wasm modules in loaders; r=arai,dom-worker-reviewers,edenchuang
Differential Revision: https://phabricator.services.mozilla.com/D297114
2026-05-12 21:08:23 +00:00
Norisz Fay 712f2f9edd Revert "Bug 1997621 - Update esm-integration wpt expectations; r=arai" for causing SM bustages @ import-source-static.js
This reverts commit 8435ccfec7.

Revert "Bug 1997621 - Change prefs from "startup" to "always"; r=arai"

This reverts commit 19b31608e1.

Revert "Bug 1997621 - Support source phase wasm modules in loaders; r=arai,dom-worker-reviewers,edenchuang"

This reverts commit b8b734ea4b.

Revert "Bug 1997621 - Allow workers to retrieve wasm modules; r=necko-reviewers,arai,valentin"

This reverts commit a623893c43.

Revert "Bug 1997621 - Prevent evaluation phase after source phase import; r=arai"

This reverts commit 941767f9ef.

Revert "Bug 1997621 - Don't cache wasm modules in ModuleLoaderBase; r=arai"

This reverts commit 953057b81b.

Revert "Bug 1997621 - Add ModuleRequestIsSourcePhase; r=arai"

This reverts commit 70e6b7479b.

Revert "Bug 1997621 - Support wasm modules in the shell; r=arai"

This reverts commit fd03655ae8.

Revert "Bug 1997621 - Use wasm module for test262 "<module source>"; r=arai"

This reverts commit 29ab548ec9.

Revert "Bug 1997621 - Implement JS::CompileWasmModuleAsSource; r=arai"

This reverts commit 01acf41334.

Revert "Bug 1997621 - Store Objects in ModuleSourceSlot; r=arai"

This reverts commit a60cf7949a.

Revert "Bug 1997621 - Add ModuleObject::createWasmEnvironment; r=arai"

This reverts commit 8894435bd0.

Revert "Bug 1997621 - Add ScriptSourceObject::createForWasmModule; r=arai"

This reverts commit fe8a2fad38.

Revert "Bug 1997621 - Add wasm::CompileForESM; r=rhunt"

This reverts commit 51a048d461.

Revert "Bug 1997621 - Make WebAssembly.Module inherit from AbstractModuleSource; r=rhunt"

This reverts commit 9b7b168843.
2026-05-12 00:39:14 +00:00
Daniel Minor b8b734ea4b Bug 1997621 - Support source phase wasm modules in loaders; r=arai,dom-worker-reviewers,edenchuang
Differential Revision: https://phabricator.services.mozilla.com/D297114
2026-05-11 23:54:37 +00:00
Tooru Fujisawa 036a4bf280 Bug 2038623 - Do not borrow the buffer for decoded stencils if the in-memory cache is enabled. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D299700
2026-05-11 15:33:20 +00:00
Eemeli Aro 4964c65265 Bug 2024854 Part 10 - Create text modules: script. r=dminor
Differential Revision: https://phabricator.services.mozilla.com/D295495
2026-05-06 07:24:21 +00:00
Tooru Fujisawa 32c2970f79 Bug 2036042 - Handle invalidated cached stencil also as cached case. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D297796
2026-05-04 18:20:20 +00:00
rperta c1b532f543 Revert "Bug 2024854 Part 15 - Fix and enable import-text WPT tests. r=dminor" for causing python-telemetry failures
This reverts commit cdddcc0cff.

This reverts commit d818e0fa08.

This reverts commit 7fe31f22c7.

This reverts commit 9d5be194ed.

This reverts commit e0fba2c9ac.

Revert "Bug 2024854 Part 10 - Create text modules: script. r=dminor"

This reverts commit dd57815041.

This reverts commit 409b1063aa.

This reverts commit cd7afbc8ee.

This reverts commit 03b66bc4f0.

This reverts commit c1b7e2177a.

This reverts commit 4696b1602f.

This reverts commit 21f4777b22.

This reverts commit 00eab305c3.

This reverts commit 10d0e76a4f.

This reverts commit e1746ab8a2.
2026-04-29 20:12:13 +00:00
Eemeli Aro dd57815041 Bug 2024854 Part 10 - Create text modules: script. r=dminor
Differential Revision: https://phabricator.services.mozilla.com/D295495
2026-04-29 19:52:11 +00:00
Tooru Fujisawa d6cfc25827 Bug 2031078 - Part 1: Hold scripts and modules while collecting delazifications. r=bthrall,mccr8
In order to stop collecting delazifications, hold any newly-started collections'
scripts and modules.
The later patches will add the code to stop on each situation.

Differential Revision: https://phabricator.services.mozilla.com/D294590
2026-04-24 14:22:52 +00:00
Atila Butkovits 6c7fe7e77b Revert "Bug 2031078 - Part 6: Stop collecting delazifications on idle. r=bthrall" for causing SM bustages in js.cpp.
This reverts commit 1e6f986667.

Revert "Bug 2031078 - Part 5: Stop collecting delazifications on memory pressure. r=bthrall"

This reverts commit 52e7376bc2.

Revert "Bug 2031078 - Part 4: Distinguish the call JS::StartCollectingDelazifications on a script with asm.js. r=bthrall"

This reverts commit 62233eb1f0.

Revert "Bug 2031078 - Part 3: Ignore JS::AbortCollectingDelazifications call on not-collecting cases. r=bthrall"

This reverts commit a51e0ee4eb.

Revert "Bug 2031078 - Part 2: Make JS::AbortCollectingDelazifications take raw pointer. r=bthrall"

This reverts commit 285dd9183b.

Revert "Bug 2031078 - Part 1: Hold scripts and modules while collecting delazifications. r=bthrall,mccr8"

This reverts commit 0c81cde149.
2026-04-24 04:59:09 +00:00
Tooru Fujisawa 0c81cde149 Bug 2031078 - Part 1: Hold scripts and modules while collecting delazifications. r=bthrall,mccr8
In order to stop collecting delazifications, hold any newly-started collections'
scripts and modules.
The later patches will add the code to stop on each situation.

Differential Revision: https://phabricator.services.mozilla.com/D294590
2026-04-24 04:21:44 +00:00
Daniel Minor b3257acf0e Bug 1989109 - Add common function for compiling CSS module scripts; r=arai
This moves common code for compiling CSS module scripts into a
function, that we can then use in both ModuleLoader and
mozJSModuleLoader.

Differential Revision: https://phabricator.services.mozilla.com/D291333
2026-04-01 23:04:12 +00:00
rperta 5b8dc731ef Revert "Bug 1989109 - Support ModuleType::CSS in mozJSModuleLoader; r=arai" for causin xpc failures at test_import_attributes.js
This reverts commit e69fad3e09.

This reverts commit 568973b40f.

This reverts commit 4c4288c8f1.

This reverts commit 5379430c8a.
2026-04-01 19:46:05 +00:00
Daniel Minor 568973b40f Bug 1989109 - Add common function for compiling CSS module scripts; r=arai
This moves common code for compiling CSS module scripts into a
function, that we can then use in both ModuleLoader and
mozJSModuleLoader.

Differential Revision: https://phabricator.services.mozilla.com/D291333
2026-04-01 18:28:46 +00:00
Eemeli Aro 674f183bab Bug 2022830 - Handle text module type in DOM loaders. r=dminor,dom-worker-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D287349
2026-03-26 19:42:52 +00:00
Sylvestre Ledru 9eb1a31a98 Bug 2023419 - Remove Emacs/Vim modelines from dom/ r=emilio,media-playback-reviewers,webidl,padenot
replaced by .editorconfig
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D287843
2026-03-16 21:02:32 +00:00
Daniel Minor f0d6eb0c61 Bug 2016369 - Improve CSS module script error message; r=dom-core,edgar
The current error message is bad, we should at least mention that it
was the CSS module compilation that failed.

I've also added some basic logging for when the module mime type check
fails, even though I'm familiar with the code, it took me more time
than it should have to realize this was what was causing the css module
in the extension to fail loading.

Differential Revision: https://phabricator.services.mozilla.com/D284112
2026-03-04 16:56:04 +00:00
Yoshi Cheng-Hao Huang ac6a7c224d Bug 1916277 - Part 8: Set mIsPreload to true for non-top-level modules. r=jonco
Currently Gecko only set mIsPreload to true for the top-level preloading
load. To identify a non-top-level preload, update mIsPreload accordingly
to match the mIsPreload flag from the root module.

Differential Revision: https://phabricator.services.mozilla.com/D281154
2026-03-03 00:52:45 +00:00
Yoshi Cheng-Hao Huang 27a8d5f100 Bug 1916277 - Part 2: Check the pref before DisallowImportMaps. r=jonco
Calling DisallowImportMaps() conditionally if the pref is off.

Differential Revision: https://phabricator.services.mozilla.com/D278655
2026-03-03 00:52:32 +00:00
Tooru Fujisawa 2246ae01b4 Bug 2017100 - Part 3: Populate channel and loadInfo fields for http-on-resource-cache-response notification. r=nbp
Especially the nonce and the hint charset are used by the later patch.

Differential Revision: https://phabricator.services.mozilla.com/D283561
2026-02-24 10:06:50 +00:00
Daniel Minor 8b1a3bd043 Bug 2007672 - Compile wasm modules as bytes; r=allstarschh,dom-worker-reviewers,edenchuang
Differential Revision: https://phabricator.services.mozilla.com/D278171
2026-01-29 22:14:21 +00:00
Serban Stanca 1963fb1616 Revert "Bug 2007672 - Compile wasm modules as bytes; r=allstarschh,dom-worker-reviewers,edenchuang" for causing non-unified build bustages in ScriptLoadHandler.cpp.
This reverts commit d538496d6f.

This reverts commit fd4fd6566a.

This reverts commit 96e631a782.

This reverts commit 01b786e3f5.
2026-01-29 02:38:21 +00:00
Daniel Minor d538496d6f Bug 2007672 - Compile wasm modules as bytes; r=allstarschh,dom-worker-reviewers,edenchuang
Differential Revision: https://phabricator.services.mozilla.com/D278171
2026-01-28 23:26:57 +00:00
Daniel Minor 5c2dc323f0 Bug 1994828 - Add support for wasm modules in module loaders; r=allstarschh,dom-core,smaug
Differential Revision: https://phabricator.services.mozilla.com/D270154
2025-12-12 14:15:12 +00:00
Tooru Fujisawa 2520b3066a Bug 1907011 - Part 4: Rename LoadedScript::Bytecode to LoadedScript::SerializedStencil. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D273957
2025-11-26 04:13:18 +00:00
Tooru Fujisawa 58730279e1 Bug 1907011 - Part 1: Rename bytecode to serialized stencil in LoadedScript DataType. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D273954
2025-11-26 04:13:10 +00:00
Cornelius Emase 30962accea Bug 1998012 - Refactor synthetic module creation to shared CreateDefaultExportSyntheticModule. r=dminor,allstarschh
Rename CreateCSSModule to CreateDefaultExportSyntheticModule and remove the
unused ReadOnlyCompileOptions parameter. Update the call in ModuleLoader.cpp
to use the new function signature, and replace the duplicate code in
CompileJsonModule.

Differential Revision: https://phabricator.services.mozilla.com/D271453
2025-11-06 20:29:43 +00:00
Cornelius Emase ebfd828841 Bug 1996859 - Handle 'bytes' module type in DOM loaders. r=dminor,dom-core,smaug
Add support for JS::ModuleType::Bytes in Worker and Worklet loaders.
Duplicate Unknown handling and restrict IsModuleTypeAllowed to JS and
JSON modules only.

Differential Revision: https://phabricator.services.mozilla.com/D270803
2025-11-03 17:16:37 +00:00
Tooru Fujisawa 3cab1a6f1a Bug 1991607 - Part 11: Remove ScriptLoadRequest::mBaseURL. r=bthrall,dom-worker-reviewers,edenchuang
In contrast to other fields, mBaseURL is not populated in the constructors.
Thus we just need to remove the ScriptLoadRequest::mBaseURL field and
use the LoadedScript::mBaseURL instead.

Differential Revision: https://phabricator.services.mozilla.com/D267360
2025-10-22 11:21:01 +00:00
Tooru Fujisawa cde6c638b3 Bug 1991607 - Part 10: Remove ScriptLoadRequest::mURI. r=bthrall,dom-worker-reviewers,edenchuang
Differential Revision: https://phabricator.services.mozilla.com/D267359
2025-10-22 11:20:59 +00:00
Tooru Fujisawa fe52c48fe7 Bug 1991607 - Part 9: Pass URI to LoadedScript ctor from ScriptLoadRequest ctor callsites. r=bthrall,dom-worker-reviewers,edenchuang
Differential Revision: https://phabricator.services.mozilla.com/D267358
2025-10-22 11:20:56 +00:00
Tooru Fujisawa 9cd82d3aa1 Bug 1991607 - Part 8: Remove ScriptLoadRequest::mFetchOptions. r=bthrall,dom-worker-reviewers,edenchuang
Differential Revision: https://phabricator.services.mozilla.com/D267357
2025-10-22 11:20:53 +00:00
Tooru Fujisawa 1e6cf884b0 Bug 1991607 - Part 7: Pass FetchOptions to LoadedScript ctor from ScriptLoadRequest ctor callsites. r=bthrall,dom-worker-reviewers,edenchuang
Differential Revision: https://phabricator.services.mozilla.com/D267356
2025-10-22 11:20:51 +00:00
Tooru Fujisawa 37731eea18 Bug 1991607 - Part 6: Remove ScriptLoadRequest::mReferrerPolicy. r=bthrall,dom-worker-reviewers,edenchuang
Differential Revision: https://phabricator.services.mozilla.com/D267355
2025-10-22 11:20:48 +00:00
Tooru Fujisawa 2d1895402a Bug 1991607 - Part 5: Pass ReferrerPolicy to LoadedScript ctor from ScriptLoadRequest ctor callsites. r=bthrall,dom-worker-reviewers,edenchuang
In order to remove ScriptLoadRequest::mReferrerPolicy field, we should directly
pass ReferrerPolicy to the LoadedScript constructor.

Differential Revision: https://phabricator.services.mozilla.com/D267354
2025-10-22 11:20:46 +00:00
Atila Butkovits 13ff5f1bad Revert "Bug 1991607 - Part 12: Reorder ScriptLoadRequest/ModuleLoadRequest fields. r=bthrall" for causing bustages at LoadedScript.cpp.
This reverts commit 30499d5cdc.

Revert "Bug 1991607 - Part 11: Remove ScriptLoadRequest::mBaseURL. r=bthrall,dom-worker-reviewers,edenchuang"

This reverts commit 85324622ab.

Revert "Bug 1991607 - Part 10: Remove ScriptLoadRequest::mURI. r=bthrall,dom-worker-reviewers,edenchuang"

This reverts commit 3b1afd5ca0.

Revert "Bug 1991607 - Part 9: Pass URI to LoadedScript ctor from ScriptLoadRequest ctor callsites. r=bthrall,dom-worker-reviewers,edenchuang"

This reverts commit 10dc4e2bc0.

Revert "Bug 1991607 - Part 8: Remove ScriptLoadRequest::mFetchOptions. r=bthrall,dom-worker-reviewers,edenchuang"

This reverts commit b4c09eb6e1.

Revert "Bug 1991607 - Part 7: Pass FetchOptions to LoadedScript ctor from ScriptLoadRequest ctor callsites. r=bthrall,dom-worker-reviewers,edenchuang"

This reverts commit f48d2160e1.

Revert "Bug 1991607 - Part 6: Remove ScriptLoadRequest::mReferrerPolicy. r=bthrall,dom-worker-reviewers,edenchuang"

This reverts commit a6901c3f1d.

Revert "Bug 1991607 - Part 5: Pass ReferrerPolicy to LoadedScript ctor from ScriptLoadRequest ctor callsites. r=bthrall,dom-worker-reviewers,edenchuang"

This reverts commit c2b5cb885a.

Revert "Bug 1991607 - Part 4: Add ImportMapScript subclass for LoadedScript. r=bthrall"

This reverts commit 09b8ae44b8.

Revert "Bug 1991607 - Part 3: Make LoadedScript::mKind field const. r=bthrall"

This reverts commit 3eebccc479.

Revert "Bug 1991607 - Part 2: Let ScriptLoader::CheckContentPolicy receive LoadedScript-related parameters separately. r=bthrall"

This reverts commit dd8530cb71.

Revert "Bug 1991607 - Part 1: Let ScriptHashKey and ScriptLoadData receive LoadedScript-related parameters separately. r=bthrall"

This reverts commit b4a4f94096.
2025-10-22 05:40:38 +00:00
Tooru Fujisawa 85324622ab Bug 1991607 - Part 11: Remove ScriptLoadRequest::mBaseURL. r=bthrall,dom-worker-reviewers,edenchuang
In contrast to other fields, mBaseURL is not populated in the constructors.
Thus we just need to remove the ScriptLoadRequest::mBaseURL field and
use the LoadedScript::mBaseURL instead.

Differential Revision: https://phabricator.services.mozilla.com/D267360
2025-10-22 04:38:20 +00:00
Tooru Fujisawa 3b1afd5ca0 Bug 1991607 - Part 10: Remove ScriptLoadRequest::mURI. r=bthrall,dom-worker-reviewers,edenchuang
Differential Revision: https://phabricator.services.mozilla.com/D267359
2025-10-22 04:38:17 +00:00
Tooru Fujisawa 10dc4e2bc0 Bug 1991607 - Part 9: Pass URI to LoadedScript ctor from ScriptLoadRequest ctor callsites. r=bthrall,dom-worker-reviewers,edenchuang
Differential Revision: https://phabricator.services.mozilla.com/D267358
2025-10-22 04:38:14 +00:00
Tooru Fujisawa b4c09eb6e1 Bug 1991607 - Part 8: Remove ScriptLoadRequest::mFetchOptions. r=bthrall,dom-worker-reviewers,edenchuang
Differential Revision: https://phabricator.services.mozilla.com/D267357
2025-10-22 04:38:11 +00:00
Tooru Fujisawa f48d2160e1 Bug 1991607 - Part 7: Pass FetchOptions to LoadedScript ctor from ScriptLoadRequest ctor callsites. r=bthrall,dom-worker-reviewers,edenchuang
Differential Revision: https://phabricator.services.mozilla.com/D267356
2025-10-22 04:38:08 +00:00
Tooru Fujisawa a6901c3f1d Bug 1991607 - Part 6: Remove ScriptLoadRequest::mReferrerPolicy. r=bthrall,dom-worker-reviewers,edenchuang
Differential Revision: https://phabricator.services.mozilla.com/D267355
2025-10-22 04:38:06 +00:00
Tooru Fujisawa c2b5cb885a Bug 1991607 - Part 5: Pass ReferrerPolicy to LoadedScript ctor from ScriptLoadRequest ctor callsites. r=bthrall,dom-worker-reviewers,edenchuang
In order to remove ScriptLoadRequest::mReferrerPolicy field, we should directly
pass ReferrerPolicy to the LoadedScript constructor.

Differential Revision: https://phabricator.services.mozilla.com/D267354
2025-10-22 04:38:03 +00:00
Yoshi Cheng-Hao Huang b5afcc2950 Bug 1988419 - No need to check document's CSP for WebExtensions. r=robwu
WebExtensions shouldn't be restricted by the document's CSP.

Differential Revision: https://phabricator.services.mozilla.com/D265237
2025-10-17 23:06:29 +00:00
Tooru Fujisawa 3f9a88662a Bug 1991081 - Part 2: Store stencil to LoadedScript also in text and bytecode variants. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D266612
2025-10-16 09:05:39 +00:00
Tooru Fujisawa 1257f9e671 Bug 1991081 - Part 1: Rename Stencil variant to CachedStencil in LoadedScript. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D266610
2025-10-16 09:05:36 +00:00
agoloman 3352c88229 Revert "Bug 1991081 - Part 7: Rewrite EncodeBytecodeAndSave with LoadedScript. r=nbp" for causing failures @LoadedScript.h.
This reverts commit b10b7c8add.

Revert "Bug 1991081 - Part 6: Remove testing-only events from EncodeBytecodeAndSave. r=nbp"

This reverts commit caf275708e.

Revert "Bug 1991081 - Part 5: Use single field for SRI and optional bytecode, for bytecode case and for cached stencil case. r=nbp"

This reverts commit 86631a6e10.

Revert "Bug 1991081 - Part 4: Use LoadedScript for logging in EncodeBytecodeAndSave. r=nbp"

This reverts commit 0f9d7f11e8.

Revert "Bug 1991081 - Part 3: Store nsICacheInfoChannel to LoadedScript also in text and bytecode variants. r=nbp"

This reverts commit 370f5bcd48.

Revert "Bug 1991081 - Part 2: Store stencil to LoadedScript also in text and bytecode variants. r=nbp"

This reverts commit 7eaf4f425f.

Revert "Bug 1991081 - Part 1: Rename Stencil variant to CachedStencil in LoadedScript. r=nbp"

This reverts commit a7a6ce8f6f.
2025-10-15 13:30:07 +00:00
Tooru Fujisawa 7eaf4f425f Bug 1991081 - Part 2: Store stencil to LoadedScript also in text and bytecode variants. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D266612
2025-10-15 09:44:07 +00:00