mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 01:35:08 +02:00
LibWeb/FileAPI: Make sure to always run the constructor steps for Blob
Previously we did not execute the constructor steps if we constructed a Blob from a ByteBuffer and a String. Though we only construct a Blob from ByteBuffer and String internally we still need to run these steps. By creating the new type 'BlobPartsOrByteBuffer' we can consolidate those two approaches to creating a Blob into our already existing constructor steps.
This commit is contained in:
committed by
Jelle Raaijmakers
parent
f9a54d6439
commit
a021134457
Notes:
github-actions[bot]
2025-09-03 19:45:09 +00:00
Author: https://github.com/kennethmyhra Commit: https://github.com/LadybirdBrowser/ladybird/commit/a0211344570 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6064 Reviewed-by: https://github.com/gmta ✅
@@ -43,7 +43,7 @@ GC::Ref<File> File::create(JS::Realm& realm)
|
||||
}
|
||||
|
||||
// https://w3c.github.io/FileAPI/#ref-for-dom-file-file
|
||||
WebIDL::ExceptionOr<GC::Ref<File>> File::create(JS::Realm& realm, Vector<BlobPart> const& file_bits, String const& file_name, Optional<FilePropertyBag> const& options)
|
||||
WebIDL::ExceptionOr<GC::Ref<File>> File::create(JS::Realm& realm, BlobParts const& file_bits, String const& file_name, Optional<FilePropertyBag> const& options)
|
||||
{
|
||||
auto& vm = realm.vm();
|
||||
|
||||
@@ -83,7 +83,7 @@ WebIDL::ExceptionOr<GC::Ref<File>> File::create(JS::Realm& realm, Vector<BlobPar
|
||||
return realm.create<File>(realm, move(bytes), move(name), move(type), last_modified);
|
||||
}
|
||||
|
||||
WebIDL::ExceptionOr<GC::Ref<File>> File::construct_impl(JS::Realm& realm, Vector<BlobPart> const& file_bits, String const& file_name, Optional<FilePropertyBag> const& options)
|
||||
WebIDL::ExceptionOr<GC::Ref<File>> File::construct_impl(JS::Realm& realm, BlobParts const& file_bits, String const& file_name, Optional<FilePropertyBag> const& options)
|
||||
{
|
||||
return create(realm, file_bits, file_name, options);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user