Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: dfc2007df4077ed258158a6ba2f35fa0e39bc29d
https://github.com/WebKit/WebKit/commit/dfc2007df4077ed258158a6ba2f35fa0e39bc29d
Author: Dana Estra <[email protected]>
Date: 2026-06-10 (Wed, 10 Jun 2026)
Changed paths:
M Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm
M Source/WebKit/UIProcess/WebProcessPool.h
M Source/WebKit/WebProcess/WebCoreSupport/WebCaptionPreferencesDelegate.cpp
M Source/WebKit/WebProcess/WebProcess.h
M Source/WebKit/WebProcess/WebProcess.messages.in
M Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm
Log Message:
-----------
Changing caption display mode and language simultaneously can cause old
subtitle track to remain enabled
https://bugs.webkit.org/show_bug.cgi?id=316696
rdar://172710396
Reviewed by Jer Noble.
HTMLMediaElement::setSelectedTextTrack sets the caption display mode to
AlwaysOn when a language
track is selected. This means if the caption display mode is ForcedOnly (Off)
or Automatic and a
user selects a different language track, then two messages need to be sent to
MediaAccessibility:
one for changing the display mode and one for changing the preferred language.
WebCaptionPreferencesDelegate::setPreferredLanguage should cache the new value
locally, exactly
as is already done for the display mode, due to the fact that communication
with MediaAccessiblity
happens asyncronously across the UI process, and asking for the new track
selection immediately
after setting it may return the old value.
We also need to prevent the UI process from overwriting the web process's
cached language, by only
forwarding the preference that has changed since the last time media
accessibility preferences were
updated. This patch adds two IPC to WebProcess:
SetMediaAccessibilityPreferredCaptionDisplayMode
and SetMediaAccessibilityPreferredLanguages. Before, both caption display mode
and language were
always forwarded from the UI to web process when a MediaAccessibility
preference change
notification was received, even if only one of the values changed. This caused
stale values to be
sent to the web process.
No new tests.
* Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::setMediaAccessibilityPreferences):
(WebKit::WebProcessPool::mediaAccessibilityPreferencesChangedCallback):
* Source/WebKit/UIProcess/WebProcessPool.h:
* Source/WebKit/WebProcess/WebCoreSupport/WebCaptionPreferencesDelegate.cpp:
(WebKit::WebCaptionPreferencesDelegate::setPreferredLanguage):
* Source/WebKit/WebProcess/WebProcess.h:
* Source/WebKit/WebProcess/WebProcess.messages.in:
* Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::accessibilityFocusedUIElement):
Canonical link: https://commits.webkit.org/314953@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications