Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 762e22b2a4d40381bc92f07fb45ccb28fbfe843d
      
https://github.com/WebKit/WebKit/commit/762e22b2a4d40381bc92f07fb45ccb28fbfe843d
  Author: Josh Hernandez <[email protected]>
  Date:   2026-08-03 (Mon, 03 Aug 2026)

  Changed paths:
    M 
LayoutTests/media/modern-media-controls/tracks-support/on-off-text-track-expected.txt
    M 
LayoutTests/media/modern-media-controls/tracks-support/on-off-text-track.html
    M Source/WebCore/Modules/mediacontrols/MediaControlsHost.cpp
    M Source/WebCore/html/HTMLMediaElement.cpp
    M Source/WebCore/page/CaptionUserPreferences.cpp
    M Source/WebCore/page/CaptionUserPreferences.h

  Log Message:
  -----------
  Subtitles don't always turn on when selecting "On" in the media controls
https://bugs.webkit.org/show_bug.cgi?id=320769
rdar://183776073

Reviewed by Eric Carlson.

Selecting "On" in the media controls captions menu sometimes does nothing and 
subtitles
never appear. The only way to turn them on is to pick a specific language from 
the
Languages submenu. Once a language has been chosen, toggling "On" while the 
subtitles
are active will toggle them Off, and selecting "On" afterwards will do nothing 
again.

This happens when the caption display mode is already `AlwaysOn` but no text 
track
is showing. When we make a "On" selection all tracks get disabled and due to 
the AlwaysOn state
being the same, we never re-run the track configuration that would pick one to 
display.
Selecting a specific language works because that path enables the chosen track 
directly.

Selecting "On" now enables the best-matching text track directly, and we no 
longer
disable all tracks when the selection is "On", so a track that's already 
showing is left alone.

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

Added test case when display mode is already AlwaysOn, that selecting "On" will 
enable a track

* 
LayoutTests/media/modern-media-controls/tracks-support/on-off-text-track-expected.txt:
* LayoutTests/media/modern-media-controls/tracks-support/on-off-text-track.html:
* Source/WebCore/Modules/mediacontrols/MediaControlsHost.cpp:
(WebCore::MediaControlsHost::mediaControlsContextMenuItems):
(WebCore::MediaControlsHost::showMediaControlsContextMenu):
* Source/WebCore/html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::setSelectedTextTrack):
* Source/WebCore/page/CaptionUserPreferences.cpp:
(WebCore::CaptionUserPreferences::bestTextTrackToEnable const):
* Source/WebCore/page/CaptionUserPreferences.h:

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



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

Reply via email to