mirror of
https://github.com/servo/servo
synced 2026-05-15 03:16:47 +02:00
Servo currently has three ways of notifying the embedder that input events have been processed. 1. `WebViewDelegate::notify_keyboard_event`: This is used to implement overridable keybindings in servoshell. It notifies the embedder when a keyboard event has been processed, but not "handled" by the engine. 2. WebDriver's command message senders and receivers, this is used to let WebDriver wait until events have been handled to continue with script execution. 3. Touch event processing notifications: This is used to serialize touch event processing. This change unifies the first two things with a new `WebViewDelegate::notify_input_event_handled` API. This API informs the embedder (via a generated id) that an input event has finished processing and what the result of the processing was. This allows embedders to do other things with events once they have been processed. For example, embedders might want to chain unconsumed events up to parent widgets or to add support for overridable keybindings. As part of this the `canceled` flag in script's `Event` data structure is turned into a `bitflags` mirror of the new API type to describe the result of event handling. Testing: This shouldn't change observable behavior and is thus covered by existing tests. The new API is consumed by servoshell, which uses it for tests. Signed-off-by: Martin Robinson <mrobinson@igalia.com>