Skip to content

Webdriver: Pointer Input Source with Subtype Touch is not Respected #39264

@stevennovaryo

Description

@stevennovaryo

Pointer input source (#pointer-input-source) have several subtype, that is mouse, touch, and pen, each corresponding to the related pointing device. But in the current implementation, when we are dispatching an PointerAction from a pointer input source, we are disregarding this subtype and always dispatch a WebDriverCommandMsg::MouseButtonAction instead.

See components::webdriver_server::Handler::dispatch_pointerdown_action for example.

pub(crate) fn dispatch_pointerdown_action(&self, source_id: &str, action: &PointerDownAction) {
let session = self.session().unwrap();
let mut input_state_table = session.input_state_table_mut();
let pointer_input_state = match input_state_table.get_mut(source_id).unwrap() {
InputSourceState::Pointer(pointer_input_state) => pointer_input_state,
_ => unreachable!(),
};
if pointer_input_state.pressed.contains(&action.button) {
return;
}
pointer_input_state.pressed.insert(action.button);
self.increment_num_pending_actions();
let msg_id = self.current_action_id.get();
let cmd_msg = WebDriverCommandMsg::MouseButtonAction(
self.verified_webview_id(),
MouseButtonAction::Down,
action.button.into(),
pointer_input_state.x as f32,
pointer_input_state.y as f32,
msg_id,
);
let _ = self.send_message_to_embedder(cmd_msg);
}

WPTs: webdriver/tests/classic/perform_actions

Metadata

Metadata

Assignees

Labels

A-webdriverC-assignedThere is someone working on resolving the issue

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions