mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 19:59:17 +00:00
Everywhere: Hoist the Libraries folder to the top-level
This commit is contained in:
parent
950e819ee7
commit
93712b24bf
Notes:
github-actions[bot]
2024-11-10 11:51:52 +00:00
Author: https://github.com/trflynn89
Commit: 93712b24bf
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2256
Reviewed-by: https://github.com/sideshowbarker
4547 changed files with 104 additions and 113 deletions
48
Libraries/LibWeb/HTML/Scripting/ImportMap.h
Normal file
48
Libraries/LibWeb/HTML/Scripting/ImportMap.h
Normal file
|
@ -0,0 +1,48 @@
|
|||
/*
|
||||
* Copyright (c) 2022, networkException <networkexception@serenityos.org>
|
||||
* Copyright (c) 2024, Jamie Mansfield <jmansfield@cadixdev.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AK/HashMap.h>
|
||||
#include <LibURL/URL.h>
|
||||
#include <LibWeb/WebIDL/ExceptionOr.h>
|
||||
|
||||
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 {
|
||||
public:
|
||||
ImportMap() = default;
|
||||
|
||||
ModuleSpecifierMap const& imports() const { return m_imports; }
|
||||
ModuleSpecifierMap& imports() { return m_imports; }
|
||||
void set_imports(ModuleSpecifierMap const& imports) { m_imports = imports; }
|
||||
|
||||
HashMap<URL::URL, ModuleSpecifierMap> const& scopes() const { return m_scopes; }
|
||||
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