Skip to content

BREAKING(web-sys): Remove support for CanvasRenderingContext2D and BufferSource from createImageBitmap #3231

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

Merged
merged 1 commit into from
Jan 12, 2023

Conversation

Liamolucko
Copy link
Collaborator

Resolves #3227

Both APIs are broken, to some extent, which is why I think it makes sense to remove them despite the potential breakage.

Calling createImageBitmap with a BufferSource will instantly throw an error, and calling it with a CanvasRenderingContext2D will also fail except in Firefox, where it gives a deprecation warning.

BufferSource was there as part of the abandoned video capture worker API (https://w3c.github.io/mediacapture-worker). It looks like we inherited it from Firefox, which supported it behind a flag at the time we copied our WebIDL from it but later removed it. I also removed the rest of that API while I was at it.

CanvasRenderingContext2D is there because, for whatever reason, Firefox non-standardly accepts it in createImageBitmap, and we took our WebIDL from them. It's deprecated, and https://bugzilla.mozilla.org/show_bug.cgi?id=1500782 talks about removing it, but it hasn't been done yet.

…`BufferSource` from `createImageBitmap`

Resolves rustwasm#3227

Both APIs are broken, to some extent, which is why I think it makes sense to remove them despite the potential breakage. Calling `createImageBitmap` with a `BufferSource` will instantly throw an error, and calling it with a `CanvasRenderingContext2D` will also fail except in Firefox, where it gives a deprecation warning.

`BufferSource` was there as part of the abandoned video capture worker API (https://w3c.github.io/mediacapture-worker). It looks like we inherited it from Firefox, which supported it behind a flag at the time we copied our WebIDL from it but later removed it. I also removed the rest of that API while I was at it.

`CanvasRenderingContext2D` is there because, for whatever reason, Firefox non-standardly accepts it in `createImageBitmap`, and we took our WebIDL from them. It's deprecated, and https://bugzilla.mozilla.org/show_bug.cgi?id=1500782 talks about removing it, but it hasn't been done yet.
@alexcrichton
Copy link
Contributor

Sounds reasonable to me, thanks!

@alexcrichton alexcrichton merged commit 8f4c4d8 into rustwasm:main Jan 12, 2023
@Liamolucko Liamolucko deleted the broken-create-image-bitmap branch January 12, 2023 20:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Window::create_image_bitmap_with_canvas_rendering_context_2d throws error
2 participants