Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unbounded TextTrackCue end time #5953

Merged
merged 5 commits into from
Apr 20, 2021

Conversation

rjksmith
Copy link
Contributor

@rjksmith rjksmith commented Sep 27, 2020

Allow unbounded text track cue duration, as discussed in whatwg/html issue #5297.

Summary

It is proposed that a TextTrackCue.endTime value of Infinity be used to represent an unbounded time, i.e. an unspecified future time. This is a simple extension of the existing HTML standard where media.duration = Infinity represents the duration of an unbounded stream, which is consistent with the definition of unbounded time.

Implementer Details

(See WHATWG Working Mode: Changes for more details.)

cc @chrisn


/acknowledgements.html ( diff )
/media.html ( diff )

Copy link
Member

@foolip foolip left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change looks good, a pretty straightforward expansion of the allowed values that I think ought to work. The setter needs some changes, but that's it.

source Outdated
a <span>media element</span>'s <span>list of text tracks</span>, and the <span>media
element</span>'s <span>show poster flag</span> is not set, then run the <i data-x="time marches
on">time marches on</i> steps for that <span>media element</span>.</p>
<code>TextTrackCue</code> object represents, in seconds or positive Infinity for an
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because the IDL type of the attribute is now unrestricted double, the setter here needs to also handle -Infinity and NaN. I would suggest throwing a TypeError, which is what would currently happen. Run new VTTCue(0, 1, '').endTime = Infinity to see this in action.

https://html.spec.whatwg.org/#dom-input-valueasnumber has an example of this: "On setting, if the new value is infinite, then throw a TypeError exception." (You'll probably need to massage it a bit to fit into this paragraph.)

No reference to "unbounded text track cue" ought to be needed here in the end, because that's defined in terms of what is being set.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your feedback and apologies for the delay. I've added a check "on setting" to throw TypeError for -Infinity and NaN as you suggest, and have removed the reference here to "unbounded text track cue".

source Outdated
in a <span>text track</span>'s <span data-x="text track list of cues">list of cues</span>, and
that <span>text track</span> is in a <span>media element</span>'s <span>list of text
tracks</span>, and the <span>media element</span>'s <span>show poster flag</span> is not set, then
run the <i data-x="time marches on">time marches on</i> steps for that <span>media element</span>.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, looks like this is the only change really needed. https://html.spec.whatwg.org/#time-marches-on tests for "whose end times are greater than the current playback position" and that'll work for infinity.

rjksmith added a commit to away-team-software/webvtt that referenced this pull request Nov 4, 2020
Added support for unbounded TextTrackCue - see whatwg/html#5953
Whitespace removed by Atom
rjksmith added a commit to away-team-software/webvtt that referenced this pull request Nov 20, 2020
Update for TextTrackCue unbounded endTime proposed in PR whatwg/html#5953
Base automatically changed from master to main January 15, 2021 07:58
@gkatsev
Copy link

gkatsev commented Mar 10, 2021

rjksmith added a commit to away-team-software/wpt that referenced this pull request Apr 7, 2021
Added tests for unbounded TextTrackCue endTime changes proposed in whatwg/html#5953 & w3c/webvtt#493
@rjksmith
Copy link
Contributor Author

rjksmith commented Apr 7, 2021

Added unbounded cue tests in web-platform-tests/wpt#28394

@rjksmith
Copy link
Contributor Author

@annevk I believe the recent addition of web-platform-tests/wpt#28394 completes the information required for this issue, but I still see a failing check.

Participation Pending — @rjksmith participates on behalf of an unverified entity

Please advise if there are further actions I need to take to resolve this. Thanks.

@annevk
Copy link
Member

annevk commented Apr 15, 2021

Hey @rjksmith, thanks! We'll resolve that when this is ready to merge as per https://github.com/whatwg/participant-data/#maintenance. It does seem like you'll need to rebase this PR and @foolip needs to review.

chrisn and others added 3 commits April 16, 2021 13:21
Fixes whatwg#5297

<!--
Thank you for contributing to the HTML Standard! Please describe the change you are making and complete the checklist below if your change is not editorial.
-->

- [ ] At least two implementers are interested (and none opposed):
   * …
   * …
