mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 868611 - Implement HTMLTrackElement::UnbindFromTree. r=rillian
Update HTMLTrackElement::UnbindFromTree to remove its TextTrack from its HTMLMediaElement's list of TextTracks.
This commit is contained in:
parent
f8467f7947
commit
7735a60358
@ -530,6 +530,12 @@ public:
|
||||
mTextTracks->AddTextTrack(aTextTrack);
|
||||
}
|
||||
|
||||
void RemoveTextTrack(TextTrack* aTextTrack) {
|
||||
if (mTextTracks) {
|
||||
mTextTracks->RemoveTextTrack(*aTextTrack);
|
||||
}
|
||||
}
|
||||
|
||||
protected:
|
||||
class MediaLoadListener;
|
||||
class StreamListener;
|
||||
|
@ -290,8 +290,15 @@ HTMLTrackElement::BindToTree(nsIDocument* aDocument,
|
||||
void
|
||||
HTMLTrackElement::UnbindFromTree(bool aDeep, bool aNullParent)
|
||||
{
|
||||
if (mMediaParent && aNullParent) {
|
||||
mMediaParent = nullptr;
|
||||
if (mMediaParent) {
|
||||
// mTrack can be null if HTMLTrackElement::LoadResource has never been
|
||||
// called.
|
||||
if (mTrack) {
|
||||
mMediaParent->RemoveTextTrack(mTrack);
|
||||
}
|
||||
if (aNullParent) {
|
||||
mMediaParent = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
nsGenericHTMLElement::UnbindFromTree(aDeep, aNullParent);
|
||||
|
Loading…
Reference in New Issue
Block a user