mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 01:35:08 +02:00
LibWeb: Always return task's ID after adding to a queue (or not)
Now that we don't always honor requests to add tasks to a queue, we can't rely on "last added task" as the place to find the task's ID. Fortunately we can just get it from the task itself.
This commit is contained in:
committed by
Andreas Kling
parent
418a243c04
commit
ade167ed33
Notes:
github-actions[bot]
2025-12-27 15:42:06 +00:00
Author: https://github.com/awesomekling Commit: https://github.com/LadybirdBrowser/ladybird/commit/ade167ed331 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/7244 Reviewed-by: https://github.com/Zaggy1024 Reviewed-by: https://github.com/shannonbooth
@@ -559,7 +559,7 @@ TaskID queue_a_task(HTML::Task::Source source, GC::Ptr<EventLoop> event_loop, GC
|
||||
// 9. Append task to queue.
|
||||
queue.add(task);
|
||||
|
||||
return queue.last_added_task()->id();
|
||||
return task->id();
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-global-task
|
||||
@@ -595,7 +595,7 @@ void queue_a_microtask(DOM::Document const* document, GC::Ref<GC::Function<void(
|
||||
// FIXME: 7. Set microtask's script evaluation environment settings object set to an empty set.
|
||||
|
||||
// 8. Enqueue microtask on event loop's microtask queue.
|
||||
event_loop.microtask_queue().enqueue(microtask);
|
||||
(void)event_loop.microtask_queue().enqueue(microtask);
|
||||
}
|
||||
|
||||
void perform_a_microtask_checkpoint()
|
||||
|
||||
Reference in New Issue
Block a user