summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/HTML/HTMLElement.cpp
diff options
context:
space:
mode:
authorAndrew Kaster <akaster@serenityos.org>2022-09-25 18:06:11 -0600
committerLinus Groh <mail@linusgroh.de>2022-10-01 21:05:32 +0100
commit6a103527122592501c9f86283a2abf70bd828d56 (patch)
tree34e8bb455d10dfd62877f8db81e838430ace0af5 /Userland/Libraries/LibWeb/HTML/HTMLElement.cpp
parentd0efc7734aba153934a565fad240e3a586de5afb (diff)
downloadserenity-6a103527122592501c9f86283a2abf70bd828d56.zip
LibWeb: Remove unecessary dependence on Window from UIEvents classes
These classes only needed Window to get at its realm. Pass a realm directly to construct UIEvents classes.
Diffstat (limited to 'Userland/Libraries/LibWeb/HTML/HTMLElement.cpp')
-rw-r--r--Userland/Libraries/LibWeb/HTML/HTMLElement.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/Userland/Libraries/LibWeb/HTML/HTMLElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLElement.cpp
index 52389e18dd..f0a877a84b 100644
--- a/Userland/Libraries/LibWeb/HTML/HTMLElement.cpp
+++ b/Userland/Libraries/LibWeb/HTML/HTMLElement.cpp
@@ -272,7 +272,7 @@ static void run_focus_update_steps(Vector<JS::Handle<DOM::Node>> old_chain, Vect
// with related blur target as the related target.
if (blur_event_target) {
// FIXME: Implement the "fire a focus event" spec operation.
- auto blur_event = UIEvents::FocusEvent::create(blur_event_target->global_object(), HTML::EventNames::blur);
+ auto blur_event = UIEvents::FocusEvent::create(blur_event_target->realm(), HTML::EventNames::blur);
blur_event->set_related_target(related_blur_target);
blur_event_target->dispatch_event(*blur_event);
}
@@ -315,7 +315,7 @@ static void run_focus_update_steps(Vector<JS::Handle<DOM::Node>> old_chain, Vect
// with related focus target as the related target.
if (focus_event_target) {
// FIXME: Implement the "fire a focus event" spec operation.
- auto focus_event = UIEvents::FocusEvent::create(focus_event_target->global_object(), HTML::EventNames::focus);
+ auto focus_event = UIEvents::FocusEvent::create(focus_event_target->realm(), HTML::EventNames::focus);
focus_event->set_related_target(related_focus_target);
focus_event_target->dispatch_event(*focus_event);
}
@@ -436,7 +436,7 @@ bool HTMLElement::fire_a_synthetic_pointer_event(FlyString const& type, DOM::Ele
// 1. Let event be the result of creating an event using PointerEvent.
// 2. Initialize event's type attribute to e.
// FIXME: Actually create a PointerEvent!
- auto event = UIEvents::MouseEvent::create(window(), type);
+ auto event = UIEvents::MouseEvent::create(realm(), type);
// 3. Initialize event's bubbles and cancelable attributes to true.
event->set_bubbles(true);