Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 2c1df6e3a6860de63f209bd7d9f2276a1089ca3e
https://github.com/WebKit/WebKit/commit/2c1df6e3a6860de63f209bd7d9f2276a1089ca3e
Author: Josh Hernandez <[email protected]>
Date: 2026-06-09 (Tue, 09 Jun 2026)
Changed paths:
M LayoutTests/media/media-session/actionHandlerInternalMappings-expected.txt
M LayoutTests/media/media-session/actionHandlerInternalMappings.html
M LayoutTests/media/media-session/mock-actionHandlers-expected.txt
M LayoutTests/media/media-session/mock-actionHandlers.html
M Source/WebCore/Modules/mediasession/MediaSession.cpp
Log Message:
-----------
Map nextslide and previousslide MediaSession actions to nexttrack and
previoustrack platform commands
rdar://178744268
https://bugs.webkit.org/show_bug.cgi?id=316320
Reviewed by Youenn Fablet.
When a site registers only a nextslide or previousslide handler,
pressing the next/previous track button should invoke those handlers.
This patch maps `nextslide` and `previousslide` to `NextTrackCommand` and
`PreviousTrackCommand` respectively, and adds a fallback in `callActionHandler`
so that when `nexttrack` or `previoustrack` arrives from the OS and
no direct handler is registered, the corresponding slide handler is invoked
instead.
The deregistration path also avoids removing a shared platform command
when another action mapping to the same command is still registered.
New tests have been added to `actionHandlerInternalMappings` and
`mock-actionHandlers` to cover the fallback behavior and shared command
deregistration.
* LayoutTests/media/media-session/actionHandlerInternalMappings-expected.txt:
* LayoutTests/media/media-session/actionHandlerInternalMappings.html:
* LayoutTests/media/media-session/mock-actionHandlers-expected.txt:
* LayoutTests/media/media-session/mock-actionHandlers.html:
* Source/WebCore/Modules/mediasession/MediaSession.cpp:
(WebCore::platformCommandForMediaSessionAction):
(WebCore::MediaSession::setActionHandler):
(WebCore::MediaSession::callActionHandler):
Canonical link: https://commits.webkit.org/314839@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications