mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 11:49:44 +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:
parent
6a85677f70
commit
05b4676917
Notes:
github-actions[bot]
2024-12-02 23:20:48 +00:00
Author: https://github.com/shannonbooth
Commit: 05b4676917
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2702
Reviewed-by: https://github.com/gmta ✅
6 changed files with 11 additions and 12 deletions
|
@ -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)] {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue