mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-05 07:41:01 +00:00
parent
124779a376
commit
bab086694a
Notes:
github-actions[bot]
2024-08-14 20:07:19 +00:00
Author: https://github.com/jamierocks
Commit: bab086694a
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1029
Reviewed-by: https://github.com/tcl3 ✅
6 changed files with 127 additions and 17 deletions
|
@ -14,6 +14,7 @@
|
|||
namespace Web::HTML {
|
||||
|
||||
using ModuleSpecifierMap = HashMap<ByteString, Optional<URL::URL>>;
|
||||
using ModuleIntegrityMap = HashMap<URL::URL, ByteString>;
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/webappapis.html#import-map
|
||||
class ImportMap {
|
||||
|
@ -28,14 +29,20 @@ public:
|
|||
HashMap<URL::URL, ModuleSpecifierMap>& scopes() { return m_scopes; }
|
||||
void set_scopes(HashMap<URL::URL, ModuleSpecifierMap> const& scopes) { m_scopes = scopes; }
|
||||
|
||||
ModuleIntegrityMap const& integrity() const { return m_integrity; }
|
||||
ModuleIntegrityMap integrity() { return m_integrity; }
|
||||
void set_integrity(ModuleIntegrityMap const& integrity) { m_integrity = integrity; }
|
||||
|
||||
private:
|
||||
ModuleSpecifierMap m_imports;
|
||||
HashMap<URL::URL, ModuleSpecifierMap> m_scopes;
|
||||
ModuleIntegrityMap m_integrity;
|
||||
};
|
||||
|
||||
WebIDL::ExceptionOr<ImportMap> parse_import_map_string(JS::Realm& realm, ByteString const& input, URL::URL base_url);
|
||||
WebIDL::ExceptionOr<Optional<DeprecatedFlyString>> normalise_specifier_key(JS::Realm& realm, DeprecatedFlyString specifier_key, URL::URL base_url);
|
||||
WebIDL::ExceptionOr<ModuleSpecifierMap> sort_and_normalise_module_specifier_map(JS::Realm& realm, JS::Object& original_map, URL::URL base_url);
|
||||
WebIDL::ExceptionOr<HashMap<URL::URL, ModuleSpecifierMap>> sort_and_normalise_scopes(JS::Realm& realm, JS::Object& original_map, URL::URL base_url);
|
||||
WebIDL::ExceptionOr<ModuleIntegrityMap> normalize_module_integrity_map(JS::Realm& realm, JS::Object& original_map, URL::URL base_url);
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue