TextTrackList not sorted correctly
authoreric.carlson@apple.com <eric.carlson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 17 Nov 2011 14:49:35 +0000 (14:49 +0000)
committereric.carlson@apple.com <eric.carlson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 17 Nov 2011 14:49:35 +0000 (14:49 +0000)
commit379d904a33e8c4b48be536d922f9e372cca776c7
treed00799b37f746fdaad3892fa64c2deff661ba805
parent526edbb053d3af6b3815164d2f1bd92053cdd4e0
TextTrackList not sorted correctly
https://bugs.webkit.org/show_bug.cgi?id=72545

Reviewed by Darin Adler.

Source/WebCore:

Test: media/track/track-texttracks.html

* WebCore.xcodeproj/project.pbxproj: Add TextTrack.h to WebCore private headers because
    it is included by HTMLMediaElement.h.
* html/LoadableTextTrack.cpp:
(WebCore::LoadableTextTrack::LoadableTextTrack): Pass track type to base class constructor.
(WebCore::LoadableTextTrack::trackElementIndex): New, return the <track> element's tree order
    for sorting.
* html/LoadableTextTrack.h:

* html/TextTrack.cpp:
(WebCore::TextTrack::TextTrack): Set track type.
* html/TextTrack.h:
(WebCore::TextTrack::create): Ditto.
(WebCore::TextTrack::trackType): Ditto.

* html/track/TextTrackList.cpp:
(TextTrackList::length): Update to deal with two TextTrack vectors.
(TextTrackList::item): Ditto.
(TextTrackList::append): Ditto.
(TextTrackList::remove): Ditto
* html/track/TextTrackList.h: Store the two types of TextTracks in separate Vectors to make
    it simpler to keep them in the correct order.

LayoutTests:

* media/track/track-texttracks-expected.txt: Added.
* media/track/track-texttracks.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@100616 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/media/track/track-texttracks-expected.txt [new file with mode: 0644]
LayoutTests/media/track/track-texttracks.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/html/LoadableTextTrack.cpp
Source/WebCore/html/LoadableTextTrack.h
Source/WebCore/html/TextTrack.cpp
Source/WebCore/html/TextTrack.h
Source/WebCore/html/track/TextTrackList.cpp
Source/WebCore/html/track/TextTrackList.h