Closed Bug 1533680 Opened 6 years ago Closed 5 years ago

createImageBitmap throws not enough arguments exception incorrectly

Categories

(Core :: Graphics: Canvas2D, defect, P3)

65 Branch
defect

Tracking

()

RESOLVED DUPLICATE of bug 1335594

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.

Status: UNCONFIRMED → NEW
Component: Untriaged → Canvas: 2D
Ever confirmed: true
Product: Firefox → Core

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.

Severity: normal → enhancement
Flags: needinfo?(aosmond)
Priority: -- → P3
Depends on: 1367251
Status: NEW → RESOLVED
Closed: 5 years ago
No longer depends on: 1367251
Resolution: --- → DUPLICATE
Flags: needinfo?(aosmond)
You need to log in before you can comment on or make changes to this bug.