diff --git a/Userland/Libraries/LibWeb/FileAPI/Blob.cpp b/Userland/Libraries/LibWeb/FileAPI/Blob.cpp index e894318370..ce203bc97f 100644 --- a/Userland/Libraries/LibWeb/FileAPI/Blob.cpp +++ b/Userland/Libraries/LibWeb/FileAPI/Blob.cpp @@ -252,6 +252,13 @@ WebIDL::ExceptionOr> Blob::slice(Optional start, Opt return MUST_OR_THROW_OOM(heap().allocate(realm(), realm(), move(byte_buffer), move(relative_content_type))); } +// https://w3c.github.io/FileAPI/#dom-blob-stream +WebIDL::ExceptionOr> Blob::stream() +{ + // The stream() method, when invoked, must return the result of calling get stream on this. + return this->get_stream(); +} + // https://w3c.github.io/FileAPI/#blob-get-stream WebIDL::ExceptionOr> Blob::get_stream() { diff --git a/Userland/Libraries/LibWeb/FileAPI/Blob.h b/Userland/Libraries/LibWeb/FileAPI/Blob.h index 33cadebce8..0a66177ce7 100644 --- a/Userland/Libraries/LibWeb/FileAPI/Blob.h +++ b/Userland/Libraries/LibWeb/FileAPI/Blob.h @@ -43,6 +43,7 @@ public: WebIDL::ExceptionOr> slice(Optional start = {}, Optional end = {}, Optional const& content_type = {}); + WebIDL::ExceptionOr> stream(); WebIDL::ExceptionOr> text(); JS::Promise* array_buffer(); diff --git a/Userland/Libraries/LibWeb/FileAPI/Blob.idl b/Userland/Libraries/LibWeb/FileAPI/Blob.idl index a864872b7e..3369a7de94 100644 --- a/Userland/Libraries/LibWeb/FileAPI/Blob.idl +++ b/Userland/Libraries/LibWeb/FileAPI/Blob.idl @@ -9,6 +9,7 @@ interface Blob { Blob slice(optional long long start, optional long long end, optional DOMString contentType); // read from the Blob. + [NewObject] ReadableStream stream(); [NewObject] Promise text(); [NewObject] Promise arrayBuffer(); };