Bug 1319486 - Remove the old relation when adding cue to a new TextTrack. r=rillian

MozReview-Commit-ID: GScxPQWMUTR

--HG--
extra : rebase_source : 2aeb67215202860b7a62a6669d79aaaf99e6d53a
This commit is contained in:
bechen 2016-11-24 15:30:52 +08:00
parent f306b4ac22
commit abdee013ae

View File

@ -136,6 +136,11 @@ TextTrack::GetId(nsAString& aId) const
void
TextTrack::AddCue(TextTrackCue& aCue)
{
TextTrack* oldTextTrack = aCue.GetTrack();
if (oldTextTrack) {
ErrorResult dummy;
oldTextTrack->RemoveCue(aCue, dummy);
}
mCueList->AddCue(aCue);
aCue.SetTrack(this);
if (mTextTrackList) {