mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-30 11:37:16 +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 ✅
@@ -25,7 +25,7 @@ namespace Web::HTML {
|
||||
HTMLFormElement::HTMLFormElement(DOM::Document& document, DOM::QualifiedName qualified_name)
|
||||
: HTMLElement(document, move(qualified_name))
|
||||
{
|
||||
set_prototype(&window().cached_web_prototype("HTMLFormElement"));
|
||||
set_prototype(&Bindings::cached_web_prototype(realm(), "HTMLFormElement"));
|
||||
}
|
||||
|
||||
HTMLFormElement::~HTMLFormElement() = default;
|
||||
@@ -73,7 +73,7 @@ void HTMLFormElement::submit_form(JS::GCPtr<HTMLElement> submitter, bool from_su
|
||||
|
||||
SubmitEventInit event_init {};
|
||||
event_init.submitter = submitter_button;
|
||||
auto submit_event = SubmitEvent::create(document().window(), EventNames::submit, event_init);
|
||||
auto submit_event = SubmitEvent::create(realm(), EventNames::submit, event_init);
|
||||
submit_event->set_bubbles(true);
|
||||
submit_event->set_cancelable(true);
|
||||
bool continue_ = dispatch_event(*submit_event);
|
||||
|
||||
Reference in New Issue
Block a user