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

New ATTRIBUTES block #523

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open

Conversation

cookiecrook
Copy link

@cookiecrook cookiecrook commented Feb 3, 2024

Closes #511

Add new ATTRIBUTES block parsing rules and examples as discussed in #511.


Preview | Diff

index.bs Show resolved Hide resolved
index.bs Show resolved Hide resolved
index.bs Outdated Show resolved Hide resolved
index.bs Outdated Show resolved Hide resolved
@cookiecrook cookiecrook self-assigned this Mar 29, 2024
index.bs Outdated Show resolved Hide resolved
index.bs Outdated Show resolved Hide resolved
@cookiecrook cookiecrook marked this pull request as ready for review June 14, 2024 00:37
@cookiecrook
Copy link
Author

cookiecrook commented Jun 14, 2024

Marking as Ready for Review despite there being some TODOs remaining in the diff. Feedback requested from @gkatsev, @silviapfeiffer, @nigelmegitt, @eric-carlson, @chrisn, @bdougherty, et al.

index.bs Outdated Show resolved Hide resolved
index.bs Outdated Show resolved Hide resolved
index.bs Outdated Show resolved Hide resolved
index.bs Outdated Show resolved Hide resolved
@cookiecrook
Copy link
Author

I think this PR is merge-ready now once a TTWG reviewer approves. The previously included TODO comments are now removed from this PR in favor of addressing that follow-on work in:

Copy link
Contributor

@nigelmegitt nigelmegitt left a comment

Choose a reason for hiding this comment

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

I think this would benefit from more clarity (i.e. more text) about the intended use of ATTRIBUTES and its relationship to attributes on the HTML <track> element, and any other potential usage context.

index.bs Show resolved Hide resolved
index.bs Outdated Show resolved Hide resolved
index.bs Outdated
Comment on lines 579 to 582
NOTE
Standard subtitles (unlike CC or SDH captions) typically
translate spoken dialog or signage, but not audible sounds
effects like "dogs barking."
Copy link
Contributor

Choose a reason for hiding this comment

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

This example isn't a great place to put definitional content. The WebVTT spec does not currently distinguish between subtitles and captions and that's probably a good thing. If there's an intended linkage between the kind attribute and the HTML track element's kind attribute then that should be explicit in the spec text.

Copy link
Author

Choose a reason for hiding this comment

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

If there's an intended linkage between the kind attribute and the HTML track element's kind attribute then that should be explicit in the spec text.

I included that in the "WebVTT attributes key/value parsing rules."

   <dt>If the key name is "<code>kind</code>"</dt>
   <dd>Process the value as <a href="https://html.spec.whatwg.org/multipage/media.html#attr-track-kind">the kind attribute</a> of a track element according to the HTML Standard.</dd>

Did you miss the above text, or is there some additional place where you'd like it added? Thanks for clarifying.

Copy link
Contributor

Choose a reason for hiding this comment

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

I may have missed it, but I can see why: that's appearing as part of §6.6 "WebVTT rules for extracting the chapter title" - shouldn't it be in its own numbered section?

Aside from that, what does "process the value as ..." mean? Does it mean that it takes precedence over the same attribute on the <track> element? Seems like we need to say something about precedence in this scenario.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I may have missed it, but I can see why: that's appearing as part of §6.6 "WebVTT rules for extracting the chapter title" - shouldn't it be in its own numbered section?

I agree, it should be a separate section.

Aside from that, what does "process the value as ..." mean? Does it mean that it takes precedence over the same attribute on the <track> element? Seems like we need to say something about precedence in this scenario.

I was wondering the same. Are these purely metadata or do they interact with the HTML/DOM in any way? And what is the order of precedence if both values are used? The track element wins? That might need a change in HTML?

Copy link
Author

Choose a reason for hiding this comment

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

Section mismatch was probably due to my unfamiliarty with Bikeshed. I will correct it and look at your other question at the same time.


<div class="example">

<p>In this example, an optional WebVTT attributes object is used to differentiate captions from standard subtitles.</p>
Copy link
Contributor

Choose a reason for hiding this comment

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

My feeling here is that the number of examples enumerating different values of kind is unnecessary given that this specification is not defining that attribute's value set. Better to have one example and, somewhere, link the value set to its canonical definition.

Copy link
Author

Choose a reason for hiding this comment

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

I'm not sure I understand... Are you suggesting the value parsing algo cross reference the HTML Infra values in track[kind]?

Copy link
Author

Choose a reason for hiding this comment

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

Oh, upon re-reading, it sounds like you're suggesting the examples be removed.

FWIW, as a reader of the spec (this was my first PR to VTT), I found the pre-existing examples helpful. Perhaps others will too? The ATTRIBUTES block is defined here, so seeing how it's used with different key/value pairs seems useful to me, even if those values are defined by HTML.

Copy link
Author

Choose a reason for hiding this comment

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

There is one of each:

  • subtitle example
  • caption example
  • description example
  • metadata example

I'd prefer to leave all 4 examples, but perhaps we can compromise on just removing the subtitle example?

Copy link
Contributor

Choose a reason for hiding this comment

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

I still think there are too many but it's not a major complaint; as you say, many folk find examples an easy way into understanding the specification.

Also I just noticed that Example 14 is appearing in the Chapters section, but its about descriptions, so it seems to be misplaced.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I tend to like a lot of examples.

Given how similar the subtitles and captions examples are, maybe we only keep one?

index.bs Outdated Show resolved Hide resolved
index.bs Outdated Show resolved Hide resolved
<li>
The following components, in the given order:
<ol>
<li>A <a>WebVTT line terminator</a>.</li>
Copy link
Contributor

Choose a reason for hiding this comment

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

I am not sure, but this item seems to be out from this <ol>, since it divides the ATTRIBUTES line but not in key/value pairs

Copy link
Author

@cookiecrook cookiecrook Jun 29, 2024

Choose a reason for hiding this comment

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

I intended that as the line termination char on the same line as ATTRIBUTES

ATTRIBUTES
          ^

But I'd be happy to combine it with the previous line, or specify some other way at the editors' direction.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we can remove a level here. So, at the top say "attributes block consists of the following components, in the given order:"

  • string ATTRIBUTES
  • Zero or more U+0020 SPACE characters or U+0009 CHARACTER TABULATION (tab) characters
  • line terminator
  • attributes block body
  • line terminator

This would match the webvtt region block definition too: https://pr-preview.s3.amazonaws.com/cookiecrook/webvtt/pull/523.html#webvtt-region-definition-block https://github.com/w3c/webvtt/blob/main/index.bs#L1500-L1511

The "attributes block body" (current lines 1774-1797) could either be inline or could move into its own subsection.

index.bs Show resolved Hide resolved
@nigelmegitt
Copy link
Contributor

Needs a review from the Editor, @gkatsev .

@nigelmegitt
Copy link
Contributor

nigelmegitt commented Sep 23, 2024

See also another operational practice described for doing this at #485 (comment) in which YouTube is doing it in the Header section. We should probably make sure that whatever we specify here aligns with practice, or if not, that folk using that alternative approach are happy to change.

Update: @gkatsev had the action to draft a PR to resolve #485, and that looks to me as though it would overlap strongly with this PR.

Copy link
Collaborator

@gkatsev gkatsev left a comment

Choose a reason for hiding this comment

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

Thanks for the work on this @cookiecrook and for your patience!

@@ -658,6 +714,32 @@ CSS comment (e.g. <code>/**/</code>).</p>

</div>



<div class="example">
Copy link
Collaborator

Choose a reason for hiding this comment

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

we probably want this in a separate section on descriptions, alternatively, should move to section 1.4 Other caption and subtitling features rather than being in the chapters section.

<li>
The following components, in the given order:
<ol>
<li>A <a>WebVTT line terminator</a>.</li>
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we can remove a level here. So, at the top say "attributes block consists of the following components, in the given order:"

  • string ATTRIBUTES
  • Zero or more U+0020 SPACE characters or U+0009 CHARACTER TABULATION (tab) characters
  • line terminator
  • attributes block body
  • line terminator

This would match the webvtt region block definition too: https://pr-preview.s3.amazonaws.com/cookiecrook/webvtt/pull/523.html#webvtt-region-definition-block https://github.com/w3c/webvtt/blob/main/index.bs#L1500-L1511

The "attributes block body" (current lines 1774-1797) could either be inline or could move into its own subsection.

index.bs Show resolved Hide resolved
@@ -4130,6 +4283,30 @@ follows:</p>
</ol>


<p>The <dfn>WebVTT attributes key/value parsing rules</dfn> consist of the following algorithm.</p>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
<p>The <dfn>WebVTT attributes key/value parsing rules</dfn> consist of the following algorithm.</p>
<h3 id=rules-for-parsing-attr-key-values algorithm>WebVTT Attributes key/value parsing rules</h3>
<p>The <dfn>WebVTT attributes key/value parsing rules</dfn> consist of the following algorithm.</p>


<div class="example">

<p>In this example, an optional WebVTT attributes object is used to differentiate captions from standard subtitles.</p>
Copy link
Collaborator

