Index: Source/core/html/track/TextTrack.cpp |
diff --git a/Source/core/html/track/TextTrack.cpp b/Source/core/html/track/TextTrack.cpp |
index 85c90290d0a837b563cc128742b3846600521393..0017abfd3762e02dc922415b56fc0d310a600c4f 100644 |
--- a/Source/core/html/track/TextTrack.cpp |
+++ b/Source/core/html/track/TextTrack.cpp |
@@ -146,6 +146,17 @@ bool TextTrack::isValidKindKeyword(const AtomicString& value) |
return false; |
} |
+void TextTrack::setTrackList(TextTrackList* trackList) |
+{ |
+ // NOTE: We are using m_trackList->owner() instead of m_client here because |
+ // when a HTMLTrackElement is reparented, HTMLTrackElement::textTrackRemoveCues() |
+ // will forward the call to the new parent instead of the element the track is being |
+ // removed from. |
+ if (!trackList && m_trackList && m_trackList->owner() && m_cues) |
+ m_trackList->owner()->textTrackRemoveCues(this, m_cues.get()); |
+ m_trackList = trackList; |
+} |
+ |
void TextTrack::setKind(const AtomicString& newKind) |
{ |
AtomicString oldKind = kind(); |
@@ -423,4 +434,3 @@ ExecutionContext* TextTrack::executionContext() const |
} |
} // namespace WebCore |
- |