Skip to content

Commit dafc23f

Browse files
authored
Make VTTCue#endTime be an unrestricted double (#493)
Allow endTime for VTTCue to be set to Infinity to represent unbounded text track cues.
1 parent 6befe1d commit dafc23f

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

index.bs

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ urlPrefix: https://html.spec.whatwg.org/multipage/
5454
text: rules for extracting the chapter title
5555
text: text track cue start time
5656
text: text track cue end time
57+
text: unbounded text track cue
5758
text: expose a user interface to the user
5859
text: text track cue order
5960
text: honor user preferences for automatic text track selection
@@ -5546,7 +5547,7 @@ enum PositionAlignSetting { "line-left", "center", "line-right", "auto" };
55465547
enum AlignSetting { "start", "center", "end", "left", "right" };
55475548
[Exposed=Window]
55485549
interface VTTCue : TextTrackCue {
5549-
constructor(double startTime, double endTime, DOMString text);
5550+
constructor(double startTime, unrestricted double endTime, DOMString text);
55505551
attribute VTTRegion? region;
55515552
attribute DirectionSetting vertical;
55525553
attribute boolean snapToLines;
@@ -5568,7 +5569,8 @@ interface VTTCue : TextTrackCue {
55685569
<dd>
55695570
<p>Returns a new {{VTTCue}} object, for use with the {{TextTrack/addCue()}} method.</p>
55705571
<p>The |startTime| argument sets the <a>text track cue start time</a>.</p>
5571-
<p>The |endTime| argument sets the <a>text track cue end time</a>.</p>
5572+
<p>The |endTime| argument sets the <a>text track cue end time</a>. In the case of the value being
5573+
positive Infinity, the {{VTTCue}} object represents an <a>unbounded text track cue</a>.</p>
55725574
<p>The |text| argument sets the <a>cue text</a>.</p>
55735575
</dd>
55745576

@@ -5689,11 +5691,14 @@ interface VTTCue : TextTrackCue {
56895691

56905692
<li><p>Create a new <a>WebVTT cue</a>. Let |cue| be that <a>WebVTT cue</a>.</p></li>
56915693

5692-
<li><p>Let |cue|'s <a>text track cue start time</a> be the value of the |startTime| argument,
5693-
interpreted as a time in seconds.</p></li>
5694+
<li><p>Let |cue|'s <a>text track cue start time</a> be the value of the |startTime|
5695+
argument.</p></li>
56945696

5695-
<li><p>Let |cue|'s <a>text track cue end time</a> be the value of the |endTime| argument,
5696-
interpreted as a time in seconds.</p></li>
5697+
<li><p>If the value of the |endTime| argument is negative Infinity or a Not-a-Number (NaN) value,
5698+
then throw a <a
5699+
href="https://tc39.es/ecma262/#sec-native-error-types-used-in-this-standard-typeerror">TypeError
5700+
</a> exception. Otherwise, let |cue|'s <a>text track cue end time</a> be the value of the |endTime|
5701+
argument.</p></li>
56975702

56985703
<li><p>Let |cue|'s <a>cue text</a> be the value of the |text| argument, and let the <a>rules for
56995704
extracting the chapter title</a> be the <a>WebVTT rules for extracting the chapter

0 commit comments

Comments
 (0)