mirror of
https://github.com/servo/servo.git
synced 2025-06-26 10:04:33 +01:00
[WebDriver] Add synchronization for key action (#37403)
Implement action synchronization for key event. Previously only done for pointer https://github.com/servo/servo/pull/36932 and wheel https://github.com/servo/servo/pull/37260. --------- Signed-off-by: PotatoCP <kenzieradityatirtarahardja18@gmail.com>
This commit is contained in:
parent
f97cdb4d12
commit
cdc8b45965
16 changed files with 171 additions and 118 deletions
|
@ -227,6 +227,9 @@ struct Handler {
|
|||
current_action_id: Cell<Option<WebDriverMessageId>>,
|
||||
|
||||
resize_timeout: u32,
|
||||
|
||||
/// Number of pending actions of which WebDriver is waiting for responses.
|
||||
num_pending_actions: Cell<u32>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
|
@ -459,9 +462,16 @@ impl Handler {
|
|||
id_generator: WebDriverMessageIdGenerator::new(),
|
||||
current_action_id: Cell::new(None),
|
||||
resize_timeout: 500,
|
||||
num_pending_actions: Cell::new(0),
|
||||
}
|
||||
}
|
||||
|
||||
fn increment_num_pending_actions(&self) {
|
||||
// Increase the num_pending_actions by one every time we dispatch non null actions.
|
||||
self.num_pending_actions
|
||||
.set(self.num_pending_actions.get() + 1);
|
||||
}
|
||||
|
||||
fn focus_webview_id(&self) -> WebDriverResult<WebViewId> {
|
||||
debug!("Getting focused context.");
|
||||
let (sender, receiver) = ipc::channel().unwrap();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue