You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
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.
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.
The text was updated successfully, but these errors were encountered: