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:
batu_hoang 2025-05-07 16:58:01 +08:00 committed by GitHub
parent eaf9224799
commit b2e51820e4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 20 additions and 18 deletions

View file

@ -305,11 +305,10 @@ impl Handler {
},
});
let button = (action.button as u16).into();
let cmd_msg = WebDriverCommandMsg::MouseButtonAction(
session.webview_id,
MouseButtonAction::Down,
button,
action.button.into(),
pointer_input_state.x as f32,
pointer_input_state.y as f32,
);
@ -351,11 +350,10 @@ impl Handler {
},
});
let button = (action.button as u16).into();
let cmd_msg = WebDriverCommandMsg::MouseButtonAction(
session.webview_id,
MouseButtonAction::Up,
button,
action.button.into(),
pointer_input_state.x as f32,
pointer_input_state.y as f32,
);