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

Expose the fallback language in the API #258

Open
zcorpan opened this issue Nov 13, 2015 · 2 comments
Open

Expose the fallback language in the API #258

zcorpan opened this issue Nov 13, 2015 · 2 comments
Labels
addition/proposal i18n-needs-resolution Issue the Internationalization Group has raised and looks for a response on. normative change

Comments

@zcorpan
Copy link
Member

zcorpan commented Nov 13, 2015

In #257 I made it possible for the "List of WebVTT Node Objects" object to have an "applicable language", but this can't be exposed in getCueAsHTML() since that object maps to a DocumentFragment, which can't have a lang attribute.

One way to make this work is to change from DocumentFragment to an HTML div or span element, and set lang on it if is has an "applicable language".

Existing scripts that just insert whatever comes out of getCueAsHTML() to the document should continue to work, it would just get an extra element. I suppose span is a bit more versatile than div because it is allowed in more places (e.g. in a p element). OTOH, just dumping all cues and have them be separated from each other by default could be nice.

An alternative could be to have the fallback language be a property of TextTrack, and have JS be responsible for setting a lang attribute on a container element in which it inserts cues with getCueAsHTML().

@zcorpan
Copy link
Member Author

zcorpan commented Nov 13, 2015

Hmm TextTrack already exposes the "fallback" language in https://html.spec.whatwg.org/multipage/embedded-content.html#dom-texttrack-language

@silviapfeiffer
Copy link
Member

DocumentFragment has the advantage of being able to be cloned and handed around more cheaply. Maybe make a div node inside the DocumentFragment that all the rest is appended to?

@r12a r12a added the i18n-needs-resolution Issue the Internationalization Group has raised and looks for a response on. label Oct 21, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
addition/proposal i18n-needs-resolution Issue the Internationalization Group has raised and looks for a response on. normative change
Projects
None yet
Development

No branches or pull requests

3 participants