Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 82c5da0f43373e343c6e0c313fdf67e7cd64276f
      
https://github.com/WebKit/WebKit/commit/82c5da0f43373e343c6e0c313fdf67e7cd64276f
  Author: Jer Noble <[email protected]>
  Date:   2025-12-06 (Sat, 06 Dec 2025)

  Changed paths:
    M Source/WebKit/UIProcess/Cocoa/_WKCaptionStyleMenuController.h
    M Source/WebKit/UIProcess/Cocoa/_WKCaptionStyleMenuControllerInternal.h
    M Source/WebKit/UIProcess/ios/_WKCaptionStyleMenuControllerAVKit.mm
    M Source/WebKit/UIProcess/ios/_WKCaptionStyleMenuControllerIOS.mm
    M Source/WebKit/UIProcess/mac/WebContextMenuProxyMac.h
    M Source/WebKit/UIProcess/mac/WebContextMenuProxyMac.mm
    M Source/WebKit/UIProcess/mac/_WKCaptionStyleMenuControllerAVKitMac.mm
    M Source/WebKit/UIProcess/mac/_WKCaptionStyleMenuControllerMac.mm
    M Tools/TestWebKitAPI/Tests/WebCore/cocoa/CaptionPreferencesTests.mm

  Log Message:
  -----------
  Caption Preview is not shown in default media controls
rdar://165931046
https://bugs.webkit.org/show_bug.cgi?id=303647

Reviewed by Eric Carlson.

On both iOS and macOS, a notification is not sent when a submenu is
presented. Since the styles menu is a submenu of the captions menu
from within the default media controls, clients are not notified when
that submenu is presented, and therefore the preview placeholder is
not shown.

Solve this differently on iOS and macOS. On macOS, where there is a
highlight state, tell clients the style menu was opened whenever the
highlight value changes. On iOS, do the same when a profile menu item
is selected.

Drive-by fix: add tests to validate that the menu items' state property
updates when the menu items are selected.

Test: Tools/TestWebKitAPI/Tests/WebCore/cocoa/CaptionPreferencesTests.mm

* Source/WebKit/UIProcess/Cocoa/_WKCaptionStyleMenuController.h:
* Source/WebKit/UIProcess/ios/_WKCaptionStyleMenuControllerAVKit.mm:
(-[_WKCaptionStyleMenuControllerAVKit 
legibleMenuController:didRequestCaptionPreviewForProfileID:]):
* Source/WebKit/UIProcess/ios/_WKCaptionStyleMenuControllerIOS.mm:
(menuHasMenuAncestor):
(-[WKCaptionStyleMenuController isAncestorOf:]):
(-[WKCaptionStyleMenuController hasAncestor:]):
* Source/WebKit/UIProcess/mac/WebContextMenuProxyMac.h:
* Source/WebKit/UIProcess/mac/WebContextMenuProxyMac.mm:
(-[WKMenuDelegate menuWillOpen:]):
(-[WKMenuDelegate menuDidClose:]):
(WebKit::WebContextMenuProxyMac::didShowContextMenu):
(WebKit::WebContextMenuProxyMac::didDismissContextMenu):
* Source/WebKit/UIProcess/mac/_WKCaptionStyleMenuControllerAVKitMac.mm:
(-[_WKCaptionStyleMenuControllerAVKitMac menuWillOpen:]): Deleted.
(-[_WKCaptionStyleMenuControllerAVKitMac menuDidClose:]): Deleted.
* Source/WebKit/UIProcess/mac/_WKCaptionStyleMenuControllerMac.mm:
(menuHasMenuAncestor):
(-[WKCaptionStyleMenuController isAncestorOf:]):
(-[WKCaptionStyleMenuController hasAncestor:]):
(-[WKCaptionStyleMenuController profileMenuItemSelected:]):
(-[WKCaptionStyleMenuController setPreviewProfileID:]):
* Tools/TestWebKitAPI/Tests/WebCore/cocoa/CaptionPreferencesTests.mm:
(-[CaptionPreferenceTestMenuControllerDelegate 
captionStyleMenu:didSelectProfile:]):
(TestWebKitAPI::CaptionPreferenceTests::ensureController):
(TestWebKitAPI::CaptionPreferenceTests::runAndWaitForLastSelectedProfileToChange):
(TestWebKitAPI::CaptionPreferenceTests::selectProfileAtIndex):
(TestWebKitAPI::CaptionPreferenceTests::highlightProfileAtIndex):
(TestWebKitAPI::TEST_F(CaptionPreferenceTests, MenuAncestryCheck)):
(TestWebKitAPI::TEST_F(CaptionPreferenceTests, MenuItemChangesAfterSelection)):
(TestWebKitAPI::TEST_F(CaptionPreferenceTests, ReceievedDidOpenWhenSelected)):
(TestWebKitAPI::TEST_F(CaptionPreferenceTests, 
ReceievedDidOpenWhenHighlighted)):

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



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

Reply via email to