mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-28 02:27:19 +02: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
Notes:
sideshowbarker
2024-07-17 06:28:27 +09:00
Author: https://github.com/ADKaster Commit: https://github.com/SerenityOS/serenity/commit/f0c5f77f99 Pull-request: https://github.com/SerenityOS/serenity/pull/15349 Reviewed-by: https://github.com/linusg ✅
@@ -16,7 +16,7 @@ namespace Web::HTML {
|
||||
HTMLIFrameElement::HTMLIFrameElement(DOM::Document& document, DOM::QualifiedName qualified_name)
|
||||
: BrowsingContextContainer(document, move(qualified_name))
|
||||
{
|
||||
set_prototype(&document.window().cached_web_prototype("HTMLIFrameElement"));
|
||||
set_prototype(&Bindings::cached_web_prototype(realm(), "HTMLIFrameElement"));
|
||||
}
|
||||
|
||||
HTMLIFrameElement::~HTMLIFrameElement() = default;
|
||||
@@ -144,7 +144,7 @@ void run_iframe_load_event_steps(HTML::HTMLIFrameElement& element)
|
||||
// FIXME: 4. Set childDocument's iframe load in progress flag.
|
||||
|
||||
// 5. Fire an event named load at element.
|
||||
element.dispatch_event(*DOM::Event::create(element.document().window(), HTML::EventNames::load));
|
||||
element.dispatch_event(*DOM::Event::create(element.realm(), HTML::EventNames::load));
|
||||
|
||||
// FIXME: 6. Unset childDocument's iframe load in progress flag.
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user