||A helper class to report warning to ScriptLoaderInterface.
LoadContexts augment the loading of a ScriptLoadRequest. This class
is used as a base for all LoadContexts, and provides shared functionality.
Different loading environments have different rules applied to how a script
is loaded. In DOM scripts, there are flags controlling load order (Async,
Deferred, normal) as well as other elements that impact the loading of a
script (<preload>). In the case of workers, service workers are potentially
loaded from the Cache. For more detailed information per context see
* The ScriptLoadContext: dom/script/ScriptLoadContext.h
||Implement the HostResolveImportedModule abstract operation.
Resolve a module specifier string and look this up in the module
map, returning the result. This is only called for previously
loaded modules and always succeeds.
@param aReferencingPrivate A JS::Value which is either undefined
or contains a LoadedScript private pointer.
@param aModuleRequest A module request object.
@returns module This is set to the module found.
||ResolveResult is used to store the result of 'resolving a module specifier',
which could be an URI on success or a ResolveError on failure.
||ScriptFetchOptions loosely corresponds to HTML's "script fetch options",
with the exception of the following properties:
The cryptographic nonce metadata used for the initial fetch and for
fetching any imported modules. As this is populated by a DOM element,
this is implemented via mozilla::dom::Element as the field
mElement. The default value is an empty string, and is indicated
when this field is a nullptr. Nonce is not represented on the dom
side as per bug 1374612.
The parser metadata used for the initial fetch and for fetching any
imported modules. This is populated from a mozilla::dom::Element and is
handled by the field mElement. The default value is an empty string,
and is indicated when this field is a nullptr.
The integrity metadata used for the initial fetch. This is
implemented in ScriptLoadRequest, as it changes for every
In the case of classic scripts without dynamic import, this object is
used once. For modules, this object is propogated throughout the module
tree. If there is a dynamically imported module in any type of script,
the ScriptFetchOptions object will be propogated from its importer.