-
Notifications
You must be signed in to change notification settings - Fork 22.5k
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 usage notes to OffscreenCanvas.transferToImageBitmap. #28019
Conversation
Some web developers have noted that transferToImageBitmap can be confusing and lead to application bugs; crbug.com/1457212 is one recent example. Add a section describing the necessity to either consume or close the ImageBitmap this API creates, and mention an alternative.
Preview URLs (comment last updated: 2023-07-20 22:23:34) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not place this in the transferToImageBitmap
page? Should be more immediately discoverable.
Thanks for the suggestion - have moved the new text there. Added a mention in the top-level docs, since people skimming just |
@Josh-Cena @sideshowbarker would you be able to (re-)review this? We received feedback from a web developer that they'd like these clarifications. Thanks. |
files/en-us/web/api/offscreencanvas/transfertoimagebitmap/index.md
Outdated
Show resolved
Hide resolved
files/en-us/web/api/offscreencanvas/transfertoimagebitmap/index.md
Outdated
Show resolved
Hide resolved
Thank you! |
Cheers — it’s really great to see a change go in like this one that directly addresses some specific developer frustration/confusion |
Description
Add usage notes to OffscreenCanvas.transferToImageBitmap regarding the ImageBitmap's lifetime.
Reference these notes from the top-level OffscreenCanvas documentation.
Motivation
Some web developers have noted that transferToImageBitmap can be confusing and lead to application bugs; crbug.com/1457212 is one recent example. Add more details to the API doc describing the necessity to either
consume or close the ImageBitmap this API creates, and mention an alternative.
Additional details
crbug.com/1457212 contains a minimized test case from a Chromium customer which was incorrect and which
led to application instability. The customer noted that they used MDN's OffscreenCanvas documentation as a
primary source of information, and requested that the documentation be expanded with this information.
Related issues and pull requests
None