According to the spec, requests created in HostLoadImportedModule have
the isTopLevel flag set to false. This means both static and dynamic
import requests should also have this flag set to false.
[HostLoadImportedModule](https://html.spec.whatwg.org/#hostloadimportedmodule)
Step 14. Fetch a single imported module script ...
[Fetch a single imported module script](https://html.spec.whatwg.org/#fetch-a-single-imported-module-script)
Step 4. Fetch a single module script given url, fetchClient, destination, options, settingsObject, referrer, moduleRequest, false, and onComplete.
The false argument in the second-to-last parameter of 'Fetch a single
module script' corresponds to the top-levl flag.
[Fetch a single module script](https://html.spec.whatwg.org/#fetch-a-single-module-script)
given a URL url, an environment settings object fetchClient, a
destination destination, a script fetch options options, an environment
settings object settingsObject, a referrer referrer, an optional
ModuleRequest Record moduleRequest, a boolean isTopLevel, an algorithm
onComplete,
The spec was updated in https://github.com/whatwg/html/issues/7996. We’re
updating the implementation to reflect this change.
Differential Revision: https://phabricator.services.mozilla.com/D265593
According to the spec, requests created in HostLoadImportedModule have
the isTopLevel flag set to false. This means both static and dynamic
import requests should also have this flag set to false.
[HostLoadImportedModule](https://html.spec.whatwg.org/#hostloadimportedmodule)
Step 14. Fetch a single imported module script ...
[Fetch a single imported module script](https://html.spec.whatwg.org/#fetch-a-single-imported-module-script)
Step 4. Fetch a single module script given url, fetchClient, destination, options, settingsObject, referrer, moduleRequest, false, and onComplete.
The false argument in the second-to-last parameter of 'Fetch a single
module script' corresponds to the top-levl flag.
[Fetch a single module script](https://html.spec.whatwg.org/#fetch-a-single-module-script)
given a URL url, an environment settings object fetchClient, a
destination destination, a script fetch options options, an environment
settings object settingsObject, a referrer referrer, an optional
ModuleRequest Record moduleRequest, a boolean isTopLevel, an algorithm
onComplete,
The spec was updated in https://github.com/whatwg/html/issues/7996. We’re
updating the implementation to reflect this change.
Differential Revision: https://phabricator.services.mozilla.com/D265593
According to the spec, requests created in HostLoadImportedModule have
the isTopLevel flag set to false. This means both static and dynamic
import requests should also have this flag set to false.
[HostLoadImportedModule](https://html.spec.whatwg.org/#hostloadimportedmodule)
Step 14. Fetch a single imported module script ...
[Fetch a single imported module script](https://html.spec.whatwg.org/#fetch-a-single-imported-module-script)
Step 4. Fetch a single module script given url, fetchClient, destination, options, settingsObject, referrer, moduleRequest, false, and onComplete.
The false argument in the second-to-last parameter of 'Fetch a single
module script' corresponds to the top-levl flag.
[Fetch a single module script](https://html.spec.whatwg.org/#fetch-a-single-module-script)
given a URL url, an environment settings object fetchClient, a
destination destination, a script fetch options options, an environment
settings object settingsObject, a referrer referrer, an optional
ModuleRequest Record moduleRequest, a boolean isTopLevel, an algorithm
onComplete,
The spec was updated in https://github.com/whatwg/html/issues/7996. We’re
updating the implementation to reflect this change.
Differential Revision: https://phabricator.services.mozilla.com/D265593
If the script is redirected, the redirected URL will be stored in
BaseURL(), therefore we should change to use BaseURL instead.
Differential Revision: https://phabricator.services.mozilla.com/D263371
If the script is redirected, the redirected URL will be stored in
BaseURL(), therefore we should change to use BaseURL instead.
Differential Revision: https://phabricator.services.mozilla.com/D263371
There are shared path between "save bytecode" vs "cache stencil".
This patch just renames everything, and the subsequent bugs and patches will
split the flag and methods.
Differential Revision: https://phabricator.services.mozilla.com/D260911
As a preparation to calculate the "bytecode encoding" separately than "do cache"
for the navigation cache, we should always calculate the flag.
Differential Revision: https://phabricator.services.mozilla.com/D260910
Most changes are automated. Relevant bit is dom/.clang-format. I had to
manually disable clang-format in a few places where importing external
files and so on that aren't self-contained, and fix a couple includes /
forward declarations.
Differential Revision: https://phabricator.services.mozilla.com/D256800
This reverts commit 99ce61fb4e.
Revert "Bug 1973206 - Part 5: Remove unused variable in ScriptLoader::MaybePrepareModuleForBytecodeEncodingBeforeExecute. r=nbp"
This reverts commit 73dd64fbdc.
Revert "Bug 1973206 - Part 4: Filter out JSON modules earlier in ScriptLoader::CalculateBytecodeCacheFlag. r=nbp"
This reverts commit 5c8d191154.
Revert "Bug 1973206 - Part 3: Move CalculateBytecodeCacheFlag to instance method as a preparation for the subsequent patches. r=nbp"
This reverts commit 2e9c7ce88a.
Revert "Bug 1973206 - Part 2: Verify the list in IsAlreadyHandledForBytecodeEncodingPreparation. r=nbp"
This reverts commit 64d3a74e4d.
Refactors execution behavior to run asynchronously for inline scripts that are
not generated by the parser.
spec:
https://html.spec.whatwg.org/#prepare-the-script-element
Step 32. If el does not have a src content attribute:
2. type: "module"
...
3. Fetch an inline module script graph, given source text, base URL, settings object, options, and with the following steps given result:
1. Queue an element task on the networking task source given el to perform the following steps:
1. Mark as ready el given result.
Step 33. If ... el's type is "module":
3. Otherwise, if el is not parser-inserted:
3.2.1 Execute the script element scripts[0].
Differential Revision: https://phabricator.services.mozilla.com/D254202
Create InitialStencilAndDelazifications and associate it to ScriptSourceObject,
and store on-demand delazifications into the InitialStencilAndDelazifications.
InitialStencilAndDelazifications is merged into single CompilationStencil when
finishing, but the JS::Stencil-based API is going to be rewritten later not
to merge.
Differential Revision: https://phabricator.services.mozilla.com/D230378
We never reach `CompileFetchedModule` if we have an unknown module type since
we take the module type into account when we do mime type checking, so the file
always fails to load because of MIME mismatch, and we don't get the expected
`TypeError.` Checking if we have an unknown type should happen much earlier in
the process.
Differential Revision: https://phabricator.services.mozilla.com/D222222