LibWeb: Use queue_a_task() function to queue an element task

Remove direct usage of task_queue() and use a helper function instead
This commit is contained in:
Timur Sultanov 2024-07-24 22:31:06 +04:00 committed by Andreas Kling
commit d1a7caa35d
Notes: github-actions[bot] 2024-07-25 14:59:25 +00:00

View file

@ -856,12 +856,7 @@ void Element::make_html_uppercased_qualified_name()
// https://html.spec.whatwg.org/multipage/webappapis.html#queue-an-element-task // https://html.spec.whatwg.org/multipage/webappapis.html#queue-an-element-task
int Element::queue_an_element_task(HTML::Task::Source source, Function<void()> steps) int Element::queue_an_element_task(HTML::Task::Source source, Function<void()> steps)
{ {
auto task = HTML::Task::create(vm(), source, &document(), JS::create_heap_function(heap(), move(steps))); return queue_a_task(source, HTML::main_thread_event_loop(), document(), JS::create_heap_function(heap(), move(steps)));
auto id = task->id();
HTML::main_thread_event_loop().task_queue().add(move(task));
return id;
} }
// https://html.spec.whatwg.org/multipage/syntax.html#void-elements // https://html.spec.whatwg.org/multipage/syntax.html#void-elements