imagebitmap: Resolve promise with ImageBitmap on bitmap task source (#37488)

Follow the ImageBitmap specification and use the global scope bitmap
task source
to fulfill resolved promise (asynchronously). 
https://html.spec.whatwg.org/multipage/#bitmap-task-source

Any promise rejection must be done synchronously.

Testing: Improvements in the following WPT test
-
html/canvas/element/manual/imagebitmap/createImageBitmap-resolves-in-task.any.js

Fixes (partially): #34112

Signed-off-by: Andrei Volykhin <andrei.volykhin@gmail.com>
This commit is contained in:
Andrei Volykhin 2025-06-17 11:19:32 +03:00 committed by GitHub
parent ef5e9b5f4d
commit 1bd8f38810
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 38 additions and 30 deletions

View file

@ -1,16 +1,10 @@
[createImageBitmap-resolves-in-task.any.html]
[createImageBitmap with an HTMLCanvasElement source should resolve async]
expected: FAIL
[createImageBitmap with an HTMLVideoElement source should resolve async]
expected: FAIL
[createImageBitmap with an HTMLVideoElement from a data URL source should resolve async]
expected: FAIL
[createImageBitmap with a bitmap HTMLImageElement source should resolve async]
expected: FAIL
[createImageBitmap with a vector HTMLImageElement source should resolve async]
expected: FAIL
@ -32,28 +26,10 @@
[createImageBitmap with a vector SVGImageElement source should resolve async]
expected: FAIL
[createImageBitmap with an OffscreenCanvas source should resolve async]
expected: FAIL
[createImageBitmap with an ImageData source should resolve async]
expected: FAIL
[createImageBitmap with an ImageBitmap source should resolve async]
expected: FAIL
[createImageBitmap with a Blob source should resolve async]
expected: FAIL
[createImageBitmap-resolves-in-task.any.worker.html]
[createImageBitmap with an OffscreenCanvas source should resolve async]
expected: FAIL
[createImageBitmap with an ImageData source should resolve async]
expected: FAIL
[createImageBitmap with an ImageBitmap source should resolve async]
expected: FAIL
[createImageBitmap with a Blob source should resolve async]
expected: FAIL