mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-01 07:52:50 +00:00
LibJS: Remove ByteString internals from PrimitiveString
PrimitiveString is now internally either UTF-8, UTF-16, or both. We no longer convert them to/from ByteString anywhere, nor does VM have a ByteString cache.
This commit is contained in:
parent
f05b0bfd5f
commit
c71772126f
Notes:
github-actions[bot]
2025-03-28 16:32:54 +00:00
Author: https://github.com/awesomekling
Commit: c71772126f
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4142
Reviewed-by: https://github.com/trflynn89
14 changed files with 49 additions and 118 deletions
|
@ -238,7 +238,7 @@ WebIDL::ExceptionOr<Optional<URL::URL>> resolve_imports_match(ByteString const&
|
|||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/webappapis.html#resolving-a-url-like-module-specifier
|
||||
Optional<URL::URL> resolve_url_like_module_specifier(ByteString const& specifier, URL::URL const& base_url)
|
||||
Optional<URL::URL> resolve_url_like_module_specifier(StringView specifier, URL::URL const& base_url)
|
||||
{
|
||||
// 1. If specifier starts with "/", "./", or "../", then:
|
||||
if (specifier.starts_with("/"sv) || specifier.starts_with("./"sv) || specifier.starts_with("../"sv)) {
|
||||
|
|
|
@ -85,7 +85,7 @@ private:
|
|||
String module_type_from_module_request(JS::ModuleRequest const&);
|
||||
WebIDL::ExceptionOr<URL::URL> resolve_module_specifier(Optional<Script&> referring_script, String const& specifier);
|
||||
WebIDL::ExceptionOr<Optional<URL::URL>> resolve_imports_match(ByteString const& normalized_specifier, Optional<URL::URL> as_url, ModuleSpecifierMap const&);
|
||||
Optional<URL::URL> resolve_url_like_module_specifier(ByteString const& specifier, URL::URL const& base_url);
|
||||
Optional<URL::URL> resolve_url_like_module_specifier(StringView specifier, URL::URL const& base_url);
|
||||
ScriptFetchOptions get_descendant_script_fetch_options(ScriptFetchOptions const& original_options, URL::URL const& url, EnvironmentSettingsObject& settings_object);
|
||||
String resolve_a_module_integrity_metadata(URL::URL const& url, EnvironmentSettingsObject& settings_object);
|
||||
WebIDL::ExceptionOr<void> fetch_classic_script(GC::Ref<HTMLScriptElement>, URL::URL const&, EnvironmentSettingsObject& settings_object, ScriptFetchOptions options, CORSSettingAttribute cors_setting, String character_encoding, OnFetchScriptComplete on_complete);
|
||||
|
|
|
@ -147,7 +147,7 @@ WebIDL::ExceptionOr<ModuleSpecifierMap> sort_and_normalise_module_specifier_map(
|
|||
}
|
||||
|
||||
// 4. Let addressURL be the result of resolving a URL-like module specifier given value and baseURL.
|
||||
auto address_url = resolve_url_like_module_specifier(value.as_string().byte_string(), base_url);
|
||||
auto address_url = resolve_url_like_module_specifier(value.as_string().utf8_string_view(), base_url);
|
||||
|
||||
// 5. If addressURL is null, then:
|
||||
if (!address_url.has_value()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue