mirror of
https://github.com/servo/servo.git
synced 2025-08-26 23:58:20 +01:00
Webdriver: Keyboard Action use webview::notify_input_event
instead of directly sent to constellation (#37908)
Previously, we KeyboardAction will be forwarded to constellation by the embedder. Now we use `webview.notify_input_event`, which will send `WebDriverCommandMsg::ForwardInputEvent` for KeyboardAction Fixes: part of https://github.com/servo/servo/issues/37370 --------- Signed-off-by: PotatoCP <kenzieradityatirtarahardja18@gmail.com>
This commit is contained in:
parent
11bb83d422
commit
1773ea44f8
5 changed files with 17 additions and 61 deletions
|
@ -24,8 +24,8 @@ use servo::servo_url::ServoUrl;
|
|||
use servo::user_content_manager::{UserContentManager, UserScript};
|
||||
use servo::webrender_api::ScrollLocation;
|
||||
use servo::{
|
||||
EventLoopWaker, InputEvent, MouseButtonEvent, MouseMoveEvent, WebDriverCommandMsg, WheelDelta,
|
||||
WheelEvent, WheelMode,
|
||||
EventLoopWaker, InputEvent, KeyboardEvent, MouseButtonEvent, MouseMoveEvent,
|
||||
WebDriverCommandMsg, WheelDelta, WheelEvent, WheelMode,
|
||||
};
|
||||
use url::Url;
|
||||
use winit::application::ApplicationHandler;
|
||||
|
@ -458,8 +458,14 @@ impl App {
|
|||
WebDriverCommandMsg::SendKeys(..) => {
|
||||
running_state.forward_webdriver_command(msg);
|
||||
},
|
||||
WebDriverCommandMsg::KeyboardAction(..) => {
|
||||
running_state.forward_webdriver_command(msg);
|
||||
WebDriverCommandMsg::KeyboardAction(webview_id, key_event, msg_id) => {
|
||||
// TODO: We should do processing like in `headed_window:handle_keyboard_input`.
|
||||
if let Some(webview) = running_state.webview_by_id(webview_id) {
|
||||
webview.notify_input_event(
|
||||
InputEvent::Keyboard(KeyboardEvent::new(key_event))
|
||||
.with_webdriver_message_id(msg_id),
|
||||
);
|
||||
}
|
||||
},
|
||||
WebDriverCommandMsg::MouseButtonAction(
|
||||
webview_id,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue