LibWeb: Let queue_a_microtask() take a JS::HeapFunction

This changes the signature of queue_a_microtask() from AK:Function to
JS::HeapFunction to be more clear to the user of the functions that this
is what is used internally.
This commit is contained in:
Kenneth Myhra 2024-04-13 16:32:39 +02:00 committed by Andreas Kling
parent 76ba374aef
commit d5c7959c45
Notes: sideshowbarker 2024-07-17 06:40:21 +09:00
8 changed files with 22 additions and 21 deletions

View file

@ -422,7 +422,7 @@ ErrorOr<void> HTMLImageElement::update_the_image_data(bool restart_animations, b
}
after_step_7:
// 8. Queue a microtask to perform the rest of this algorithm, allowing the task that invoked this algorithm to continue.
queue_a_microtask(&document(), [this, restart_animations, maybe_omit_events, previous_url]() mutable {
queue_a_microtask(&document(), JS::create_heap_function(this->heap(), [this, restart_animations, maybe_omit_events, previous_url]() mutable {
// FIXME: 9. If another instance of this algorithm for this img element was started after this instance
// (even if it aborted and is no longer running), then return.
@ -572,7 +572,7 @@ after_step_7:
}
image_request->fetch_image(realm(), request);
});
}));
return {};
}