- [ ] [Tests](https://github.com/web-platform-tests/wpt) are written and can be reviewed and commented upon at:
   * …
- [ ] [Implementation bugs](https://github.com/whatwg/meta/blob/master/MAINTAINERS.md#handling-pull-requests) are filed:
   * Chrome: …
   * Firefox: …
   * Safari: …

(See [WHATWG Working Mode: Changes](https://whatwg.org/working-mode#changes) for more details.)
Added type validation for unrestricted TextTrackCue.endTime & removed reference to unbounded text track cue.
@rjksmith
Copy link
Contributor Author

Rebased to main as requested

@annevk annevk requested a review from foolip April 16, 2021 13:03
rjksmith added a commit to away-team-software/webvtt that referenced this pull request Apr 16, 2021
Update for TextTrackCue unbounded endTime proposed in PR whatwg/html#5953
rjksmith added a commit to away-team-software/wpt that referenced this pull request Apr 16, 2021
Added tests for unbounded TextTrackCue endTime changes proposed in whatwg/html#5953 & w3c/webvtt#493
@rjksmith
Copy link
Contributor Author

Also rebased w3c/webvtt#493 and web-platform-tests/wpt#28394 for associated VTTCue and Web Platform Tests changes respectively

Copy link
Member

@foolip foolip left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have but one remaining nit. I can rewrap the result if you don't feel like messing with it. (But feel free to.)

<p>An <dfn data-x="unbounded text track cue">unbounded text track cue</dfn> is a text track cue
with a <span>text track cue end time</span> set to positive Infinity. An active <span>unbounded
text track cue</span> cannot become inactive through the usual monotonic increase of the
<span>current playback position</span> during normal playback (e.g. a metadata cue for a chapter in a live
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good example!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks to @chrisn for that. Further use case discussion can be found in w3c/webvtt#496 which has been decoupled from this change.

source Outdated Show resolved Hide resolved
@foolip
Copy link
Member

foolip commented Apr 16, 2021

@rjksmith it turns out that I can't push the rewrap directly to you branch. Since it's a bit tedious, here it is for you to copy-paste directly, if you could push another commit that'd be great:

  <p>The <dfn><code data-x="dom-TextTrackCue-endTime">endTime</code></dfn> attribute, on getting,
  must return the <span>text track cue end time</span> of the <span>text track cue</span> that the
  <code>TextTrackCue</code> object represents, in seconds or positive Infinity. On setting, if the
  new value is negative Infinity or a Not-a-Number (NaN) value, then throw a <a
  href="https://tc39.es/ecma262/#sec-native-error-types-used-in-this-standard-typeerror">TypeError
  </a> exception. Otherwise, the <span>text track cue end time</span> must be set to the new value.
  Then, if the <code>TextTrackCue</code> object's <span>text track cue</span> is in a <span>text
  track</span>'s <span data-x="text track list of cues">list of cues</span>, and that <span>text
  track</span> is in a <span>media element</span>'s <span>list of text tracks</span>, and the
  <span>media element</span>'s <span>show poster flag </span> is not set, then run the <i
  data-x="time marches on">time marches on</i> steps for that <span>media element</span>.</p>

@rjksmith
Copy link
Contributor Author

@foolip Thanks for the text. Updated as requested

@foolip
Copy link
Member

foolip commented Apr 16, 2021

Now we just need the WebVTT change. It doesn't have to be merged at the same time, but be approved at least so it's not too far apart.

@rjksmith
Copy link
Contributor Author

w3c/webvtt#493 updated as requested

@foolip
Copy link
Member

foolip commented Apr 17, 2021

@rjksmith I've reviewed that, suggesting some changes.

@rjksmith
Copy link
Contributor Author

Updated implementation bugs for Chrome, Firefox and Safari with recent progress.

@foolip
Copy link
Member

foolip commented Apr 20, 2021

OK, I'm going to bet on w3c/webvtt#493 being merged soon, and merge this + web-platform-tests/wpt#28394 now.

@rjksmith can you keep an eye on the WebVTT change, and circle back here if it doesn't end up merged within a week?

@foolip foolip merged commit 0864a02 into whatwg:main Apr 20, 2021
foolip pushed a commit to web-platform-tests/wpt that referenced this pull request Apr 20, 2021
Added tests for unbounded TextTrackCue endTime changes proposed in whatwg/html#5953 & w3c/webvtt#493
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Apr 25, 2021
…only

Automatic update from web-platform-tests
Tests for unbounded cue end time (#28394)

Added tests for unbounded TextTrackCue endTime changes proposed in whatwg/html#5953 & w3c/webvtt#493
--

wpt-commits: 786c430165d916bdab740ab491ac541afb3f8bf5
wpt-pr: 28394
@rjksmith
Copy link
Contributor Author

rjksmith commented Apr 27, 2021

@foolip WebVTT change is still not merged.

There's an agenda item to resolve this in TTWG Meeting on 29th April 2021.

WebVTT
Added unbounded TextTrackCue.endTime w3c/webvtt#493
There have been a couple of requests to merge this - any reason why not?

@gkatsev
Copy link

gkatsev commented Apr 27, 2021

It's mostly unmerged because I haven't had a chance to get back to it yet, unfortunately. I believe there isn't anything that'll block it from being merged on the TTWG side, though, I'll wait for the final resolution from the meeting.

@rjksmith
Copy link
Contributor Author

@gkatsev I can attend the TTWG meeting on 29th April to respond to any concerns raised. If that would be helpful, please let me know how to join. Thanks.

@himorin
Copy link

himorin commented Apr 29, 2021

@gkatsev I can attend the TTWG meeting on 29th April to respond to any concerns raised. If that would be helpful, please let me know how to join. Thanks.

I'll send you information via email.

@rjksmith
Copy link
Contributor Author

@foolip I can confirm that w3c/webvtt#493 has now been successfully merged to support web-platform-tests/wpt#28394 which concludes the required changes for this PR.

I've also updated the implementation bugs for Chrome, Firefox and Safari accordingly.

Many thanks to all those who have contributed and especially to @chrisn, @eric-carlson, @annevk, @foolip and @gkatsev for their invaluable support.

@foolip
Copy link
Member

foolip commented Apr 30, 2021

Thanks @rjksmith! Just to know what to expect, will you be doing any work on any implementation here?

@rjksmith
Copy link
Contributor Author

@chrisn and I have been discussing ideas to encourage implementation. I'm considering a code contribution to Mozilla/Firefox.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

6 participants