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 21079 - addTextTrack() incorrectly assumes WebVTT content type
Summary: addTextTrack() incorrectly assumes WebVTT content type
Status: RESOLVED FIXED
Alias: None
Product: HTML WG
Classification: Unclassified
Component: HTML5 spec (show other bugs)
Version: unspecified
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: Silvia Pfeiffer
QA Contact: HTML WG Bugzilla archive list
URL:
Whiteboard:
Keywords: CR
Depends on:
Blocks:
 
Reported: 2013-02-22 01:11 UTC by Glenn Adams
Modified: 2013-06-12 10:00 UTC (History)
8 users (show)

See Also:


Attachments

Description Glenn Adams 2013-02-22 01:11:48 UTC
Step 5 of the description of addTextTrack() needs to be reformulated in a manner that is independent of the use of WebVTT.

At present, the following language appears:

"Associate the text track list of cues with the rules for updating the display of WebVTT text tracks as its rules for updating the text track rendering. [WEBVTT]"

Since a text track need not make use of WebVTT, this language is overly constraining, and presumes a specific content format for track data.

In order to resolve, I propose adding a (possibly optional) MIME media type parameter to addTextTrack() so that the caller can specify the associated content type semantics. For example, the caller might specify text/vtt if WebVTT semantics apply to the track, or might specify application/xml+ttml if TTML semantics apply, etc. Using the specified MIME type, the UA can select the appropriate set of rules to associate with the text track list of cues.

If this parameter were made optional, then the default value might be specified as text/vtt.
Comment 1 Silvia Pfeiffer 2013-05-13 04:50:06 UTC
Even though we are still discussing how to resolve bug 21851 properly, I think we can already apply the patch to this part of the spec from HTML5.1.

I suggest we change:

"Associate the text track list of cues with the rules for updating the display of WebVTT text tracks as its rules for updating the text track rendering. [WEBVTT]"

to

"Initially, the text track list of cues is not associated with any rules for updating the text track rendering. When a text track cue is added to it, the text track list of cues has its rules permanently set accordingly."

And in the addCue [1] description we change:

"1. If the given cue is in a text track list of cues, then remove cue from that text track list of cues.

2. Add cue to the method's TextTrack object's text track's text track list of cues."

to

"1. If the text track list of cues does not yet have any associated rules for updating the text track rendering, then associate the text track list of cues with the rules for updating the text track rendering appropriate to cue.

2. If text track list of cues' associated rules for updating the text track rendering are not the same rules for updating the text track rendering as appropriate for cue, then throw an InvalidStateError exception and abort these steps.

3. If the given cue is in a text track list of cues, then remove cue from that text track list of cues.

4. Add cue to the method's TextTrack object's text track's text track list of cues.
"

[1] http://www.w3.org/TR/html5/single-page.html#dom-texttrack-addcue
Comment 2 Glenn Adams 2013-05-13 06:41:46 UTC
(In reply to comment #1)
> Even though we are still discussing how to resolve bug 21851 properly, I
> think we can already apply the patch to this part of the spec from HTML5.1.
> 
> I suggest we change:
> 
> "Associate the text track list of cues with the rules for updating the
> display of WebVTT text tracks as its rules for updating the text track
> rendering. [WEBVTT]"
> 
> to
> 
> "Initially, the text track list of cues is not associated with any rules for
> updating the text track rendering. When a text track cue is added to it, the
> text track list of cues has its rules permanently set accordingly."
> 
> And in the addCue [1] description we change:
> 
> "1. If the given cue is in a text track list of cues, then remove cue from
> that text track list of cues.
> 
> 2. Add cue to the method's TextTrack object's text track's text track list
> of cues."
> 
> to
> 
> "1. If the text track list of cues does not yet have any associated rules
> for updating the text track rendering, then associate the text track list of
> cues with the rules for updating the text track rendering appropriate to cue.
> 
> 2. If text track list of cues' associated rules for updating the text track
> rendering are not the same rules for updating the text track rendering as
> appropriate for cue, then throw an InvalidStateError exception and abort
> these steps.
> 
> 3. If the given cue is in a text track list of cues, then remove cue from
> that text track list of cues.
> 
> 4. Add cue to the method's TextTrack object's text track's text track list
> of cues.
> "
> 
> [1] http://www.w3.org/TR/html5/single-page.html#dom-texttrack-addcue

I believe this will work, though it does mean that the cues associated with a text track must all share the same associated rules, meaning further that, if a text track content type, like text/vtt supports multiple cues (of different associated rules), then the cues of that track content type must be effectively demuxed into distinct track cue lists. Is that your intention?
Comment 3 Silvia Pfeiffer 2013-05-13 07:31:08 UTC
(In reply to comment #2)
>
> I believe this will work, though it does mean that the cues associated with
> a text track must all share the same associated rules, meaning further that,
> if a text track content type, like text/vtt supports multiple cues (of
> different associated rules)

It is not intended for WebVTT to support this. All cues in a WebVTT file must be parsed with the same associated rules.

>, then the cues of that track content type must
> be effectively demuxed into distinct track cue lists. Is that your intention?

If a file format was to provide multiple cues and cues would not follow the associated rule, those cues that don't fit the TextTrack's associated parsing rules would be dropped.
Comment 4 Silvia Pfeiffer 2013-06-12 10:00:09 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:
https://github.com/w3c/html/commit/1a92cbac47cc4420c048f1a794d98457733c05f7

Rationale: changed as proposed below