mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-19 22:49:47 +00: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:
parent
f9a54d6439
commit
a021134457
Notes:
github-actions[bot]
2025-09-03 19:45:09 +00:00
Author: https://github.com/kennethmyhra
Commit: a021134457
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6064
Reviewed-by: https://github.com/gmta ✅
4 changed files with 27 additions and 15 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue