mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 08:36:15 +00:00
LibWeb: Remove unecessary dependence on Window from HTML classes
These classes only needed Window to get at its realm. Pass a realm directly to construct HTML classes.
This commit is contained in:
committed by
Linus Groh
parent
a2ccb00e1d
commit
f0c5f77f99
@@ -124,7 +124,7 @@ JS::Completion ClassicScript::run(RethrowErrors rethrow_errors)
|
||||
dbgln("network error");
|
||||
|
||||
// 2. Throw a "NetworkError" DOMException.
|
||||
return throw_completion(WebIDL::NetworkError::create(settings.global_object(), "Script error."));
|
||||
return throw_completion(WebIDL::NetworkError::create(settings.realm(), "Script error."));
|
||||
}
|
||||
|
||||
// 3. Otherwise, rethrow errors is false. Perform the following steps:
|
||||
|
||||
@@ -219,7 +219,7 @@ void EnvironmentSettingsObject::notify_about_rejected_promises(Badge<EventLoop>)
|
||||
// FIXME: This currently assumes that global is a WindowObject.
|
||||
auto& window = verify_cast<HTML::Window>(global);
|
||||
|
||||
auto promise_rejection_event = PromiseRejectionEvent::create(window, HTML::EventNames::unhandledrejection, event_init);
|
||||
auto promise_rejection_event = PromiseRejectionEvent::create(window.realm(), HTML::EventNames::unhandledrejection, event_init);
|
||||
|
||||
bool not_handled = window.dispatch_event(*promise_rejection_event);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user