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

@ -132,6 +132,7 @@ impl TaskManager {
.cancel_pending_tasks_for_source(task_source_name);
}
task_source_functions!(self, bitmap_task_source, Bitmap);
task_source_functions!(self, canvas_blob_task_source, Canvas);
task_source_functions!(self, clipboard_task_source, Clipboard);
task_source_functions!(self, dom_manipulation_task_source, DOMManipulation);