mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-04 15:19:42 +00:00
AK+LibWeb: Add {Fly,}String::to_ascii_{upper,lower}_case()
These don't have to worry about the input not being valid UTF-8 and so can be infallible (and can even return self if no changes needed.) We use this instead of Infra::to_ascii_{upper,lower}_case in LibWeb.
This commit is contained in:
parent
dd419b5a8d
commit
073bcfd386
Notes:
github-actions[bot]
2024-10-14 18:49:00 +00:00
Author: https://github.com/awesomekling
Commit: 073bcfd386
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1796
16 changed files with 147 additions and 13 deletions
|
@ -76,7 +76,7 @@ WebIDL::ExceptionOr<JS::GCPtr<DataTransferItem>> DataTransferItemList::add(Strin
|
|||
// method's first argument.
|
||||
auto item = m_data_transfer->add_item({
|
||||
.kind = HTML::DragDataStoreItem::Kind::Text,
|
||||
.type_string = MUST(Infra::to_ascii_lowercase(type)),
|
||||
.type_string = type.to_ascii_lowercase(),
|
||||
.data = MUST(ByteBuffer::copy(data.bytes())),
|
||||
.file_name = {},
|
||||
});
|
||||
|
@ -100,7 +100,7 @@ JS::GCPtr<DataTransferItem> DataTransferItemList::add(JS::NonnullGCPtr<FileAPI::
|
|||
// converted to ASCII lowercase, and whose data is the same as the File's data.
|
||||
auto item = m_data_transfer->add_item({
|
||||
.kind = HTML::DragDataStoreItem::Kind::File,
|
||||
.type_string = MUST(Infra::to_ascii_lowercase(file->type())),
|
||||
.type_string = file->type().to_ascii_lowercase(),
|
||||
.data = MUST(ByteBuffer::copy(file->raw_bytes())),
|
||||
.file_name = file->name().to_byte_string(),
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue