• eric.carlson@apple.com's avatar
    TextTrackList not sorted correctly · 379d904a
    eric.carlson@apple.com authored
    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
    379d904a
TextTrackList.h 3.33 KB