mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Set proper button value in WebDriver - ElementClick command (#36871)
Fix ElementClick: `ElementClick` should use `MouseButton::Left` to create `action`. Testing: No pass test now. Tests still fail because of other issues. For: https://github.com/servo/servo/issues/36658 cc: @xiaochengh , @yezhizhen , @PotatoCP Signed-off-by: batu_hoang <longvatrong111@gmail.com>
This commit is contained in:
parent
eaf9224799
commit
b2e51820e4
3 changed files with 20 additions and 18 deletions
|
@ -61,15 +61,16 @@ pub enum MouseButton {
|
|||
Other(u16),
|
||||
}
|
||||
|
||||
impl From<u16> for MouseButton {
|
||||
fn from(value: u16) -> Self {
|
||||
impl<T: Into<u64>> From<T> for MouseButton {
|
||||
fn from(value: T) -> Self {
|
||||
let value = value.into();
|
||||
match value {
|
||||
0 => MouseButton::Left,
|
||||
1 => MouseButton::Middle,
|
||||
2 => MouseButton::Right,
|
||||
3 => MouseButton::Back,
|
||||
4 => MouseButton::Forward,
|
||||
_ => MouseButton::Other(value),
|
||||
_ => MouseButton::Other(value as u16),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue