mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-03 23:25:20 +00:00
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:
committed by
Andreas Kling
parent
6a85677f70
commit
05b4676917
@@ -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)] {
|
||||
|
||||
Reference in New Issue
Block a user