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

Unclear requirements around VTTRegion id #353

Closed
zcorpan opened this issue Aug 15, 2017 · 2 comments
Closed

Unclear requirements around VTTRegion id #353

zcorpan opened this issue Aug 15, 2017 · 2 comments

Comments

@zcorpan
Copy link
Member

zcorpan commented Aug 15, 2017

#349 introduced VTTRegion id

In web-platform-tests/wpt#6885 I tried to write a test for it.

The spec says that the identifier (in the model) is: https://w3c.github.io/webvtt/#webvtt-region-identifier

An arbitrary string of one or more characters other than U+0020 SPACE or U+0009 CHARACTER TABULATION character. The string must not contain the substring "-->" (U+002D HYPHEN-MINUS, U+002D HYPHEN-MINUS, U+003E GREATER-THAN SIGN). An identifier is required for a region to exist.

One or more characters means it can't be the empty string. So what is then the initial value when creating a VTTRegion with the constructor?

This part also doesn't make sense to me:

An identifier is required for a region to exist.

"required" is an RFC2119 keyword, but what is this requiring, from whom (author or UA)? If it's intended to be a statement of fact, which requirements does it follow from?

From parsing, a region can well be created with an empty identifier:
https://w3c.github.io/webvtt/#collect-a-webvtt-block

Let region’s identifier be the empty string.

So I think we can choose one of the following approaches:

  1. Allow empty identifiers, but say that from parsing, a cue cannot be associated with a region if the identifier is the empty string, but they can be associated with the API.
  2. Enforce non-empty identifiers during parsing and in the API. The parser would drop the region on the floor as a last step in https://w3c.github.io/webvtt/#collect-webvtt-region-settings if the identifier is the empty string. In the API we would add a required argument to the constructor and have it throw if the empty string is given, and the id setter would also throw if it's set to the empty string.

I don't see what the value is of (2) over (1); when using the API there's no reason to mint an identifier, and the change to require a non-empty identifier would be a breaking change. So I suggest we opt for (1).

@zcorpan
Copy link
Member Author

zcorpan commented Aug 15, 2017

@silviapfeiffer

@silviapfeiffer
Copy link
Member

I totally agree with (1) - that was always my intent.

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

No branches or pull requests

2 participants