Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 4cedd2c4aef737fc2c0de72a1fdfa4756e184970
      
https://github.com/WebKit/WebKit/commit/4cedd2c4aef737fc2c0de72a1fdfa4756e184970
  Author: Lily Spiniolas <[email protected]>
  Date:   2026-01-26 (Mon, 26 Jan 2026)

  Changed paths:
    M Source/WebKit/UIProcess/Automation/mac/WebAutomationSessionMac.mm

  Log Message:
  -----------
  [Automation] Middle click is reported as a primary click
https://bugs.webkit.org/show_bug.cgi?id=306239
rdar://168535356

Reviewed by Abrar Rahman Protyasha.

During NSEvent creation in
`WebAutomationSession::platformSimulateMouseInteraction`, if the event type
is not related to the left or right mouse button, convert the event to a
CGEvent, correct the button number, and convert it back. This is necessary
because the default `button` number when creating a mouse event NSEvent is
0.

Tested by the following tests when run via webdriver:
- uievents/mouse/mouseevent_move_button.html
- 
uievents/mouse/synthetic-mouse-enter-leave-over-out-button-state-after-target-removed.tentative.html?buttonType=MIDDLE&button=1&buttons=4

* Source/WebKit/UIProcess/Automation/mac/WebAutomationSessionMac.mm:
(WebKit::nsEventButtonNumberFromAutomationMouseButton):
(WebKit::simulatedMouseEvent):
(WebKit::WebAutomationSession::platformSimulateMouseInteraction):

Canonical link: https://commits.webkit.org/306221@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to