mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 20:27:45 +00:00
LibWeb: Make queue_an_element_task() use JS::SafeFunction
This commit is contained in:
parent
2ccb9bef49
commit
874e64d664
2 changed files with 3 additions and 5 deletions
|
@ -552,11 +552,9 @@ void Element::make_html_uppercased_qualified_name()
|
|||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/webappapis.html#queue-an-element-task
|
||||
void Element::queue_an_element_task(HTML::Task::Source source, Function<void()> steps)
|
||||
void Element::queue_an_element_task(HTML::Task::Source source, JS::SafeFunction<void()> steps)
|
||||
{
|
||||
auto task = HTML::Task::create(source, &document(), [strong_this = JS::make_handle(*this), steps = move(steps)] {
|
||||
steps();
|
||||
});
|
||||
auto task = HTML::Task::create(source, &document(), move(steps));
|
||||
HTML::main_thread_event_loop().task_queue().add(move(task));
|
||||
}
|
||||
|
||||
|
|
|
@ -122,7 +122,7 @@ public:
|
|||
void set_custom_properties(HashMap<FlyString, CSS::StyleProperty> custom_properties) { m_custom_properties = move(custom_properties); }
|
||||
HashMap<FlyString, CSS::StyleProperty> const& custom_properties() const { return m_custom_properties; }
|
||||
|
||||
void queue_an_element_task(HTML::Task::Source, Function<void()>);
|
||||
void queue_an_element_task(HTML::Task::Source, JS::SafeFunction<void()>);
|
||||
|
||||
bool is_void_element() const;
|
||||
bool serializes_as_void() const;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue