LibWeb: Use target's global object when creating focus/blur events
This commit is contained in:
parent
05dcf3b2f8
commit
d7c6298d8b
Notes:
sideshowbarker
2024-07-17 07:25:52 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/d7c6298d8b Pull-request: https://github.com/SerenityOS/serenity/pull/14816 Reviewed-by: https://github.com/ADKaster Reviewed-by: https://github.com/linusg ✅
1 changed files with 2 additions and 2 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue