Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: c45604eac6d555f26647dc2eb9d0d190a75d24f8
      
https://github.com/WebKit/WebKit/commit/c45604eac6d555f26647dc2eb9d0d190a75d24f8
  Author: Dana Estra <[email protected]>
  Date:   2026-07-30 (Thu, 30 Jul 2026)

  Changed paths:
    A LayoutTests/media/track/track-remove-text-track-expected.txt
    A LayoutTests/media/track/track-remove-text-track.html
    M Source/WebCore/Modules/mediasource/MediaSource.cpp
    M Source/WebCore/html/HTMLMediaElement.cpp
    M Source/WebCore/html/HTMLMediaElement.h
    M Source/WebCore/html/HTMLMediaElement.idl

  Log Message:
  -----------
  Add HTMLMediaElement.removeTextTrack()
https://bugs.webkit.org/show_bug.cgi?id=320404
rdar://183365541

Reviewed by Jean-Yves Avenard.

Add removeTextTrack() to the HTMLMediaElement API, which takes as an
argument a track element that was added via HTMLMediaElement.addTextTrack().
It throws an exception if the media element does not contain that text track,
or if the track is a type other than AddTrack (meaning it was not added via
addTextTrack()).

Change the existing removeTextTrack(TextTrack& track, bool scheduleEvent) to
return a bool indicating whether it succeeded at removing the track. Also
remove the default value for scheduleEvent, since it would otherwise be
ambiguous with the new single-argument overload.

Added new test: media/track/track-remove-text-track.html

* LayoutTests/media/track/track-remove-text-track-expected.txt: Added.
* LayoutTests/media/track/track-remove-text-track.html: Added.
* Source/WebCore/Modules/mediasource/MediaSource.cpp:
(WebCore::MediaSource::removeSourceBufferWithOptionalDestruction):
* Source/WebCore/html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::removeTextTrack):
(WebCore::HTMLMediaElement::willRemoveTextTrack):
(WebCore::HTMLMediaElement::didRemoveTextTrack):
(WebCore::HTMLMediaElement::forgetResourceSpecificTracks):
* Source/WebCore/html/HTMLMediaElement.h:
* Source/WebCore/html/HTMLMediaElement.idl:

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



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

Reply via email to