Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 4d1f8e8e5440b5b0fc777d9bc0f6b15856658b18
https://github.com/WebKit/WebKit/commit/4d1f8e8e5440b5b0fc777d9bc0f6b15856658b18
Author: Dana Estra <[email protected]>
Date: 2026-09-24 (Thu, 24 Sep 2026)
Changed paths:
M Source/WebCore/Modules/mediasource/SourceBuffer.cpp
M Source/WebCore/Modules/mediasource/SourceBuffer.h
M Source/WebCore/html/HTMLMediaElement.cpp
M Source/WebCore/html/HTMLMediaElement.h
M Source/WebCore/html/HTMLTrackElement.cpp
M Source/WebCore/html/HTMLTrackElement.h
M Source/WebCore/html/track/InbandTextTrack.cpp
M Source/WebCore/html/track/InbandTextTrack.h
M Source/WebCore/html/track/TextTrack.cpp
M Source/WebCore/html/track/TextTrack.h
M Source/WebCore/html/track/TextTrackClient.h
Log Message:
-----------
WebVTT test failure: 2_tracks.html, 3_tracks.html
https://bugs.webkit.org/show_bug.cgi?id=325047
rdar://183472153
Reviewed by Eric Carlson.
The WPT tests 2_tracks.html and 3_tracks.html test showing multiple text tracks
simultaneously.
Currently these fail when the pages are loaded manually in safari. This is
because
HTMLMediaElement::textTrackModeChanged sets the tracks as configured, then
later marks them as
unconfigured in HTMLMediaElement::markCaptionAndSubtitleTracksAsUnconfigured,
which allows their
modes to be overriden by our automatic selection algorithm in
HTMLMediaElement::configureTextTrackGroup.
To fix this, introduce the enum ConfigurationState { Unconfigured,
ConfiguredByJavascript,
ConfiguredAutomatically }. A track whose mode is set via
HTMLMediaElement::configureTextTrackGroup should
have a state of ConfiguredAutomatically, while a track whose mode is set via
javascript should have a
state of ConfiguredByJavascript, and hence shouldn't be unconfigured by us.
HTMLMediaElement::markCaptionAndSubtitleTracksAsUnconfigured now only
unconfigures tracks with state
ConfiguredAutomatically.
2_tracks and 3_tracks already pass in webkit test runner, but this change
allows these test pages to pass
when loaded manually in safari/minibrowser. No change in test expecations.
* Source/WebCore/Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::textTrackModeChanged):
* Source/WebCore/Modules/mediasource/SourceBuffer.h:
* Source/WebCore/html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::textTrackModeChanged):
(WebCore::HTMLMediaElement::didRemoveTextTrack):
(WebCore::HTMLMediaElement::configureTextTrackGroup):
(WebCore::HTMLMediaElement::configureTextTracks):
(WebCore::HTMLMediaElement::markCaptionAndSubtitleTracksAsUnconfigured):
* Source/WebCore/html/HTMLMediaElement.h:
* Source/WebCore/html/HTMLTrackElement.cpp:
(WebCore::HTMLTrackElement::textTrackModeChanged):
* Source/WebCore/html/HTMLTrackElement.h:
* Source/WebCore/html/track/InbandTextTrack.cpp:
(WebCore::InbandTextTrack::setMode):
* Source/WebCore/html/track/InbandTextTrack.h:
* Source/WebCore/html/track/TextTrack.cpp:
(WebCore::TextTrack::setMode):
* Source/WebCore/html/track/TextTrack.h:
(WebCore::TextTrack::configurationState const):
(WebCore::TextTrack::setConfigurationState):
(WebCore::TextTrack::hasBeenConfigured const): Deleted.
(WebCore::TextTrack::setHasBeenConfigured): Deleted.
* Source/WebCore/html/track/TextTrackClient.h:
(WebCore::TextTrackClient::textTrackModeChanged):
Canonical link: https://commits.webkit.org/321838@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications