mirror of
https://github.com/servo/servo.git
synced 2025-07-03 05:23:38 +01:00
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:
parent
ef5e9b5f4d
commit
1bd8f38810
4 changed files with 38 additions and 30 deletions
|
@ -22,6 +22,8 @@ use crate::task_manager::TaskManager;
|
|||
/// doesn't implement TaskSource.
|
||||
#[derive(Clone, Copy, Debug, Eq, Hash, JSTraceable, MallocSizeOf, PartialEq, VariantArray)]
|
||||
pub(crate) enum TaskSourceName {
|
||||
/// <https://html.spec.whatwg.org/multipage/#bitmap-task-source>
|
||||
Bitmap,
|
||||
Canvas,
|
||||
Clipboard,
|
||||
DOMManipulation,
|
||||
|
@ -48,6 +50,7 @@ pub(crate) enum TaskSourceName {
|
|||
impl From<TaskSourceName> for ScriptThreadEventCategory {
|
||||
fn from(value: TaskSourceName) -> Self {
|
||||
match value {
|
||||
TaskSourceName::Bitmap => ScriptThreadEventCategory::ScriptEvent,
|
||||
TaskSourceName::Canvas => ScriptThreadEventCategory::ScriptEvent,
|
||||
TaskSourceName::Clipboard => ScriptThreadEventCategory::ScriptEvent,
|
||||
TaskSourceName::DOMManipulation => ScriptThreadEventCategory::ScriptEvent,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue