createImageBitmap throws not enough arguments exception incorrectly
Categories
(Core :: Graphics: Canvas2D, defect, P3)
Tracking
()
People
(Reporter: germain, Unassigned)
Details
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:65.0) Gecko/20100101 Firefox/65.0
Steps to reproduce:
I ran the following snippet:
fetch("https://placekitten.com/g/640/360")
.then(response => response.blob())
.then(blob => createImageBitmap(blob, { imageOrientation: "flipY"}));
Tested only on Firefox Desktop, v65 and on Nightly too
Actual results:
I received an exception
TypeError: "Not enough arguments to Window.createImageBitmap."
Expected results:
From what I understand reading through the createImageBitmap
spec, https://html.spec.whatwg.org/multipage/imagebitmap-and-animations.html, we should be able to use all the following ways to call that function:
1 - createImageBitmap(image)
2 - createImageBitmap(image, options)
3 - createImageBitmap(image, 0, 0, 640, 360)
4 - createImageBitmap(image, 0, 0, 640, 360, options)
It looks to me that Firefox does not support the use case 2.
Hi reporter,
Thank you for taking the time to report this.
I can reproduce the behavior mentioned above when I run it with the release build (20190225143501) or DevEdition build( 20190307095232). When I run the snippet in Nightly (20190312095443), the error that I receive is: "TypeError: 2 is not a valid argument count for any overload of Window.createImageBitmap."
I'm going to add this to Core: Canvas 2D for an advised input. If this is not the proper component, feel free to change it to a more appropriate one.
Comment 2•6 years ago
|
||
Looks like support for this is missing:
Comment 3•6 years ago
|
||
I hope I will get around to this given the opportunity. Links to the WHATWG standards below.
https://html.spec.whatwg.org/multipage/imagebitmap-and-animations.html#dom-createimagebitmap
https://html.spec.whatwg.org/multipage/imagebitmap-and-animations.html#imagebitmapoptions
If anybody feels confident though, feel free to do it.
Updated•5 years ago
|
Updated•5 years ago
|
Description
•