[webvtt] Viewport Units and Styling (#489)

gkatsev has just created a new issue for https://github.com/w3c/webvtt:

== Viewport Units and Styling ==
Tl;dr viewport unit sizing doesn't work in browsers.
1. Is this a spec issue or an implementation issue?
2. Should viewport units be with respect to the element or the viewable portion? Or should new units be given?

-------------------

There're some inconsistencies between browsers and how viewport units are handled by browsers. This could be because the WebVTT is unclear or it could be an implementation limitation.
The expectation is that viewport units that apply to cues would use the video element's size as viewport they're sizing with respect to. My thoughts are as follows:
1. Viewport relative lengths are relative to the initial containing block according to https://drafts.csswg.org/css-values-3/#viewport-relative-lengths.
2. The containing block defines a viewport for continuous media https://www.w3.org/TR/CSS21/visudet.html#containing-block-details
3. Under the rendering section in the Processing Model WebVTT defines the initial containing block of the video to the video rendering area Step 12.2.3 https://w3c.github.io/webvtt/#processing-model
4. Therefore, viewport units applied to cues should be relative to the video rendering area.

However, using a simple with the following:
```css
::cue {
  font-size: 10vh;
}
```
I can confirm that Chrome and Safari both display this as 10% of the page size and not the video size. Firefox ignores inline styles but seems to fail to render captions when the styles are in the HTML page.

There is a further point of nuance here brought up by @nigelmegitt around what the viewport units should be in reference to within the video element. Should they be with respect to the media element itself or just the video or viewable portion of it? The latter being important for positioning captions within the viewable area if the video element ends up being sized to a different aspect ratio than the media itself. The question here is whether existing viewport units should be with respect to that or whether we need a new media level unit for this.

Please view or discuss this issue at https://github.com/w3c/webvtt/issues/489 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Wednesday, 2 September 2020 16:47:08 UTC