Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: bf102c0ef7927fda51d6f26340e3162ca5581641
      
https://github.com/WebKit/WebKit/commit/bf102c0ef7927fda51d6f26340e3162ca5581641
  Author: Abrar Rahman Protyasha <[email protected]>
  Date:   2026-10-10 (Sat, 10 Oct 2026)

  Changed paths:
    M Source/WebCore/page/EventHandler.cpp
    M Source/WebKit/UIProcess/mac/WKTextSelectionController.swift
    M Tools/TestWebKitAPI/Tests/WebKit/WebPage/AppKit Gesture 
Tests/AppKitGesturesTestsSupport.swift
    M Tools/TestWebKitAPI/Tests/WebKit/WebPage/AppKit Gesture 
Tests/BasicAppKitGesturesTests.swift

  Log Message:
  -----------
  [AppKit Gestures] Ctrl + click over text does not produce a word selection 
under the click
https://bugs.webkit.org/show_bug.cgi?id=327032
rdar://189650658

Reviewed by Richard Robinson.

As the bug title reads, there are two confounding factors here:

- We categorically reject context menu events without UserDriven input
  from producing text selections. This should be cognizant of any modifier
  flags associated with the context menu event.
- We fail to plumb the modifier flags associated with -showContextMenu(at:).

In this patch, we fix both things, which allows ctrl + click over text to
produce a word selection under the click.

Tests: 
AppKitGesturesTests.Basic.controlClickOnWordSelectsWordAndOpensContextMenu

* Source/WebCore/page/EventHandler.cpp:
(WebCore::EventHandler::sendContextMenuEvent):
* Source/WebKit/UIProcess/mac/WKTextSelectionController.swift:
(WKTextSelectionController.showContextMenu(at:)):
* Tools/TestWebKitAPI/Tests/WebKit/WebPage/AppKit Gesture 
Tests/AppKitGesturesTestsSupport.swift:
(KeyboardModifiers.hidUsages):
(KeyboardModifiers.domNames):
* Tools/TestWebKitAPI/Tests/WebKit/WebPage/AppKit Gesture 
Tests/BasicAppKitGesturesTests.swift:
(PointerEventFamily.controlClickOnWordSelectsWordAndOpensContextMenu(_:)):

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



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

Reply via email to