Bug 868611 - Implement HTMLTrackElement::UbindFromTree. r=rillian

Update HTMLTrackElement::UnbindFromTree to remove its TextTrack from
its HTMLMediaElement's list of TextTracks.
This commit is contained in:
Rick Eyre 2013-06-24 11:35:58 -04:00
parent 9175f35127
commit cd546780e3
2 changed files with 9 additions and 2 deletions

View File

@ -523,6 +523,10 @@ public:
mTextTracks->AddTextTrack(aTextTrack);
}
void RemoveTextTrack(TextTrack* aTextTrack) {
mTextTracks->RemoveTextTrack(*aTextTrack);
}
protected:
class MediaLoadListener;
class StreamListener;

View File

@ -314,8 +314,11 @@ HTMLTrackElement::BindToTree(nsIDocument* aDocument,
void
HTMLTrackElement::UnbindFromTree(bool aDeep, bool aNullParent)
{
if (mMediaParent && aNullParent) {
mMediaParent = nullptr;
if (mMediaParent) {
mMediaParent->RemoveTextTrack(mTrack);
if (aNullParent) {
mMediaParent = nullptr;
}
}
nsGenericHTMLElement::UnbindFromTree(aDeep, aNullParent);