LibWeb: Ensure global objects are an event target

All global objects current need to be event targets so that they
can have events dispatched to them. This allows for removing of
verify_cast for these global objects.
This commit is contained in:
Shannon Booth 2024-12-03 02:37:33 +13:00 committed by Andreas Kling
commit 05b4676917
Notes: github-actions[bot] 2024-12-02 23:20:48 +00:00
6 changed files with 11 additions and 12 deletions

View file

@ -198,8 +198,7 @@ void UniversalGlobalScopeMixin::notify_about_rejected_promises(Badge<EventLoop>)
m_about_to_be_notified_rejected_promises_list.clear();
// 4. Let global be settings object's global object.
// We need this as an event target for the unhandledrejection event below
auto& global = verify_cast<DOM::EventTarget>(this_impl());
auto& global = this_impl();
// 5. Queue a global task on the DOM manipulation task source given global to run the following substep:
queue_global_task(Task::Source::DOMManipulation, global, GC::create_function(realm.heap(), [this, &global, list = move(list)] {