Bug 18190 - Track selection cannot be performed (synchronously) per inserted track
Track selection cannot be performed (synchronously) per inserted track
Product: HTML WG
Classification: Unclassified
Component: HTML5 spec
Other other
: P3 normal
: ---
Assigned To: Silvia Pfeiffer
HTML WG Bugzilla archive list
Depends on:
  Show dependency treegraph
Reported: 2012-07-18 17:37 UTC by contributor
Modified: 2012-09-28 05:39 UTC (History)
5 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description contributor 2012-07-18 17:37:04 UTC
This was was cloned from bug 17168 as part of operation convergence.
Originally filed: 2012-05-24 12:22:00 +0000

 #0   contributor@whatwg.org                          2012-05-24 12:22:24 +0000 
Specification: http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html
Multipage: http://www.whatwg.org/C#sourcing-out-of-band-text-tracks
Complete: http://www.whatwg.org/c#sourcing-out-of-band-text-tracks

Track selection cannot be performed (synchronously) per inserted track

Posted from: 2001:4c28:a032:32:99ec:df32:e805:6235 by philipj@opera.com
User agent: Opera/9.80 (X11; Linux x86_64; U; Edition Next; en) Presto/2.10.289 Version/12.00
 #1   Philip J                                        2012-05-24 13:06:57 +0000 
The spec text begins with "When a text track corresponding to a track element is added to a media element's list of text tracks, the user agent must set the text track mode appropriately, as determined by the following conditions:"

It appears that this requires the steps that follow to be run synchronously when a track element is inserted, which is not what we want to implement. Doing so could mean that if a user has indicated a preference for English, French and Swedish (in that order) and tracks in Swedish, French and English are added by script (in that order), the Swedish and French tracks will first be enabled, and then set to hidden when the next track is added.

We want to implement a heuristic that look at the set of available tracks all at once and picks enables those that that are relevant. This heuristic should be run synchronously when the parser encounters </video> (including in innerHTML) and after awaiting a stable state if a script inserts a <track> element.
 #2   Philip J                                        2012-05-24 13:12:13 +0000 
As a more theoretical concern, since the spec as written asks things like "If there is a text track in the media element's list of text tracks whose text track mode is showing by default" a naive implementation of that while inserting tracks would lead to O(n^2) track insertion.
Comment 1 Silvia Pfeiffer 2012-09-28 05:39:23 UTC
EDITOR'S RESPONSE: This is an Editor's Response to your comment. If
you are satisfied with this response, please change the state of
this bug to CLOSED. If you have additional information and would
like the Editor to reconsider, please reopen this bug. If you would
like to escalate the issue to the full HTML Working Group, please
add the TrackerRequest keyword to this bug, and suggest title and
text for the Tracker Issue; or you may create a Tracker Issue
yourself, if you are able to do so. For more details, see this
document:   http://dev.w3.org/html5/decision-policy/decision-policy.html

Status: Accepted
Change Description: applied patch
Rationale: adopted resolution by WHATWG