[Bug 14106] Chapter tree construction algorithm assumed source order; is broken using sorted cue order

http://www.w3.org/Bugs/Public/show_bug.cgi?id=14106

--- Comment #1 from Philip Jägenstedt <philipj@opera.com> 2011-09-11 15:53:39 UTC ---
Comments from the Open Video Conference, with implementors of Opera, Firefox,
Chrome and Safari discussing WebVTT.

http://people.opera.com/philipj/2011/09/ovc/demos/chapters.html was written to
demostrate the chapter tree construction. Since the algorithm uses source
order, it cannot be emulated using scripts operating on the cues. Problems:

1. We don't want to keep track of two order of the cues, because there's no
reason to module this bug.

2. If you use the "text track cue order" the nesting will be wrong for chapters
with the same start time, some chapters will be dropped. To see this, comment
out the following from the example:

/*
  list.sort(function(a, b) {
    if (a.startTime != b.startTime)
      return a.startTime - b.startTime;
    return b.endTime - a.endTime;
  });
*/

Suggestion solution:

Use the "text track cue order" but modify that concept to sort first by
increasing start time, then by decreasing end time, then by insertion order.
This solved problem, and actually improves the rendering order of captions that
share start time but not end time (the top and shorter cue goes away first).

-- 
Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

Received on Sunday, 11 September 2011 15:53:41 UTC