ASSERT removing then adding a <track> element
authoreric.carlson@apple.com <eric.carlson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 20 Jun 2013 20:14:03 +0000 (20:14 +0000)
committereric.carlson@apple.com <eric.carlson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 20 Jun 2013 20:14:03 +0000 (20:14 +0000)
commitea204bf162b45979636d196c973e4287cc0ca3a5
tree9dec53aa42404958750675cb22162e9ad8aa786f
parentd2ee0e3ab2043ac18de502e6b22cfe945869fc1b
ASSERT removing then adding a <track> element
https://bugs.webkit.org/show_bug.cgi?id=117814

Reviewed by Jer Noble.

Source/WebCore:

Test: media/track/add-and-remove-track.html

* html/HTMLTrackElement.cpp:
(WebCore::HTMLTrackElement::insertedInto): Always call ensureTrack before adding the track
    to the parent <video> element.
(WebCore::HTMLTrackElement::ensureTrack): Call m_track->setTrackElement() in case the
    parent was cleared after m_track was created.

* html/track/LoadableTextTrack.cpp:
(WebCore::LoadableTextTrack::setTrackElement): New, set m_trackElement.
* html/track/LoadableTextTrack.h:

LayoutTests:

* media/track/add-and-remove-track-expected.txt: Added.
* media/track/add-and-remove-track.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@151796 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/media/track/add-and-remove-track-expected.txt [new file with mode: 0644]
LayoutTests/media/track/add-and-remove-track.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/html/HTMLTrackElement.cpp
Source/WebCore/html/track/LoadableTextTrack.cpp
Source/WebCore/html/track/LoadableTextTrack.h