Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: b053ef83ff6ba2ff1afdbf62dfc41634a9f8fc34
https://github.com/WebKit/WebKit/commit/b053ef83ff6ba2ff1afdbf62dfc41634a9f8fc34
Author: Richard Robinson <[email protected]>
Date: 2026-09-23 (Wed, 23 Sep 2026)
Changed paths:
M Source/WebKit/Shared/Cocoa/InteractionInformationAtPosition.h
M Source/WebKit/Shared/Cocoa/InteractionInformationAtPosition.mm
M
Source/WebKit/Shared/Cocoa/InteractionInformationAtPosition.serialization.in
M Source/WebKit/UIProcess/mac/AppKitGestures/WKAppKitGestureController.mm
M Source/WebKit/WebProcess/WebPage/Cocoa/PositionInformationForWebPage.mm
M Tools/TestWebKitAPI/Resources/cocoa/custom-slider.html
M Tools/TestWebKitAPI/Tests/WebKit/WebPage/AppKit Gesture
Tests/BasicAppKitGesturesTests.swift
Log Message:
-----------
[AppKit Gestures] Cannot get context menu when right-clicking on video
https://bugs.webkit.org/show_bug.cgi?id=324925
rdar://187611423
Reviewed by Abrar Rahman Protyasha.
`_secondaryClickShouldBeginAtLocation` only lets a secondary click begin when
the hit point
was selectable, or when it was a focusable element hosting editable text. This
isn't true for videos
because plain <video> are UnselectableDueToMediaControls, and custom players
usually set `user-select: none`
on the whole player, which the <video> and any controls over it inherit,
resulting in
UnselectableDueToUserSelectNoneOrQuirk.
Fix by adding `isOverVideo` to InteractionInformationAtPosition, which is set
when any element
under the hit point is (or is inside) a video, and letting the secondary click
begin over
unselectable content only when it is set.
Additionally, the secondary click no longer begins over content that is
manipulated by pressing
and dragging, since the synthesized context menu would interrupt a drag that
starts after holding still.
Test: Tools/TestWebKitAPI/Tests/WebKit/WebPage/AppKit Gesture
Tests/BasicAppKitGesturesTests.swift
* Source/WebKit/Shared/Cocoa/InteractionInformationAtPosition.h:
* Source/WebKit/Shared/Cocoa/InteractionInformationAtPosition.mm:
(WebKit::InteractionInformationAtPosition::InteractionInformationAtPosition):
* Source/WebKit/Shared/Cocoa/InteractionInformationAtPosition.serialization.in:
* Source/WebKit/UIProcess/mac/AppKitGestures/WKAppKitGestureController.mm:
(representsSelectableContent):
(prefersDirectManipulation):
(representsSecondaryClickableElement):
(-[WKAppKitGestureController
deferringGestureRecognizer:shouldDeferGesturesForEventThatWillBeginAction:]):
(-[WKAppKitGestureController _secondaryClickShouldBeginAtLocation:]):
(-[WKAppKitGestureController _panShouldBeginAtLocation:]):
* Source/WebKit/WebProcess/WebPage/Cocoa/PositionInformationForWebPage.mm:
(WebKit::selectionPositionInformation):
* Tools/TestWebKitAPI/Resources/cocoa/custom-slider.html:
* Tools/TestWebKitAPI/Tests/WebKit/WebPage/AppKit Gesture
Tests/BasicAppKitGesturesTests.swift:
(AppKitGesturesTests.clickAndHoldOnVideoOpensContextMenu(_:)):
(AppKitGesturesTests.clickAndHoldOnUnselectableVideoPlayerOpensContextMenu(_:)):
(AppKitGesturesTests.clickAndHoldOnUnselectableContentDoesNotOpenContextMenu):
Canonical link: https://commits.webkit.org/321719@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications