Skip to content

Set proper button value in WebDriver - ElementClick command - #36871

Merged
xiaochengh merged 1 commit into
servo:mainfrom
longvatrong111:element-click-button
May 7, 2025
Merged

xiaochengh merged 1 commit into
servo:mainfrom
longvatrong111:element-click-button

Conversation

@longvatrong111

@longvatrong111 longvatrong111 commented May 6, 2025 •

Copy link
Copy Markdown
Contributor

Fix ElementClick: ElementClick should use MouseButton::Left to create action.

Testing: No pass test now. Tests still fail because of other issues.
For: #36658

cc: @xiaochengh , @yezhizhen , @PotatoCP

@yezhizhen yezhizhen 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.

impl From<u16> for MouseButton {
fn from(value: u16) -> Self {
match value {
0 => MouseButton::Left,
1 => MouseButton::Middle,
2 => MouseButton::Right,
3 => MouseButton::Back,
4 => MouseButton::Forward,
_ => MouseButton::Other(value),
}

Actually neither need to change input_events.rs nor actions.rs. The convresion from integer to MouseButton is already handled by From<u16> trait.

@longvatrong111
longvatrong111 force-pushed the element-click-button branch from be23f44 to 3823ff6 Compare May 6, 2025 06:37
Comment thread components/webdriver_server/lib.rs Resolved
@longvatrong111
longvatrong111 force-pushed the element-click-button branch from 3823ff6 to e69a6bf Compare May 6, 2025 06:51

@xiaochengh xiaochengh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please also change the "Fixed: #XXX" line in the PR description into "For: #XXX". Otherwise this PR will auto-close the issue.

Comment thread components/webdriver_server/lib.rs Resolved
@longvatrong111
longvatrong111 force-pushed the element-click-button branch 3 times, most recently from 9063602 to 9f75e64 Compare May 6, 2025 09:57
@longvatrong111
longvatrong111 force-pushed the element-click-button branch from 9f75e64 to 2004ec2 Compare May 6, 2025 10:19
@xiaochengh

Copy link
Copy Markdown
Contributor

Looks good to me. Is it ready to merge now?

@longvatrong111

longvatrong111 commented May 7, 2025 •

Copy link
Copy Markdown
Contributor Author

Looks good to me. Is it ready to merge now?

Yes I have nothing to update for now.

@xiaochengh
xiaochengh added this pull request to the merge queue May 7, 2025
Merged via the queue into servo:main with commit b2e5182 May 7, 2025
@longvatrong111
longvatrong111 deleted the element-click-button branch May 15, 2025 07:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants