This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 14106 - <track> Chapter tree construction algorithm requires source order; is broken using sorted cue order
Summary: <track> Chapter tree construction algorithm requires source order; is broken ...
Status: RESOLVED FIXED
Alias: None
Product: HTML WG
Classification: Unclassified
Component: HTML5 spec (show other bugs)
Version: unspecified
Hardware: Other other
: P3 blocker
Target Milestone: ---
Assignee: Ian 'Hixie' Hickson
QA Contact: HTML WG Bugzilla archive list
URL: http://www.whatwg.org/specs/web-apps/...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-11 15:42 UTC by contributor
Modified: 2011-09-22 09:17 UTC (History)
10 users (show)

See Also:


Attachments

Description contributor 2011-09-11 15:42:40 UTC
Specification: http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html
Multipage: http://www.whatwg.org/C#text-tracks-describing-chapters
Complete: http://www.whatwg.org/c#text-tracks-describing-chapters

Comment:
Construct chapter from from sorted cue order (drop source order depencies)

Posted from: 65.51.202.21
User agent: Opera/9.80 (Windows NT 6.1; U; en) Presto/2.9.168 Version/11.51
Comment 1 Philip Jägenstedt 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).
Comment 2 Philip Jägenstedt 2011-09-11 16:08:32 UTC
s/demostrate/demonstrate/
s/module/modulo/

(Dear W3C, please let me edit comments after posting.)
Comment 3 Ian 'Hixie' Hickson 2011-09-20 00:13:36 UTC
Done.
Comment 4 contributor 2011-09-20 00:14:08 UTC
Checked in as WHATWG revision r6557.
Check-in comment: Change the text track cue order so that it reverse-sorts on end time, since that results in better rendering and fixes some chapter issues. Also, better define the order of events for multiple cues that started at the same time with different end times.
http://html5.org/tools/web-apps-tracker?from=6556&to=6557