WebKit icon indicating copy to clipboard operation
WebKit copied to clipboard

On caption menu item doesn't enable text tracks

Open jernoble opened this issue 1 month ago โ€ข 3 comments

07ed9244b847e843991ca9e31e9a9a413023cf91

On caption menu item doesn't enable text tracks
rdar://166158394
https://bugs.webkit.org/show_bug.cgi?id=304048

Reviewed by NOBODY (OOPS!).

Make "On" behave similarly to "Auto", which is to enable the highest
scoring text track available. Additionally, mark languages in the subtitle
menu as checked when they will be enabled by the "On" menu item.

Drive-by fix: Pass track and element parameters into CaptionUserPreferences
by reference rather than by pointer value.

Test: media/modern-media-controls/tracks-support/on-off-text-track.html

* LayoutTests/media/modern-media-controls/resources/media-controls-utils.js:
* LayoutTests/media/modern-media-controls/tracks-support/on-off-text-track-expected.txt: Added.
* LayoutTests/media/modern-media-controls/tracks-support/on-off-text-track.html: Added.
* Source/WebCore/Modules/mediacontrols/MediaControlsHost.cpp:
(WebCore::MediaControlsHost::captionMenuOnItem):
(WebCore::MediaControlsHost::showMediaControlsContextMenu):
* Source/WebCore/Modules/mediacontrols/MediaControlsHost.h:
* Source/WebCore/Modules/mediacontrols/MediaControlsHost.idl:
* Source/WebCore/html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::configureTextTrackGroup):
(WebCore::HTMLMediaElement::setSelectedTextTrack):
* Source/WebCore/page/CaptionUserPreferences.cpp:
(WebCore::CaptionUserPreferences::textTrackSelectionScore const):
(WebCore::CaptionUserPreferences::textTrackLanguageSelectionScore const):
* Source/WebCore/page/CaptionUserPreferences.h:
* Source/WebCore/testing/Internals.cpp:
(WebCore::Internals::controlsHostForMediaElement):
* Source/WebCore/testing/Internals.h:
* Source/WebCore/testing/Internals.idl:

https://github.com/WebKit/WebKit/commit/07ed9244b847e843991ca9e31e9a9a413023cf91

Misc iOS, visionOS, tvOS & watchOS macOS Linux Windows Apple Internal
โœ… ๐Ÿงช style โœ… ๐Ÿ›  ios โœ… ๐Ÿ›  mac โœ… ๐Ÿ›  wpe โœ… ๐Ÿ›  win โœ… ๐Ÿ›  ios-apple
โœ… ๐Ÿงช bindings โœ… ๐Ÿ›  ios-sim โœ… ๐Ÿ›  mac-AS-debug โŒ ๐Ÿงช wpe-wk2 โณ ๐Ÿงช win-tests โœ… ๐Ÿ›  mac-apple
โœ… ๐Ÿงช webkitperl โœ… ๐Ÿงช ios-wk2 โœ… ๐Ÿงช api-mac โŒ ๐Ÿงช api-wpe โœ… ๐Ÿ›  vision-apple
โœ… ๐Ÿงช ios-wk2-wpt โœ… ๐Ÿงช api-mac-debug โœ… ๐Ÿ›  wpe-cairo-libwebrtc
โœ… ๐Ÿงช api-ios โœ… ๐Ÿงช mac-wk1 โœ… ๐Ÿ›  gtk
โœ… ๐Ÿ›  vision โŒ ๐Ÿงช mac-wk2 โŒ ๐Ÿงช gtk-wk2
โœ… ๐Ÿ›  vision-sim โŒ ๐Ÿงช mac-AS-debug-wk2 โœ… ๐Ÿงช api-gtk
โœ… ๐Ÿงช vision-wk2 โŒ ๐Ÿงช mac-wk2-stress โœ… ๐Ÿ›  playstation
โœ… ๐Ÿ›  tv โŒ ๐Ÿงช mac-intel-wk2
โœ… ๐Ÿ›  tv-sim โœ… ๐Ÿ›  mac-safer-cpp
โœ… ๐Ÿ›  watch
โœ… ๐Ÿ›  watch-sim

jernoble avatar Dec 12 '25 06:12 jernoble

Committed 304462@main (443099fc5edf): https://commits.webkit.org/304462@main

Reviewed commits have been landed. Closing PR #55295 and removing active labels.

webkit-commit-queue avatar Dec 15 '25 17:12 webkit-commit-queue