Yoshi Cheng-Hao Huang
bf610156cd
Bug 1688879 - Part 6: Acquiring import maps. r=jonco,yulia
...
Implement https://wicg.github.io/import-maps/#document-acquiring-import-maps
Differential Revision: https://phabricator.services.mozilla.com/D142074
2022-05-05 16:03:17 +00:00
Yoshi Cheng-Hao Huang
ec955eda01
Bug 1688879 - Part 5: ResolveModuleSpecifier for import maps. r=jonco,yulia,flod
...
Implement https://wicg.github.io/import-maps/#resolve-a-module-specifier
Differential Revision: https://phabricator.services.mozilla.com/D142072
2022-05-05 16:03:17 +00:00
Yoshi Cheng-Hao Huang
aec5d28b29
Bug 1688879 - Part 4: Refactor ResolveModuleSpecifier. r=jonco,yulia
...
Add ResolveResult to return nsIURI on success or return ResolveError on
failure.
Differential Revision: https://phabricator.services.mozilla.com/D142073
2022-05-05 16:03:17 +00:00
Yoshi Cheng-Hao Huang
ea9b864f1c
Bug 1688879 - Part 3: Parse and register an import map. r=jonco,yulia
...
Implement
https://wicg.github.io/import-maps/#parse-an-import-map-string ,
and
https://wicg.github.io/import-maps/#register-an-import-map
Differential Revision: https://phabricator.services.mozilla.com/D142071
2022-05-05 16:03:16 +00:00
Yoshi Cheng-Hao Huang
9e51f47edc
Bug 1688879 - Part 2: Add support for import maps in ScriptElement/ScriptLoader/ScriptKind. r=jonco,yulia,smaug
...
Differential Revision: https://phabricator.services.mozilla.com/D142070
2022-05-05 16:03:16 +00:00
Narcis Beleuzu
8fd1fceb75
Backed out 9 changesets (bug 1688879) for bustages on ImportMap.cpp
...
Backed out changeset 44e9abe72a5e (bug 1688879)
Backed out changeset 0503d2d2ae01 (bug 1688879)
Backed out changeset 2cf08a51b184 (bug 1688879)
Backed out changeset 6f0276c3ab0e (bug 1688879)
Backed out changeset f16b14d8f677 (bug 1688879)
Backed out changeset 03b772e02d07 (bug 1688879)
Backed out changeset 39ed48a5ecc2 (bug 1688879)
Backed out changeset d7b42d8312bb (bug 1688879)
Backed out changeset 5e695bf5dd0d (bug 1688879)
2022-05-05 03:41:31 +03:00
Yoshi Cheng-Hao Huang
a83768b601
Bug 1688879 - Part 6: Acquiring import maps. r=jonco,yulia
...
Implement https://wicg.github.io/import-maps/#document-acquiring-import-maps
Differential Revision: https://phabricator.services.mozilla.com/D142074
2022-05-04 21:02:51 +00:00
Yoshi Cheng-Hao Huang
a0004f1c1b
Bug 1688879 - Part 5: ResolveModuleSpecifier for import maps. r=jonco,yulia,flod
...
Implement https://wicg.github.io/import-maps/#resolve-a-module-specifier
Differential Revision: https://phabricator.services.mozilla.com/D142072
2022-05-04 21:02:51 +00:00
Yoshi Cheng-Hao Huang
b2ad92d9c5
Bug 1688879 - Part 4: Refactor ResolveModuleSpecifier. r=jonco,yulia
...
Add ResolveResult to return nsIURI on success or return ResolveError on
failure.
Differential Revision: https://phabricator.services.mozilla.com/D142073
2022-05-04 21:02:51 +00:00
Yoshi Cheng-Hao Huang
641d407325
Bug 1688879 - Part 3: Parse and register an import map. r=jonco,yulia
...
Implement
https://wicg.github.io/import-maps/#parse-an-import-map-string ,
and
https://wicg.github.io/import-maps/#register-an-import-map
Differential Revision: https://phabricator.services.mozilla.com/D142071
2022-05-04 21:02:50 +00:00
Yoshi Cheng-Hao Huang
9d0b0b7820
Bug 1688879 - Part 2: Add support for import maps in ScriptElement/ScriptLoader/ScriptKind. r=jonco,yulia,smaug
...
Differential Revision: https://phabricator.services.mozilla.com/D142070
2022-05-04 21:02:50 +00:00
Jon Coppeard
37bf384638
Bug 1766274 - Part 5: Document the expected use of ModuleLoaderBase r=yulia
...
Differential Revision: https://phabricator.services.mozilla.com/D144601
2022-04-26 12:40:48 +00:00
Jon Coppeard
85d0a41c5c
Bug 1766274 - Part 4: Change references to module trees to module graphs r=yulia
...
Module imports can be cyclic so it's more correct to refer to them as graphs.
The spec also uses this term.
Depends on D144599
Differential Revision: https://phabricator.services.mozilla.com/D144600
2022-04-26 12:40:48 +00:00
Jon Coppeard
9f0a6e5946
Bug 1766274 - Part 3: Rename CompileOrFinishModuleScript to CompileFetchedModule r=yulia
...
I was less sure of this one, but I think 'finish' is confusing here. Better names welcome.
Depends on D144597
Differential Revision: https://phabricator.services.mozilla.com/D144599
2022-04-26 12:40:48 +00:00
Jon Coppeard
af3cf7bcba
Bug 1766274 - Part 2: Rename ProcessLoadedModuleTree to OnModuleLoadComplete r=yulia
...
Depends on D144596
Differential Revision: https://phabricator.services.mozilla.com/D144597
2022-04-26 12:40:47 +00:00
Jon Coppeard
be040930d2
Bug 1766274 - Part 1: Rename ProcessFetchedModuleSource to OnFetchComplete and pass an error code r=yulia
...
This renames the method to correspond to StartFetch and adds a status argument
so clients can call this rather than
SetModuleFetchFinishedAndResumeWaitingRequests on error.
Depends on D144595
Differential Revision: https://phabricator.services.mozilla.com/D144596
2022-04-26 12:40:47 +00:00
Yulia Startsev
87fc25d125
Bug 1763372 - Rename GetLoadContext to GetScriptLoadContext; r=jonco
...
Depends on D143068
Differential Revision: https://phabricator.services.mozilla.com/D143037
2022-04-22 13:24:10 +00:00
Yulia Startsev
3a2268ee6b
Bug 1763372 - address new issues in the hybrid build; r=jonco
...
Depends on D143036
Differential Revision: https://phabricator.services.mozilla.com/D143068
2022-04-22 13:24:10 +00:00
Yulia Startsev
d82e2da688
Bug 1763372 - Add LoadContextBase; r=jonco,smaug
...
Differential Revision: https://phabricator.services.mozilla.com/D143036
2022-04-22 13:24:09 +00:00
Yulia Startsev
8cfef949b3
Bug 1763586 - Remove Element from LoadScript and child classes; r=jonco
...
Differential Revision: https://phabricator.services.mozilla.com/D143139
2022-04-21 09:53:34 +00:00
Yulia Startsev
70b812515a
Bug 1763586 - Adjust ScriptFetchOptions to be more accurate; r=jonco
...
Differential Revision: https://phabricator.services.mozilla.com/D143137
2022-04-21 09:53:33 +00:00
criss
2a954af256
Backed out 4 changesets (bug 1763586) for causing mochitest failures on test_Debugger.Source.prototype.elementAttribute.html. CLOSED TREE
...
Backed out changeset 8da9574159d3 (bug 1763586)
Backed out changeset 8f964a9e2f31 (bug 1763586)
Backed out changeset 420105516ec3 (bug 1763586)
Backed out changeset 68cd444d018e (bug 1763586)
2022-04-19 16:28:30 +03:00
Yulia Startsev
7d51003111
Bug 1763586 - Remove Element from LoadScript and child classes; r=jonco
...
Differential Revision: https://phabricator.services.mozilla.com/D143139
2022-04-19 12:28:49 +00:00
Yulia Startsev
0da57f61bb
Bug 1763586 - Adjust ScriptFetchOptions to be more accurate; r=jonco
...
Differential Revision: https://phabricator.services.mozilla.com/D143137
2022-04-19 12:28:48 +00:00
Iulian Moraru
227066f57e
Backed out 3 changesets (bug 1763586) for causing mochitest-chrome failures on test_Debugger.Source.prototype.element.html.
...
Backed out changeset f6b6ccfce3d1 (bug 1763586)
Backed out changeset ca0157c919a9 (bug 1763586)
Backed out changeset e0294a6f9f9f (bug 1763586)
2022-04-13 21:53:34 +03:00
Yulia Startsev
272e6bea25
Bug 1763586 - Remove Element from LoadScript and child classes; r=jonco
...
Differential Revision: https://phabricator.services.mozilla.com/D143139
2022-04-13 16:29:36 +00:00
Yulia Startsev
b8fdd1cb6a
Bug 1763586 - Adjust ScriptFetchOptions to be more accurate; r=jonco
...
Differential Revision: https://phabricator.services.mozilla.com/D143137
2022-04-13 16:29:36 +00:00
Marian-Vasile Laza
a3aadc47df
Backed out 3 changesets (bug 1763586) foar causing sm bustages. CLOSED TREE
...
Backed out changeset 02a961432a49 (bug 1763586)
Backed out changeset 3fc84237decb (bug 1763586)
Backed out changeset 365eff56ce0f (bug 1763586)
2022-04-12 09:49:21 -07:00
Yulia Startsev
b3bf5e2991
Bug 1763586 - Remove Element from LoadScript and child classes; r=jonco
...
Differential Revision: https://phabricator.services.mozilla.com/D143139
2022-04-12 16:16:32 +00:00
Yulia Startsev
5dd282eb7d
Bug 1763586 - Adjust ScriptFetchOptions to be more accurate; r=jonco
...
Differential Revision: https://phabricator.services.mozilla.com/D143137
2022-04-12 16:16:31 +00:00
Jon Coppeard
2a22044473
Bug 1761938 - Part 6: Remove global from script load context r=smaug,yulia
...
This removes the global object field from the script load context and gets the
global from the script loader / module loader where necessary.
Differential Revision: https://phabricator.services.mozilla.com/D142833
2022-04-11 15:35:30 +00:00
Jon Coppeard
42de261a2e
Bug 1761938 - Part 5: Use module loader's global where possible and remove GetGlobalForRequest from script loader interface r=yulia
...
Differential Revision: https://phabricator.services.mozilla.com/D142832
2022-04-11 15:35:30 +00:00
Jon Coppeard
95257109ee
Bug 1761938 - Part 4: Give module loaders a global object field r=smaug,yulia
...
This gives the module loader a field for the current global, since a module map
is only associated with a single global.
This adds a method to Document to tell the script loader when its global
changes. I'm not sure of when we do this exactly.
Differential Revision: https://phabricator.services.mozilla.com/D142831
2022-04-11 15:35:29 +00:00
Jon Coppeard
9847491365
Bug 1761938 - Part 3: Remove global from the module map key and use URI only r=yulia
...
Since content scripts have separate module loaders there's no need to key the
module map on the global any more.
Differential Revision: https://phabricator.services.mozilla.com/D142830
2022-04-11 15:35:29 +00:00
Jon Coppeard
94bff9357d
Bug 1761938 - Part 1: Call into the module loader via the module load request object r=yulia
...
The script loader will need to deal with requests from more than one module
loader so this adds methods to the request which dispatch to the correct
loader.
Differential Revision: https://phabricator.services.mozilla.com/D142828
2022-04-11 15:35:28 +00:00
Jon Coppeard
c146088a27
Bug 1761938 - Part 0: Make ModuleLoaderBase::ResolveModuleSpecifier an instance method r=yulia
...
Tidyup. There's no reason for this to be static if it takes a pointer to the instance.
Differential Revision: https://phabricator.services.mozilla.com/D142827
2022-04-11 15:35:27 +00:00
Jon Coppeard
ed61ae9b57
Bug 1759881 - Part 10: Move the generic parts of the StartLoad method to the module loader base r=yulia
...
StartModuleLoadImpl moves to the base class and uses to new virtual methods
CanStartLoad and StartFetch which are implemented by the derived class.
Differential Revision: https://phabricator.services.mozilla.com/D141736
2022-03-28 15:56:10 +00:00
Jon Coppeard
8d15122f96
Bug 1759881 - Part 9: Move module loading hooks into the generic module loader r=yulia
...
Now we can move the JS engine integration hooks into the generic module loader.
There is still some code there to deal with web extension globals. This will be
removed in a later patch.
Differential Revision: https://phabricator.services.mozilla.com/D141735
2022-03-28 12:38:28 +00:00
Jon Coppeard
bea8156b2f
Bug 1759881 - Part 8: Add a virtual method to create a module load request for a dynamic import r=yulia
...
This adds a new virtual to the module loader base, along the same lines as the
one to create a load request for a static import. This makes the
HostImportModuleDynamically hook generic.
Differential Revision: https://phabricator.services.mozilla.com/D141734
2022-03-28 12:38:28 +00:00
Jon Coppeard
293d8c4086
Bug 1759881 - Part 7: Add a virtual method to get the module loader to use for the current global r=yulia,smaug
...
This adds a virtual method to nsIGlobalObject and implements it for
nsGlobalWindowInner and SandboxPrivate. This means we don't have to put the
logic for dealing with all the different kinds of globals in once place.
Differential Revision: https://phabricator.services.mozilla.com/D141733
2022-03-28 12:38:27 +00:00
Jon Coppeard
1bb3a3fa3a
Bug 1761432 - Part 4: Rename state accessor methods after the enum values r=smaug
...
Differential Revision: https://phabricator.services.mozilla.com/D142044
2022-03-25 10:54:17 +00:00
Jon Coppeard
415fac5ab2
Bug 1761432 - Part 3: Add script load request cancelled state r=smaug
...
Previously a separate field, this makes more sense as a state in its own right.
Differential Revision: https://phabricator.services.mozilla.com/D142043
2022-03-25 10:54:17 +00:00
Jon Coppeard
df9edbebe8
Bug 1761432 - Part 2: Split out script load request state for when we require loading from source r=smaug
...
This is used when we explicitly don't want to load cached bytecode. It is
better served by a separate flag in the request than a state.
Differential Revision: https://phabricator.services.mozilla.com/D142042
2022-03-25 10:54:16 +00:00
Jon Coppeard
0ba898655d
Bug 1761432 - Part 1: Rename ScriptLoadRequest progress enum to 'State' r=smaug
...
This also renames 'loading' enum values to 'fetching' since this is more
specific. Loading covers the whole process of loading, which includes the other
states.
Enum values have the leading 'e' removed in line with the coding style for enum
classes.
Differential Revision: https://phabricator.services.mozilla.com/D142041
2022-03-25 10:54:16 +00:00
Tooru Fujisawa
a05cf371c9
Bug 1759206 - Part 2: Use ModuleObject instead of script for encoding module bytecode cache. r=nbp
...
Depends on D141743
Differential Revision: https://phabricator.services.mozilla.com/D141744
2022-03-23 12:51:39 +00:00
Jon Coppeard
0e14bcc89e
Bug 1759881 - Part 6: Remove use of nsJSUtils layer for module instantiation and evaluation r=smaug
...
This layer doesn't add much above calling into the JS engine and it's DOM
specific so let's remove it.
Differential Revision: https://phabricator.services.mozilla.com/D141253
2022-03-17 15:22:18 +00:00
Jon Coppeard
1b4dec7136
Bug 1759881 - Part 5: Remove microtask checkpoints from the module loader in couple of places r=smaug
...
This removes the microtask checkpoint when instantiating modules and moves the
one when creating a module script to the the script loader.
Differential Revision: https://phabricator.services.mozilla.com/D141252
2022-03-17 15:22:18 +00:00
Jon Coppeard
c85786b862
Bug 1759881 - Part 4: Remove use of AutoEntryScript when parsing module source r=smaug
...
I'm not sure why this was there because this can't run script.
Depends on D141250
Differential Revision: https://phabricator.services.mozilla.com/D141251
2022-03-17 15:22:17 +00:00
Jon Coppeard
1db05a03a1
Bug 1759881 - Part 3: Don't pass a global to FillCompileOptionsForRequest r=yulia
...
This can work it out if it needs it by calling GetGlobalForRequest.
Depends on D141249
Differential Revision: https://phabricator.services.mozilla.com/D141250
2022-03-17 15:22:17 +00:00
Jon Coppeard
f6463f2f65
Bug 1759881 - Part 2: Restrict access to internal methods of module loader where possible r=yulia
...
This splits the interface of ModuleLoaderBase into sections and restricts acess
for internal methods.
Depends on D141248
Differential Revision: https://phabricator.services.mozilla.com/D141249
2022-03-17 15:22:16 +00:00