summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/HTML/HTMLElement.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2022-09-03 19:19:59 +0200
committerAndreas Kling <kling@serenityos.org>2022-09-06 00:27:09 +0200
commitd7c6298d8b7ef04ced85e80fd0e15be931814e74 (patch)
tree1cf48be9cd512e2c02dce450a94dfa314a6b5ca3 /Userland/Libraries/LibWeb/HTML/HTMLElement.cpp
parent05dcf3b2f8138effa39c02e2d3dfe23be7c06d8b (diff)
downloadserenity-d7c6298d8b7ef04ced85e80fd0e15be931814e74.zip
LibWeb: Use target's global object when creating focus/blur events
Diffstat (limited to 'Userland/Libraries/LibWeb/HTML/HTMLElement.cpp')
-rw-r--r--Userland/Libraries/LibWeb/HTML/HTMLElement.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Userland/Libraries/LibWeb/HTML/HTMLElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLElement.cpp
index 587fbfd6ea..e2660a8f02 100644
--- a/Userland/Libraries/LibWeb/HTML/HTMLElement.cpp
+++ b/Userland/Libraries/LibWeb/HTML/HTMLElement.cpp
@@ -259,7 +259,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(verify_cast<DOM::Node>(*blur_event_target).document().window(), HTML::EventNames::blur);
+ auto blur_event = UIEvents::FocusEvent::create(blur_event_target->global_object(), HTML::EventNames::blur);
blur_event->set_related_target(related_blur_target);
blur_event_target->dispatch_event(*blur_event);
}
@@ -302,7 +302,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(verify_cast<DOM::Node>(*focus_event_target).document().window(), HTML::EventNames::focus);
+ auto focus_event = UIEvents::FocusEvent::create(focus_event_target->global_object(), HTML::EventNames::focus);
focus_event->set_related_target(related_focus_target);
focus_event_target->dispatch_event(*focus_event);
}