Choose a reason for hiding this comment

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

I tend to like a lot of examples.

Given how similar the subtitles and captions examples are, maybe we only keep one?

@gkatsev
Copy link
Collaborator

gkatsev commented Sep 24, 2024

See also another operational practice described for doing this at #485 (comment) in which YouTube is doing it in the Header section. We should probably make sure that whatever we specify here aligns with practice, or if not, that folk using that alternative approach are happy to change.

What YouTube has definitely seems to align with it. Would be great if we can find someone from there to comment on this, if they could potentially move to the new block when it exists.

Update: @gkatsev had the action to draft a PR to resolve #485, and that looks to me as though it would overlap strongly with this PR.

I think ultimately, particularly, with HLS's usage of the header, we do still want the header as "point of extensibility" there. But, we may want to discourage new uses of it, since the majority of these use cases could use the ATTRIBUTES block. As an example, the ECMAScript spec added the __proto__ to the spec to get it documented but marked it as legacy: https://262.ecma-international.org/15.0/index.html#sec-object.prototype.__proto__ (I'm not aware of something specific like that in HTML or w3c specs, but I'm also not sure that there's anything against doing so).

@cookiecrook
Copy link
Author

@gkatsev wrote:

What YouTube has definitely seems to align with it. Would be great if we can find someone from there to comment on this, if they could potentially move to the new block when it exists.

Yes, I have taken that as an action.

@css-meeting-bot
Copy link
Member

The Timed Text Working Group just discussed New ATTRIBUTES block w3c/webvtt#523, and agreed to the following:

  • SUMMARY: @cookiecrook to raise issue on HTML about track attribute precedence
The full IRC log of that discussion <nigel> Subtopic: New ATTRIBUTES block #523
<nigel> github: https://github.com//pull/523
<nigel> jcraig: Need to assess, if there's a mismatch, which one wins.
<nigel> .. I don't have a strong opinion.
<nigel> .. Main reason we want it in the VTT is sometimes there's no HTML as an intermediary,
<nigel> .. so the track information is missing.
<nigel> gkatsev: That makes sense, my question would be would this also allow a change in HTML
<nigel> .. if we're adding precedence to those attributes.
<nigel> jcraig: I would expect that whatever we land on, we could have the same thing reflected on the track element
<nigel> eric_carlson: We also would want to add some text to the spec describing the rules of precedence,
<nigel> .. whichever way we go.
<nigel> Nigel: How are you going to work out which way to go?
<nigel> eric_carlson: We'll put a stick in the ground and we'll be right.
<nigel> gkatsev: My assumption is the track element takes precedence
<nigel> eric_carlson: That would be right, it would override what's in the file.
<nigel> gkatsev: Can still have the precedence rules in the VTT spec but would also need them in HTML
<nigel> eric_carlson: HTML doesn't say anything about how to process the contents of the VTT file,
<nigel> .. so maybe no change needed.
<nigel> jcraig: The other editorial suggestions seem fine to me.
<nigel> .. There was a section question, was just my unfamiliarity with bikeshed.
<nigel> gkatsev: Should we open an HTML issue now around this to get the conversation going.
<nigel> jcraig: I'll take that as an action and write it into PR 523 so I don't forget it.
<nigel> pal: On that last point, if you run into any issues, I can help, please don't hesitate to ask.
<nigel> jcraig: You mean pushback on HTML?
<nigel> pal: Sure, ultimately the question is who writes those tests.
<nigel> .. As Nigel pointed out there's a large body of tests to port to WPT.
<nigel> .. With reference renderers once we've overcome the issue of should we have that at all in WPT,
<nigel> .. I'm confident that we'll have the resources to make that happen.
<nigel> group confusion caused because Pierre misheard!
<nigel> gkatsev: With that we can, unless there's anything specific to WebVTT right now we can end
<nigel> SUMMARY: @cookiecrook to raise issue on HTML about track attribute precedence

@cookiecrook
Copy link
Author

I've also taken an action to file an issue to HTML to propose any reflected attributes from the VTT to HTML Track content attributes.

@cookiecrook
Copy link
Author

cookiecrook commented Sep 30, 2024

From @eric-carlson:

I just noticed all of the VTT files in the Dash CEA608 parser test suite have metadata in the header section, although they use = as the delimiter between key and value

All examples use the following, identical headers. Of note, kind key is similar vocabulary usage to the proposal above, though with slight mismatch: kind: captions vs Kind=Caption.

WEBVTT
Styling=CEA608
Kind=Caption
Channel=CC1

00:00:00.333 --> 00:00:03.000 line:11
White text on black

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