Bug 103266

Summary: TextTrack's .cues not ordered correctly when two cues have the same .startTime
Product: WebKit Reporter: Antoine Quint <graouts>
Component: MediaAssignee: Antoine Quint <graouts>
Status: RESOLVED FIXED    
Severity: Normal CC: eric.carlson, feature-media-reviews, gyuyoung.kim, ojan, rakuco, webkit-bug-importer, webkit.review.bot
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
URL: http://w3c-test.org/html/tests/submission/Opera/media/interfaces/TextTrack/cues.html
Attachments:
Description Flags
Patch none

Description Antoine Quint 2012-11-26 08:50:46 PST
We're failing the fourth test of the Opera-submitted test at http://w3c-test.org/html/tests/submission/Opera/media/interfaces/TextTrack/cues.html. Here, we're failing when changing the startTime of cue id2 to be in range 0-2, while the "id" cue is in range 0-1. The test expects the .cues property be ordered as ["id2", "id"]. The spec shows that our implementation is incorrect per this paragraph right at the end of section 4.8.10.12.1: "any cues with the same start time must be sorted by their end time, latest first" (http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#timed-text-tracks).
Comment 1 Antoine Quint 2012-11-27 01:54:54 PST
<rdar://problem/12756212>
Comment 2 Antoine Quint 2012-12-05 08:16:39 PST
It seems we're ordering cues correctly per TextTrackCueList::add(PassRefPtr<TextTrackCue> prpCue, size_t start, size_t end). However, this code is not being called as a result of a cue in a TextTrackList having its startTime or endTime changed. We may want to simply add/remove the cue from the list of cues in TextTrack::cueDidChange() to simply refresh the order. I will try that approach.
Comment 3 Antoine Quint 2012-12-06 06:00:36 PST
Created attachment 178002 [details]
Patch
Comment 4 WebKit Review Bot 2012-12-06 07:24:06 PST
Comment on attachment 178002 [details]
Patch

Clearing flags on attachment: 178002

Committed r136843: <http://trac.webkit.org/changeset/136843>
Comment 5 WebKit Review Bot 2012-12-06 07:24:11 PST
All reviewed patches have been landed.  Closing bug.