mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
[WebDriver: Release Action] Fix panic by work around buggy spec (#37624)
1. Narrow the lifetime of `input_cancel_list` to avoid Runtime multiple BorrowMut error. 2. Work around the buggy spec by removing matching item in `input_cancel_list` when dispatch `keyUp` and `mouseUp`. See https://github.com/servo/servo/issues/37579#issuecomment-2990762713 Testing: All WebDriver WPT test. Fixes: #37579 --------- Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
This commit is contained in:
parent
795367c751
commit
5e252d0ef6
7 changed files with 39 additions and 24 deletions
|
@ -64,7 +64,7 @@ use webdriver::response::{
|
|||
};
|
||||
use webdriver::server::{self, Session, SessionTeardownKind, WebDriverHandler};
|
||||
|
||||
use crate::actions::{ActionItem, ActionsByTick, InputSourceState, PointerInputState};
|
||||
use crate::actions::{ActionItem, InputSourceState, PointerInputState};
|
||||
|
||||
#[derive(Default)]
|
||||
pub struct WebDriverMessageIdGenerator {
|
||||
|
@ -1758,8 +1758,10 @@ impl Handler {
|
|||
// only one command can run at a time, so this will never block."
|
||||
|
||||
// Step 6. Let undo actions be input cancel list in reverse order.
|
||||
let mut input_cancel_list = session.input_cancel_list.borrow_mut();
|
||||
let undo_actions: ActionsByTick = input_cancel_list
|
||||
|
||||
let undo_actions = session
|
||||
.input_cancel_list
|
||||
.borrow_mut()
|
||||
.drain(..)
|
||||
.rev()
|
||||
.map(|(id, action_item)| HashMap::from([(id, action_item)]))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue