-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Window::create_image_bitmap_with_canvas_rendering_context_2d throws error #3227
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
Comments
My reading of this is that |
Yeah, that shouldn't be there. It's there because The Promise<ImageBitmap> createImageBitmap (BufferSource buffer, long offset, long length, ImageFormat format, ImagePixelLayout layout); It doesn't seem like that standard ever really went anywhere, either (the repo is archived). So, I think they should both be removed. That is of course a breaking change, but I think it makes sense to do since any attempt to use them wouldn't work anyway (cc @alexcrichton). |
…`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.
…`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.
…`BufferSource` from `createImageBitmap` (#3231) 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.
Uh oh!
There was an error while loading. Please reload this page.
Describe the Bug
I wanted to conveniently create an
ImageBitmap
fromCanvasRenderingContext2d
. When I foundWindow::create_image_bitmap_with_canvas_rendering_context_2d
, I expected that it's a convenience method for doing so.However, when I used it, I received the following error:
Steps to Reproduce
The code above is an incomplete implementation of a function relying on
Window::create_image_bitmap_with_canvas_rendering_context_2d
.Expected Behavior
Window::create_image_bitmap_with_canvas_rendering_context_2d
should either be removed or be functionalActual Behavior
Results in an error.
Additional Context
No additional context.
The text was updated successfully, but these errors were encountered: