Skip to content

webdriver: Do not unwrap when clear undo_actions - #95

Merged
madsmtm merged 2 commits into
rust-windowing:mainfrom
yezhizhen:do-not-unwrap
Dec 16, 2025
Merged

madsmtm merged 2 commits into
rust-windowing:mainfrom
yezhizhen:do-not-unwrap

Conversation

@yezhizhen

Copy link
Copy Markdown
Contributor

When we call

pub fn send_keys(text: &str) -> Vec<Event> {
with "\u{e008}y", we would always end up with panic.

We should avoid unwarp here.

See: servo/servo#41007 (comment)

Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
Comment thread src/webdriver.rs
actions.sort_unstable();
for action in actions {
result.push(self.dispatch_keyup(action).unwrap().into());
// When we `dispatch_typeable`, we may have already dispatched keyup

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This happens at

result.push(self.dispatch_keyup('\u{E008}').unwrap().into());
.

@madsmtm madsmtm added the bug label Dec 15, 2025

@madsmtm madsmtm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Could you add a test case?

@yezhizhen

Copy link
Copy Markdown
Contributor Author

Thanks! Could you add a test case?

You mean unit-test right? I will check the rule here :)

@madsmtm

madsmtm commented Dec 15, 2025

Copy link
Copy Markdown
Member

You mean unit-test right?

That is what I meant, yeah. I know that there aren't any atm.

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
@yezhizhen
yezhizhen requested a review from madsmtm December 16, 2025 04:10
@yezhizhen

Copy link
Copy Markdown
Contributor Author

Done. Pls kindly check :)

@madsmtm

madsmtm commented Dec 16, 2025

Copy link
Copy Markdown
Member

Thanks!

@madsmtm
madsmtm merged commit b2c511a into rust-windowing:main Dec 16, 2025
4 of 5 checks passed
@yezhizhen
yezhizhen deleted the do-not-unwrap branch December 17, 2025 03:11
@yezhizhen

Copy link
Copy Markdown
Contributor Author

Can we get a new release pls? It's been almost an year.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

2 participants