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 16643 - WebVTT: Displaying multiple lines
Summary: WebVTT: Displaying multiple lines
Status: RESOLVED FIXED
Alias: None
Product: TextTracks CG
Classification: Unclassified
Component: WebVTT (show other bugs)
Version: unspecified
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: Ian 'Hixie' Hickson
QA Contact: This bug has no owner yet - up for the taking
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-04-05 16:36 UTC by Frank Olivier
Modified: 2012-10-08 23:01 UTC (History)
5 users (show)

See Also:


Attachments

Description Frank Olivier 2012-04-05 16:36:02 UTC
(See http://lists.w3.org/Archives/Public/public-texttracks/2012Apr/0002.html) 

As an caption file author, I would expect that WebVTT would have some mechanism for defining and displaying multiple lines in a single cue 
(Use cases: One line each for two+ simultaneous speakers; A line of dialogue + a line with a sound effect description, etc )

In the spec, WebVTT line terminators are used to indicate separate (parsed) lines; we should apply this to cue text as well:

00:00:00.142 --> 00:00:08.501
Line 1
Line 2

Line 1 would render above Line 2 in the video.

We should change the spec to clearly specify that WebVTT line terminators indicate a line break in cue text.

For the sample cue above, .getCueAsHTML() should return a document fragment with three nodes:
Line 1
<br />
LIne 2
Comment 1 Glenn Maynard 2012-04-05 21:22:49 UTC
This is not how WebVTT should behave.  Please see the discussion in the thread you started (as well as earlier discussions):

http://lists.w3.org/Archives/Public/public-texttracks/2012Apr/0002.html

If you want an explicit line break, you should be required to insert one explicitly, as with HTML.

00:00:00.142 --> 00:00:08.501
Line 1<br>
Line 2

(As an aside, note that if you have two simultaneous speakers, or other simultaneous but distinct events, you should generally encode that as two cues with the same timestamp, not as one cue with a line break encoded in it.)

Please follow-up on the mailing list where this is being discussed, to avoid fragmenting the discussion.  Thanks.
Comment 3 Ian 'Hixie' Hickson 2012-07-24 04:51:45 UTC
Frank: Can you elaborate on why the spec isn't clear that line breaks are preserved when rendering cues? The spec says "The 'white-space' property on the (root) List of WebVTT Node Objects must be set to 'pre-wrap'".
Comment 4 Frank Olivier 2012-07-26 18:48:51 UTC
(In reply to comment #3)
> Frank: Can you elaborate on why the spec isn't clear that line breaks are
> preserved when rendering cues? The spec says "The 'white-space' property on the
> (root) List of WebVTT Node Objects must be set to 'pre-wrap'".

I think it would be better to clearly define in the spec how multi-line cues should be constructed. Right now, there is no clear indicator that I should use <br> or \n (reading through the parsing algorithm defined in the spec indicates that multi-line cues as not supported at all)
Comment 5 Ian 'Hixie' Hickson 2012-08-06 21:27:16 UTC
I can add some non-normative prose somewhere to make it clearer to people just scanning through the spec, but as far as I can tell what an implementation must do is unambiguously defined.
Comment 6 contributor 2012-10-08 23:01:49 UTC
Checked in as WHATWG revision r7442.
Check-in comment: Add some material to WebVTT regarding line breaks.
http://html5.org/tools/web-apps-tracker?from=7441&to=7442