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

LibWeb: Make factory methods of UIEvents::KeyboardEvent fallible

This commit is contained in:
Kenneth Myhra 2023-02-19 10:25:32 +01:00 committed by Andreas Kling
parent b91d599177
commit a401cff4e2
4 changed files with 13 additions and 13 deletions

View file

@ -684,17 +684,17 @@ 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);
return !focused_element->dispatch_event(*event);
auto event = UIEvents::KeyboardEvent::create_from_platform_event(document->realm(), event_name, 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);
auto event = UIEvents::KeyboardEvent::create_from_platform_event(document->realm(), event_name, key, modifiers, code_point).release_value_but_fixme_should_propagate_errors();
if (JS::GCPtr<HTML::HTMLElement> body = document->body())
return !body->dispatch_event(*event);
return !body->dispatch_event(event);
return !document->root().dispatch_event(*event);
return !document->root().dispatch_event(event);
}
bool EventHandler::handle_keydown(KeyCode key, unsigned modifiers, u32 code_point)