-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add bytes() method to Blob for reading bytes into a Uint8Array #198
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
marcoscaceres
changed the title
Add bytes() method for reading bytes into a Uint8Array
Add bytes() method to Blob for reading bytes into a Uint8Array
May 21, 2024
4 tasks
This was referenced May 21, 2024
annevk
approved these changes
May 24, 2024
webkit-commit-queue
pushed a commit
to annevk/WebKit
that referenced
this pull request
May 24, 2024
https://bugs.webkit.org/show_bug.cgi?id=274119 rdar://128418858 Reviewed by Youenn Fablet. This implements w3c/FileAPI#198 and w3c/push-api#370 creating parity for these APIs with Fetch's Body. This incorporates the tests from web-platform-tests/wpt#46232 modulo a typo fix. PushMessageData test coverage is done through a local test that would be good to upstream at some point. * LayoutTests/http/wpt/push-api/pushEvent.any.js: (test): * LayoutTests/imported/w3c/web-platform-tests/FileAPI/Blob-methods-from-detached-frame-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/FileAPI/Blob-methods-from-detached-frame.html: * LayoutTests/imported/w3c/web-platform-tests/FileAPI/blob/Blob-bytes.any-expected.txt: Added. * LayoutTests/imported/w3c/web-platform-tests/FileAPI/blob/Blob-bytes.any.html: Added. * LayoutTests/imported/w3c/web-platform-tests/FileAPI/blob/Blob-bytes.any.js: Added. (string_appeared_here.promise_test.async const): * LayoutTests/imported/w3c/web-platform-tests/FileAPI/blob/Blob-bytes.any.worker-expected.txt: Added. * LayoutTests/imported/w3c/web-platform-tests/FileAPI/blob/Blob-bytes.any.worker.html: Added. * LayoutTests/imported/w3c/web-platform-tests/FileAPI/blob/w3c-import.log: * Source/WebCore/Modules/push-api/PushMessageData.cpp: (WebCore::PushMessageData::arrayBuffer): (WebCore::PushMessageData::bytes): * Source/WebCore/Modules/push-api/PushMessageData.h: * Source/WebCore/Modules/push-api/PushMessageData.idl: * Source/WebCore/fileapi/Blob.cpp: (WebCore::Blob::arrayBuffer): (WebCore::Blob::bytes): * Source/WebCore/fileapi/Blob.h: * Source/WebCore/fileapi/Blob.idl: Canonical link: https://commits.webkit.org/279263@main
This is off topic, should we split implementation commitment to implementor interest and implementation bugs? The single list wasn't fully clear in some cases (some people thought it's enough to have bugs filed). |
Makes sense. The WHATWG template is quite a bit clearer. |
github-actions bot
added a commit
that referenced
this pull request
May 24, 2024
SHA: 85b18bc Reason: push, by mkruisselbrink Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Well I do support this, but you still need to ask people? (edit: Oh there was Tom. web-platform-tests/wpt#46232 (comment)) |
annevk
pushed a commit
to web-platform-tests/wpt
that referenced
this pull request
May 24, 2024
moz-v2v-gh
pushed a commit
to mozilla/gecko-dev
that referenced
this pull request
Jun 3, 2024
…testonly Automatic update from web-platform-tests Add tests for Blob.prototype.bytes() For w3c/FileAPI#198. -- wpt-commits: cceaf3628da950621004d9b5d8c1d1f367073347 wpt-pr: 46232
ErichDonGubler
pushed a commit
to erichdongubler-mozilla/firefox
that referenced
this pull request
Jun 5, 2024
…testonly Automatic update from web-platform-tests Add tests for Blob.prototype.bytes() For w3c/FileAPI#198. -- wpt-commits: cceaf3628da950621004d9b5d8c1d1f367073347 wpt-pr: 46232
4 tasks
i3roly
pushed a commit
to i3roly/firefox-dynasty
that referenced
this pull request
Jun 14, 2024
…testonly Automatic update from web-platform-tests Add tests for Blob.prototype.bytes() For w3c/FileAPI#198. -- wpt-commits: cceaf3628da950621004d9b5d8c1d1f367073347 wpt-pr: 46232
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #197
The Fetch API is getting a
Uint8Array
-returningbytes()
method alongside its existingarrayBuffer()
method, following the principle that APIs should generally vend byte buffers asUint8Array
s.This PR makes the same change for
Blob
, which has its own distinctarrayBuffer
method.I'm assuming this is uncontroversial given the support from the three major implementations for doing this on
Body
, but I can open an issue and solicit explicit support separately if you'd prefer.I'll write tests if I get a signal that this is able to go forward.Tests written, see link.Implementation commitment:
Preview | Diff