summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb
diff options
context:
space:
mode:
authorLinus Groh <mail@linusgroh.de>2023-03-04 22:41:57 +0000
committerLinus Groh <mail@linusgroh.de>2023-03-04 22:42:42 +0000
commitf65cbeef5c9cad950f52700d77642e3ddbdc241f (patch)
tree3c7c08ba27e1be9000f6239b1d7a66bff948f4e5 /Userland/Libraries/LibWeb
parent85507b34d72752efb8ecc68c4fe920bf67b1895a (diff)
downloadserenity-f65cbeef5c9cad950f52700d77642e3ddbdc241f.zip
LibWeb/Infra: Rename to_ascii_{{lower,upper}_case => {lower,upper}case}
Diffstat (limited to 'Userland/Libraries/LibWeb')
-rw-r--r--Userland/Libraries/LibWeb/FileAPI/Blob.cpp4
-rw-r--r--Userland/Libraries/LibWeb/FileAPI/File.cpp2
-rw-r--r--Userland/Libraries/LibWeb/Infra/Strings.cpp10
-rw-r--r--Userland/Libraries/LibWeb/Infra/Strings.h4
-rw-r--r--Userland/Libraries/LibWeb/MimeSniff/MimeType.cpp4
5 files changed, 12 insertions, 12 deletions
diff --git a/Userland/Libraries/LibWeb/FileAPI/Blob.cpp b/Userland/Libraries/LibWeb/FileAPI/Blob.cpp
index 2ae09d9716..b45da63bd3 100644
--- a/Userland/Libraries/LibWeb/FileAPI/Blob.cpp
+++ b/Userland/Libraries/LibWeb/FileAPI/Blob.cpp
@@ -169,7 +169,7 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<Blob>> Blob::create(JS::Realm& realm, Optio
// 2. Convert every character in t to ASCII lowercase.
if (!type.is_empty())
- type = TRY_OR_THROW_OOM(vm, Infra::to_ascii_lower_case(type));
+ type = TRY_OR_THROW_OOM(vm, Infra::to_ascii_lowercase(type));
}
// 4. Return a Blob object referring to bytes as its associated byte sequence, with its size set to the length of bytes, and its type set to the value of t from the substeps above.
@@ -233,7 +233,7 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<Blob>> Blob::slice(Optional<i64> start, Opt
// FIXME: 1. If relativeContentType contains any characters outside the range of U+0020 to U+007E, then set relativeContentType to the empty string and return from these substeps.
// 2. Convert every character in relativeContentType to ASCII lowercase.
- relative_content_type = TRY_OR_THROW_OOM(vm, Infra::to_ascii_lower_case(content_type.value()));
+ relative_content_type = TRY_OR_THROW_OOM(vm, Infra::to_ascii_lowercase(content_type.value()));
}
// 4. Let span be max((relativeEnd - relativeStart), 0).
diff --git a/Userland/Libraries/LibWeb/FileAPI/File.cpp b/Userland/Libraries/LibWeb/FileAPI/File.cpp
index f5b1893ef4..15b7507f05 100644
--- a/Userland/Libraries/LibWeb/FileAPI/File.cpp
+++ b/Userland/Libraries/LibWeb/FileAPI/File.cpp
@@ -55,7 +55,7 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<File>> File::create(JS::Realm& realm, Vecto
// 2. Convert every character in t to ASCII lowercase.
if (!type.is_empty())
- type = TRY_OR_THROW_OOM(vm, Infra::to_ascii_lower_case(type));
+ type = TRY_OR_THROW_OOM(vm, Infra::to_ascii_lowercase(type));
// 3. If the lastModified member is provided, let d be set to the lastModified dictionary member. If it is not provided, set d to the current date and time represented as the number of milliseconds since the Unix Epoch (which is the equivalent of Date.now() [ECMA-262]).
// Note: Since ECMA-262 Date objects convert to long long values representing the number of milliseconds since the Unix Epoch, the lastModified member could be a Date object [ECMA-262].
diff --git a/Userland/Libraries/LibWeb/Infra/Strings.cpp b/Userland/Libraries/LibWeb/Infra/Strings.cpp
index 726caddd47..09e7c2ad23 100644
--- a/Userland/Libraries/LibWeb/Infra/Strings.cpp
+++ b/Userland/Libraries/LibWeb/Infra/Strings.cpp
@@ -33,7 +33,7 @@ bool is_ascii_case_insensitive_match(StringView a, StringView b)
auto b_char = *b_iterator;
++b_iterator;
- if (to_ascii_lowercase(a_char) != to_ascii_lowercase(b_char))
+ if (AK::to_ascii_lowercase(a_char) != AK::to_ascii_lowercase(b_char))
return false;
}
@@ -107,28 +107,28 @@ ErrorOr<String> convert_to_scalar_value_string(StringView string)
}
// https://infra.spec.whatwg.org/#ascii-lowercase
-ErrorOr<String> to_ascii_lower_case(StringView string)
+ErrorOr<String> to_ascii_lowercase(StringView string)
{
// To ASCII lowercase a string, replace all ASCII upper alphas in the string with their
// corresponding code point in ASCII lower alpha.
StringBuilder string_builder;
auto utf8_view = Utf8View { string };
for (u32 code_point : utf8_view) {
- code_point = to_ascii_lowercase(code_point);
+ code_point = AK::to_ascii_lowercase(code_point);
TRY(string_builder.try_append(code_point));
}
return string_builder.to_string();
}
// https://infra.spec.whatwg.org/#ascii-uppercase
-ErrorOr<String> to_ascii_upper_case(StringView string)
+ErrorOr<String> to_ascii_uppercase(StringView string)
{
// To ASCII uppercase a string, replace all ASCII lower alphas in the string with their
// corresponding code point in ASCII upper alpha.
StringBuilder string_builder;
auto utf8_view = Utf8View { string };
for (u32 code_point : utf8_view) {
- code_point = to_ascii_uppercase(code_point);
+ code_point = AK::to_ascii_uppercase(code_point);
TRY(string_builder.try_append(code_point));
}
return string_builder.to_string();
diff --git a/Userland/Libraries/LibWeb/Infra/Strings.h b/Userland/Libraries/LibWeb/Infra/Strings.h
index 896c2b6b38..7712f19dfa 100644
--- a/Userland/Libraries/LibWeb/Infra/Strings.h
+++ b/Userland/Libraries/LibWeb/Infra/Strings.h
@@ -17,7 +17,7 @@ bool is_ascii_case_insensitive_match(StringView a, StringView b);
DeprecatedString strip_and_collapse_whitespace(StringView string);
bool is_code_unit_prefix(StringView potential_prefix, StringView input);
ErrorOr<String> convert_to_scalar_value_string(StringView string);
-ErrorOr<String> to_ascii_lower_case(StringView string);
-ErrorOr<String> to_ascii_upper_case(StringView string);
+ErrorOr<String> to_ascii_lowercase(StringView string);
+ErrorOr<String> to_ascii_uppercase(StringView string);
}
diff --git a/Userland/Libraries/LibWeb/MimeSniff/MimeType.cpp b/Userland/Libraries/LibWeb/MimeSniff/MimeType.cpp
index c206c1cbd3..ff2dd711f5 100644
--- a/Userland/Libraries/LibWeb/MimeSniff/MimeType.cpp
+++ b/Userland/Libraries/LibWeb/MimeSniff/MimeType.cpp
@@ -105,7 +105,7 @@ ErrorOr<Optional<MimeType>> MimeType::parse(StringView string)
return OptionalNone {};
// 10. Let mimeType be a new MIME type record whose type is type, in ASCII lowercase, and subtype is subtype, in ASCII lowercase.
- auto mime_type = TRY(MimeType::create(TRY(Infra::to_ascii_lower_case(type)), TRY(Infra::to_ascii_lower_case(subtype))));
+ auto mime_type = TRY(MimeType::create(TRY(Infra::to_ascii_lowercase(type)), TRY(Infra::to_ascii_lowercase(subtype))));
// 11. While position is not past the end of input:
while (!lexer.is_eof()) {
@@ -121,7 +121,7 @@ ErrorOr<Optional<MimeType>> MimeType::parse(StringView string)
});
// 4. Set parameterName to parameterName, in ASCII lowercase.
- auto parameter_name = TRY(Infra::to_ascii_lower_case(parameter_name_view));
+ auto parameter_name = TRY(Infra::to_ascii_lowercase(parameter_name_view));
// 5. If position is not past the end of input, then:
if (!lexer.is_eof()) {