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

Update FakeWindow to be able to create actual HTMLElements #82

Closed
RickEyre opened this issue Jul 26, 2013 · 3 comments
Closed

Update FakeWindow to be able to create actual HTMLElements #82

RickEyre opened this issue Jul 26, 2013 · 3 comments
Labels

Comments

@RickEyre
Copy link
Contributor

The way the WebVTT spec has us create the DOM elements is just to create an element with localName 'b' or 'u', etc. However, this doesn't give us support for these tags in Gecko out of the box. Then, according to the spec, we have to apply CSS to each of theses nodes to get the 'bold' or 'italic' look in the subtitles.

What we were doing before is to instead just construct HTML elements and use that as our DOM tree. This gives us support for 'bold', 'italic', etc, out of the box. To do this we would need to have convertCueToDOMTree be able to call createElement('b'), createElement('u'), etc, on the FakeWindow.

I would recommend going with option 2. It's a lot easier and this part of the spec is all internal so we can go with whatever route we want.

@RickEyre
Copy link
Contributor Author

Now that I'm looking it it might be easier just to apply the CSS rules that the WebVTT spec says we should. It will be just as easy as using createElement('b'), etc. FakeWindow would still have to change most likely and ConvertCueToDOMTree would now apply the appropriate CSS rules to the elements when it creates them.

@RickEyre
Copy link
Contributor Author

So looking through createElement() function on WebVTTParser I see that this is already handled via. the first option I talked about. Didn't see it for some reason. Strange that this is already in place, but the styling isn't showing up on the rendered subtitles.

@RickEyre
Copy link
Contributor Author

Fixed by #87.

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

No branches or pull requests

1 participant