Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 143198e9d6cbee92d161954989a2433a47ffddbf
      
https://github.com/WebKit/WebKit/commit/143198e9d6cbee92d161954989a2433a47ffddbf
  Author: Tyler Wilcock <[email protected]>
  Date:   2026-10-07 (Wed, 07 Oct 2026)

  Changed paths:
    A 
LayoutTests/accessibility/isolated-tree/press-events-mimic-mouse-click-expected.txt
    A 
LayoutTests/accessibility/isolated-tree/press-events-mimic-mouse-click.html
    A LayoutTests/accessibility/press-events-mimic-mouse-click-expected.txt
    A LayoutTests/accessibility/press-events-mimic-mouse-click.html
    M Source/WebCore/dom/SimulatedClick.cpp

  Log Message:
  -----------
  AX: VoiceOver presses dispatch a click event with a detail of 0, and no 
pointer events
https://bugs.webkit.org/show_bug.cgi?id=326036
rdar://187732224

Reviewed by Dominic Mazzoni.

When an assistive technology presses an element (e.g. with VO-Space), we 
simulate a click with mousedown, mouseup, and
click events. Unlike the events of a mouse click, though, these had a detail 
(click count) of 0 and no pressed buttons,
the click had the pointerId (-1) and pointerType ("") of a click that no 
pointing device produced, and there was no
pointerdown or pointerup. Pages rely on these behaviors. Many treat a click 
with a detail of 0 as keyboard activation,
and many widgets act on pointerdown rather than click. For these presses, both 
Chrome and Firefox dispatch a click with
a detail of 1, so this commit changes WebKit to match.

With this commit, we make a simulated click that sends mouse down and up events 
dispatch the same events as a click of
the primary mouse button. Specifically that is pointerdown, mousedown, 
pointerup, mouseup, and click, with a detail of
1, the primary button pressed in the down events, and the pointerId and 
pointerType of the mouse. Like for a mouse
click, canceling pointerdown prevents mousedown and mouseup, but not click.

Keyboard activation and element.click() behavior are unchanged with this commit.

* 
LayoutTests/accessibility/isolated-tree/press-events-mimic-mouse-click-expected.txt:
 Added.
* LayoutTests/accessibility/isolated-tree/press-events-mimic-mouse-click.html: 
Added.
* LayoutTests/accessibility/press-events-mimic-mouse-click-expected.txt: Added.
* LayoutTests/accessibility/press-events-mimic-mouse-click.html: Added.
* Source/WebCore/dom/SimulatedClick.cpp:
(WebCore::SimulatedMouseEvent::create):
(WebCore::SimulatedMouseEvent::SimulatedMouseEvent):
(WebCore::SimulatedMouseEvent::detailForDevice):
(WebCore::SimulatedMouseEvent::buttonsForDevice):
(WebCore::simulateMouseEvent):
(WebCore::simulatePointerEvent):
(WebCore::simulateClick):

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



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

Reply via email to