1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 16:07:47 +00:00

LibWeb: Port KeyboardEvent to new String

This commit is contained in:
Kenneth Myhra 2023-03-09 21:35:15 +01:00 committed by Andreas Kling
parent e14be3927a
commit 03d6cb88ff
5 changed files with 26 additions and 23 deletions

View file

@ -684,12 +684,12 @@ bool EventHandler::fire_keyboard_event(DeprecatedFlyString const& event_name, HT
return fire_keyboard_event(event_name, *browsing_context_container.nested_browsing_context(), key, modifiers, code_point);
}
auto event = UIEvents::KeyboardEvent::create_from_platform_event(document->realm(), event_name, key, modifiers, code_point).release_value_but_fixme_should_propagate_errors();
auto event = UIEvents::KeyboardEvent::create_from_platform_event(document->realm(), FlyString::from_deprecated_fly_string(event_name).release_value_but_fixme_should_propagate_errors(), key, modifiers, code_point).release_value_but_fixme_should_propagate_errors();
return !focused_element->dispatch_event(event);
}
// FIXME: De-duplicate this. This is just to prevent wasting a KeyboardEvent allocation when recursing into an (i)frame.
auto event = UIEvents::KeyboardEvent::create_from_platform_event(document->realm(), event_name, key, modifiers, code_point).release_value_but_fixme_should_propagate_errors();
auto event = UIEvents::KeyboardEvent::create_from_platform_event(document->realm(), FlyString::from_deprecated_fly_string(event_name).release_value_but_fixme_should_propagate_errors(), key, modifiers, code_point).release_value_but_fixme_should_propagate_errors();
if (JS::GCPtr<HTML::HTMLElement> body = document->body())
return !body->dispatch_event(event);