Removing HTMLTrackElement does not delete TextTrack
authoreric.carlson@apple.com <eric.carlson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 21 Mar 2012 18:28:48 +0000 (18:28 +0000)
committereric.carlson@apple.com <eric.carlson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 21 Mar 2012 18:28:48 +0000 (18:28 +0000)
commit35424bc06f6dd619f08ca085fedbfc090da5bdd7
tree4f15d99a40ee0980b96d434bc8323fa911077787
parente861f168555bd173c919ca821be079bd2252455b
Removing HTMLTrackElement does not delete TextTrack
https://bugs.webkit.org/show_bug.cgi?id=80873

Reviewed by Antti Koivisto.

Source/WebCore:

No new tests, but media/track/track-language-preference.html has been updated
to test this fix.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::didAddTrack): Renamed from trackWasAdded.
(WebCore::HTMLMediaElement::willRemoveTrack): Renamed from trackWasRemoved because it is
called before the track is removed, to allow the TextTrack to be removed.
* html/HTMLMediaElement.h:

* html/HTMLTrackElement.cpp:
(WebCore::HTMLTrackElement::insertedIntoTree): Renamed from insertedIntoDocument
(WebCore::HTMLTrackElement::willRemove): Renamed from removedFromDocument.
* html/HTMLTrackElement.h:

* html/track/LoadableTextTrack.cpp:
(WebCore::LoadableTextTrack::trackElementIndex): Don't include tracks that are not in the
document in the calcualtion.

LayoutTests:

* media/track/track-language-preference-expected.txt:
* media/track/track-language-preference.html:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@111581 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/media/track/track-language-preference-expected.txt
LayoutTests/media/track/track-language-preference.html
Source/WebCore/ChangeLog
Source/WebCore/html/HTMLMediaElement.cpp
Source/WebCore/html/HTMLMediaElement.h
Source/WebCore/html/HTMLTrackElement.cpp
Source/WebCore/html/HTMLTrackElement.h
Source/WebCore/html/track/LoadableTextTrack.cpp